Changeset 215347 in webkit
- Timestamp:
- Apr 13, 2017, 4:20:50 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/LayoutTests/ChangeLog ¶
r215344 r215347 1 2017-04-13 Antti Koivisto <antti@apple.com> 2 3 Don't invalidate composition for style changes in non-composited layers 4 https://bugs.webkit.org/show_bug.cgi?id=170805 5 <rdar://problem/31606185> 6 7 Reviewed by Simon Fraser. 8 9 * compositing/updates/animation-non-composited-expected.txt: Added. 10 * compositing/updates/animation-non-composited.html: Added. 11 1 12 2017-04-13 Ryan Haddad <ryanhaddad@apple.com> 2 13 -
TabularUnified trunk/Source/WebCore/ChangeLog ¶
r215340 r215347 1 2017-04-13 Antti Koivisto <antti@apple.com> 2 3 Don't invalidate composition for style changes in non-composited layers 4 https://bugs.webkit.org/show_bug.cgi?id=170805 5 <rdar://problem/31606185> 6 7 Reviewed by Simon Fraser. 8 9 Test: compositing/updates/animation-non-composited.html 10 11 In most cases they can't affect composition. Composition updates are expensive, this can 12 save a lot of work (tumblr.com animations hit this at the moment). 13 14 * rendering/RenderElement.h: 15 (WebCore::RenderElement::createsGroup): 16 (WebCore::RenderElement::createsGroupForStyle): 17 18 Factor to a static function so we can test style directly. 19 20 * rendering/RenderLayerCompositor.cpp: 21 (WebCore::RenderLayerCompositor::layerStyleChanged): 22 (WebCore::RenderLayerCompositor::styleChangeMayAffectIndirectCompositingReasons): 23 24 Test if style change might cause compositing change that can't be determined without compositing update. 25 26 * rendering/RenderLayerCompositor.h: 27 1 28 2017-04-13 JF Bastien <jfbastien@apple.com> 2 29 -
TabularUnified trunk/Source/WebCore/rendering/RenderElement.h ¶
r214503 r215347 141 141 142 142 // Returns true if this renderer requires a new stacking context. 143 bool createsGroup() const { return isTransparent() || hasMask() || hasClipPath() || hasFilter() || hasBackdropFilter() || hasBlendMode(); } 143 static bool createsGroupForStyle(const RenderStyle&); 144 bool createsGroup() const { return createsGroupForStyle(style()); } 144 145 145 146 bool isTransparent() const { return style().opacity() < 1.0f; } … … 445 446 } 446 447 448 inline bool RenderElement::createsGroupForStyle(const RenderStyle& style) 449 { 450 return style.opacity() < 1.0f || style.hasMask() || style.clipPath() || style.hasFilter() || style.hasBackdropFilter() || style.hasBlendMode(); 451 } 452 447 453 inline bool RenderObject::isRenderLayerModelObject() const 448 454 { -
TabularUnified trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp ¶
r215173 r215347 925 925 return; 926 926 927 m_layerNeedsCompositingUpdate = true;928 929 927 const RenderStyle& newStyle = layer.renderer().style(); 930 if (updateLayerCompositingState(layer) || (oldStyle && styleChangeRequiresLayerRebuild(layer, *oldStyle, newStyle))) 928 if (updateLayerCompositingState(layer) || (oldStyle && styleChangeRequiresLayerRebuild(layer, *oldStyle, newStyle))) { 931 929 setCompositingLayersNeedRebuild(); 932 else if (layer.isComposited()) { 930 m_layerNeedsCompositingUpdate = true; 931 return; 932 } 933 934 if (layer.isComposited()) { 933 935 // FIXME: updating geometry here is potentially harmful, because layout is not up-to-date. 934 936 layer.backing()->updateGeometry(); 935 937 layer.backing()->updateAfterDescendants(); 938 m_layerNeedsCompositingUpdate = true; 939 return; 940 } 941 942 // We don't have any direct reasons for this style change to affect layer composition. Test if it might affect things indirectly. 943 if (oldStyle && styleChangeMayAffectIndirectCompositingReasons(layer.renderer(), *oldStyle)) { 944 m_layerNeedsCompositingUpdate = true; 945 return; 946 } 947 948 if (layer.isRootLayer()) { 949 // Needed for scroll bars. 950 m_layerNeedsCompositingUpdate = true; 936 951 } 937 952 } … … 2601 2616 } 2602 2617 2618 bool RenderLayerCompositor::styleChangeMayAffectIndirectCompositingReasons(const RenderLayerModelObject& renderer, const RenderStyle& oldStyle) 2619 { 2620 if (renderer.isRenderNamedFlowFragmentContainer()) 2621 return true; 2622 2623 auto& style = renderer.style(); 2624 if (RenderElement::createsGroupForStyle(style) != RenderElement::createsGroupForStyle(oldStyle)) 2625 return true; 2626 if (style.isolation() != oldStyle.isolation()) 2627 return true; 2628 if (style.hasTransform() != oldStyle.hasTransform()) 2629 return true; 2630 if (style.boxReflect() != oldStyle.boxReflect()) 2631 return true; 2632 if (style.transformStyle3D() != oldStyle.transformStyle3D()) 2633 return true; 2634 if (style.hasPerspective() != oldStyle.hasPerspective()) 2635 return true; 2636 2637 return false; 2638 } 2639 2603 2640 bool RenderLayerCompositor::requiresCompositingForFilters(RenderLayerModelObject& renderer) const 2604 2641 { -
TabularUnified trunk/Source/WebCore/rendering/RenderLayerCompositor.h ¶
r211683 r215347 432 432 bool requiresCompositingForOverflowScrolling(const RenderLayer&) const; 433 433 bool requiresCompositingForIndirectReason(RenderLayerModelObject&, bool hasCompositedDescendants, bool has3DTransformedDescendants, RenderLayer::IndirectCompositingReason&) const; 434 static bool styleChangeMayAffectIndirectCompositingReasons(const RenderLayerModelObject& renderer, const RenderStyle& oldStyle); 434 435 435 436 #if PLATFORM(IOS)
Note:
See TracChangeset
for help on using the changeset viewer.