⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 249236 in webkit


Ignore:
Timestamp:
Aug 28, 2019, 8:01:39 PM (7 years ago)
Author:
Simon Fraser
Message:

Make FillLayer::hasImage() inline
https://bugs.webkit.org/show_bug.cgi?id=201265

Reviewed by Zalan Bujtas.

FillLayer::hasImage() shows up on profiles because it's called from hot functions like
isTransparent() and hasMask(), so make a basic inline version that doens't have
to walk the list.

  • rendering/style/FillLayer.cpp:

(WebCore::FillLayer::hasImageInAnyLayer const):
(WebCore::FillLayer::hasImage const): Deleted.

  • rendering/style/FillLayer.h:

(WebCore::FillLayer::hasImage const):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r249233 r249236  
     12019-08-28  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Make FillLayer::hasImage() inline
     4        https://bugs.webkit.org/show_bug.cgi?id=201265
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        FillLayer::hasImage() shows up on profiles because it's called from hot functions like
     9        isTransparent() and hasMask(), so make a basic inline version that doens't have
     10        to walk the list.
     11
     12        * rendering/style/FillLayer.cpp:
     13        (WebCore::FillLayer::hasImageInAnyLayer const):
     14        (WebCore::FillLayer::hasImage const): Deleted.
     15        * rendering/style/FillLayer.h:
     16        (WebCore::FillLayer::hasImage const):
     17
    1182019-08-28  Peng Liu  <peng.liu6@apple.com>
    219
  • trunk/Source/WebCore/rendering/style/FillLayer.cpp

    r248846 r249236  
    366366}
    367367
    368 bool FillLayer::hasImage() const
     368bool FillLayer::hasImageInAnyLayer() const
    369369{
    370370    for (auto* layer = this; layer; layer = layer->m_next.get()) {
  • trunk/Source/WebCore/rendering/style/FillLayer.h

    r239504 r249236  
    146146    bool containsImage(StyleImage&) const;
    147147    bool imagesAreLoaded() const;
    148     bool hasImage() const;
     148    bool hasImage() const { return m_next ? hasImageInAnyLayer() : m_image; }
    149149    bool hasFixedImage() const;
    150150    bool hasOpaqueImage(const RenderElement&) const;
     
    176176
    177177    void computeClipMax() const;
     178
     179    bool hasImageInAnyLayer() const;
    178180
    179181    std::unique_ptr<FillLayer> m_next;
Note: See TracChangeset for help on using the changeset viewer.