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

Changeset 283340 in webkit


Ignore:
Timestamp:
Sep 30, 2021, 2:20:32 PM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Move canCompositeClipPath to RenderLayer
https://bugs.webkit.org/show_bug.cgi?id=231014

Patch by Rob Buis <rbuis@igalia.com> on 2021-09-30
Reviewed by Simon Fraser.

Move canCompositeClipPath to RenderLayer since the
code almost exclusively deals with layers. Also
remove unneeded ASSERTs.

  • rendering/RenderElement.cpp:

(WebCore::RenderElement::adjustStyleDifference const):

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::willCompositeClipPath const):

  • rendering/RenderLayer.h:
  • rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::canCompositeClipPath): Deleted.

  • rendering/RenderLayerCompositor.h:
Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r283339 r283340  
     12021-09-30  Rob Buis  <rbuis@igalia.com>
     2
     3        Move canCompositeClipPath to RenderLayer
     4        https://bugs.webkit.org/show_bug.cgi?id=231014
     5
     6        Reviewed by Simon Fraser.
     7
     8        Move canCompositeClipPath to RenderLayer since the
     9        code almost exclusively deals with layers. Also
     10        remove unneeded ASSERTs.
     11
     12        * rendering/RenderElement.cpp:
     13        (WebCore::RenderElement::adjustStyleDifference const):
     14        * rendering/RenderLayer.cpp:
     15        (WebCore::RenderLayer::willCompositeClipPath const):
     16        * rendering/RenderLayer.h:
     17        * rendering/RenderLayerCompositor.cpp:
     18        (WebCore::RenderLayerCompositor::canCompositeClipPath): Deleted.
     19        * rendering/RenderLayerCompositor.h:
     20
    1212021-09-30  Devin Rousso  <drousso@apple.com>
    222
  • trunk/Source/WebCore/rendering/RenderElement.cpp

    r283079 r283340  
    307307
    308308    if (contextSensitiveProperties & StyleDifferenceContextSensitiveProperty::ClipPath) {
    309         if (hasLayer()
    310             && downcast<RenderLayerModelObject>(*this).layer()->isComposited()
    311             && hasClipPath()
    312             && RenderLayerCompositor::canCompositeClipPath(*downcast<RenderLayerModelObject>(*this).layer()))
     309        if (hasLayer() && downcast<RenderLayerModelObject>(*this).layer()->willCompositeClipPath())
    313310            diff = std::max(diff, StyleDifference::RecompositeLayer);
    314311        else
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r283027 r283340  
    683683}
    684684
     685bool RenderLayer::willCompositeClipPath() const
     686{
     687    if (!isComposited())
     688        return false;
     689
     690    auto* clipPath = renderer().style().clipPath();
     691    if (!clipPath)
     692        return false;
     693
     694    if (renderer().hasMask())
     695        return false;
     696
     697    return (clipPath->type() != ClipPathOperation::Shape || clipPath->type() == ClipPathOperation::Shape) && GraphicsLayer::supportsLayerType(GraphicsLayer::Type::Shape);
     698}
     699
    685700void RenderLayer::dirtyNormalFlowList()
    686701{
  • trunk/Source/WebCore/rendering/RenderLayer.h

    r281296 r283340  
    239239#endif
    240240
     241    bool willCompositeClipPath() const;
     242
    241243protected:
    242244    void destroy();
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r283079 r283340  
    17611761}
    17621762
    1763 bool RenderLayerCompositor::canCompositeClipPath(const RenderLayer& layer)
    1764 {
    1765     ASSERT(layer.isComposited());
    1766     ASSERT(layer.renderer().style().clipPath());
    1767 
    1768     if (layer.renderer().hasMask())
    1769         return false;
    1770 
    1771     auto& clipPath = *layer.renderer().style().clipPath();
    1772     return (clipPath.type() != ClipPathOperation::Shape || clipPath.type() == ClipPathOperation::Shape) && GraphicsLayer::supportsLayerType(GraphicsLayer::Type::Shape);
    1773 }
    1774 
    17751763// FIXME: remove and never ask questions about reflection layers.
    17761764static RenderLayerModelObject& rendererForCompositingTests(const RenderLayer& layer)
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.h

    r282862 r283340  
    246246    void layerStyleChanged(StyleDifference, RenderLayer&, const RenderStyle* oldStyle);
    247247
    248     static bool canCompositeClipPath(const RenderLayer&);
    249 
    250248    // Get the nearest ancestor layer that has overflow or clip, but is not a stacking context
    251249    RenderLayer* enclosingNonStackingClippingLayer(const RenderLayer&) const;
Note: See TracChangeset for help on using the changeset viewer.