Changeset 220378 in webkit


Ignore:
Timestamp:
Aug 7, 2017, 7:46:06 PM (8 years ago)
Author:
Simon Fraser
Message:

Inline ~Color and Color::isExtended()
https://bugs.webkit.org/show_bug.cgi?id=175293

Reviewed by Zalan Bujtas.

The Color destructor and Color::isExtended() show up on profiles, so inline them.
Before r207265 the destructor was inlined.

Also make sure that LengthSize::operator== is inlined, which it was not (according
to profiles).

  • platform/LengthSize.h:

(WebCore::operator==):

  • platform/graphics/Color.cpp:

(WebCore::Color::~Color): Deleted.
(WebCore::Color::isExtended const): Deleted.

  • platform/graphics/Color.h:

(WebCore::Color::~Color):
(WebCore::Color::isExtended const):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r220376 r220378  
     12017-08-07  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Inline ~Color and Color::isExtended()
     4        https://bugs.webkit.org/show_bug.cgi?id=175293
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        The Color destructor and Color::isExtended() show up on profiles, so inline them.
     9        Before r207265 the destructor was inlined.
     10       
     11        Also make sure that LengthSize::operator== is inlined, which it was not (according
     12        to profiles).
     13
     14        * platform/LengthSize.h:
     15        (WebCore::operator==):
     16        * platform/graphics/Color.cpp:
     17        (WebCore::Color::~Color): Deleted.
     18        (WebCore::Color::isExtended const): Deleted.
     19        * platform/graphics/Color.h:
     20        (WebCore::Color::~Color):
     21        (WebCore::Color::isExtended const):
     22
    1232017-08-04  Brent Fulgham  <bfulgham@apple.com>
    224
  • trunk/Source/WebCore/platform/LengthSize.h

    r210758 r220378  
    2929};
    3030
    31 inline bool operator==(const LengthSize& a, const LengthSize& b)
     31ALWAYS_INLINE bool operator==(const LengthSize& a, const LengthSize& b)
    3232{
    3333    return a.width == b.width && a.height == b.height;
  • trunk/Source/WebCore/platform/graphics/Color.cpp

    r215172 r220378  
    308308}
    309309
    310 Color::~Color()
    311 {
    312     if (isExtended())
    313         m_colorData.extendedColor->deref();
    314 }
    315 
    316310Color& Color::operator=(const Color& other)
    317311{
     
    666660}
    667661
    668 bool Color::isExtended() const
    669 {
    670     return !(m_colorData.rgbaAndFlags & invalidRGBAColor);
    671 }
    672 
    673662ExtendedColor& Color::asExtended() const
    674663{
  • trunk/Source/WebCore/platform/graphics/Color.h

    r218717 r220378  
    174174    WEBCORE_EXPORT Color(Color&&);
    175175
    176     WEBCORE_EXPORT ~Color();
     176    ~Color()
     177    {
     178        if (isExtended())
     179            m_colorData.extendedColor->deref();
     180    }
    177181
    178182    static Color createUnchecked(int r, int g, int b)
     
    275279#endif
    276280
    277     WEBCORE_EXPORT bool isExtended() const;
     281    bool isExtended() const
     282    {
     283        return !(m_colorData.rgbaAndFlags & invalidRGBAColor);
     284    }
    278285    WEBCORE_EXPORT ExtendedColor& asExtended() const;
    279286
Note: See TracChangeset for help on using the changeset viewer.