Changeset 154470 in webkit
- Timestamp:
- Aug 22, 2013 5:28:48 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r154462 r154470 1 2013-08-22 Simon Fraser <simon.fraser@apple.com> 2 3 compositing/geometry/bounds-ignores-hidden-dynamic.html has incorrect initial rendering 4 https://bugs.webkit.org/show_bug.cgi?id=119825 5 6 Reviewed by Tim Horton. 7 8 Test that dumps repaint rects on layers after visibility changes affect 9 the layer hierarchy. 10 11 * compositing/repaint/repaint-on-layer-grouping-change-expected.txt: Added. 12 * compositing/repaint/repaint-on-layer-grouping-change.html: Added. 13 * compositing/repaint/resize-repaint-expected.txt: Update result. 14 1 15 2013-08-22 Christophe Dumez <ch.dumez@sisa.samsung.com> 2 16 -
trunk/LayoutTests/compositing/repaint/resize-repaint-expected.txt
r148057 r154470 15 15 (drawsContent 1) 16 16 (repaint rects 17 (rect 2.00 104.00 398.00 1.00) 18 (rect 0.00 104.00 402.00 1.00) 17 (rect 0.00 0.00 402.00 207.00) 19 18 ) 20 19 ) -
trunk/Source/WebCore/ChangeLog
r154469 r154470 1 2013-08-22 Simon Fraser <simon.fraser@apple.com> 2 3 compositing/geometry/bounds-ignores-hidden-dynamic.html has incorrect initial rendering 4 https://bugs.webkit.org/show_bug.cgi?id=119825 5 6 Reviewed by Tim Horton. 7 8 r137526 and some earlier commits attempted to avoid unconditionally 9 repainting layers when their size changes, because this was causing 10 TiledBacking layers to repaint when the document size changed. 11 12 However, the approach required that we have good information about 13 whether size changes require a repaint, which in some cases is hard 14 to determine, especially when RenderLayer changes affect our 15 decisions about which layers are composited. 16 17 Fix by pushing the decision about whether to repaint on size change 18 into GraphicsLayer. The default is to repaint on size change, 19 but GraphicsLayer provides a function that can be overridden to 20 modify this behavior; GraphicsLayerCA does so to avoid repaints 21 when layers with TiledBackings get resized. 22 23 Test: compositing/repaint/repaint-on-layer-grouping-change.html 24 25 * WebCore.exp.in: WebKit2 needs GraphicsLayer::setSize, which is no longer inline. 26 * platform/graphics/GraphicsLayer.cpp: 27 (WebCore::GraphicsLayer::setOffsetFromRenderer): 28 (WebCore::GraphicsLayer::setSize): 29 * platform/graphics/GraphicsLayer.h: 30 (WebCore::GraphicsLayer::shouldRepaintOnSizeChange): 31 * platform/graphics/ca/GraphicsLayerCA.cpp: 32 (WebCore::GraphicsLayerCA::shouldRepaintOnSizeChange): 33 * platform/graphics/ca/GraphicsLayerCA.h: 34 * rendering/RenderLayerBacking.h: No longer need m_boundsConstrainedByClipping 35 * rendering/RenderLayerBacking.cpp: 36 (WebCore::RenderLayerBacking::RenderLayerBacking): 37 (WebCore::RenderLayerBacking::updateCompositedBounds): 38 (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry): setSize takes 39 care of repainting for us now, so we can remove all the conditional code. 40 1 41 2013-08-22 Simon Fraser <simon.fraser@apple.com> 2 42 -
trunk/Source/WebCore/WebCore.exp.in
r154373 r154470 1373 1373 __ZNK7WebCore13ContainerNode14childNodeCountEv 1374 1374 __ZNK7WebCore13ContainerNode9childNodeEj 1375 __ZN7WebCore13GraphicsLayer7setSizeERKNS_9FloatSizeE 1375 1376 __ZNK7WebCore13GraphicsLayer18accumulatedOpacityEv 1376 1377 __ZNK7WebCore13GraphicsLayer18getDebugBorderInfoERNS_5ColorERf -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp
r151319 r154470 308 308 } 309 309 310 void GraphicsLayer::setSize(const FloatSize& size) 311 { 312 if (size == m_size) 313 return; 314 315 m_size = size; 316 317 if (shouldRepaintOnSizeChange()) 318 setNeedsDisplay(); 319 } 320 310 321 void GraphicsLayer::setBackgroundColor(const Color& color) 311 322 { -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.h
r153408 r154470 290 290 // The size of the layer. 291 291 const FloatSize& size() const { return m_size; } 292 virtual void setSize(const FloatSize& size) { m_size = size; }292 virtual void setSize(const FloatSize&); 293 293 294 294 // The boundOrigin affects the offset at which content is rendered, and sublayers are positioned. … … 501 501 // rotations of >= 180 degrees 502 502 static int validateTransformOperations(const KeyframeValueList&, bool& hasBigRotation); 503 504 virtual bool shouldRepaintOnSizeChange() const { return drawsContent(); } 503 505 504 506 virtual void setOpacityInternal(float) { } -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
r154314 r154470 673 673 } 674 674 675 bool GraphicsLayerCA::shouldRepaintOnSizeChange() const 676 { 677 return drawsContent() && !tiledBacking(); 678 } 679 675 680 bool GraphicsLayerCA::addAnimation(const KeyframeValueList& valueList, const IntSize& boxSize, const Animation* anim, const String& animationName, double timeOffset) 676 681 { -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
r149694 r154470 176 176 177 177 virtual double backingStoreMemoryEstimate() const; 178 179 virtual bool shouldRepaintOnSizeChange() const OVERRIDE; 178 180 179 181 void updateOpacityOnLayer(); -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r154401 r154470 111 111 , m_scrollLayerID(0) 112 112 , m_artificiallyInflatedBounds(false) 113 , m_boundsConstrainedByClipping(false)114 113 , m_isMainFrameRenderViewLayer(false) 115 114 , m_usingTiledCacheLayer(false) … … 449 448 450 449 layerBounds.intersect(clippingBounds); 451 m_boundsConstrainedByClipping = true; 452 } else 453 m_boundsConstrainedByClipping = false; 450 } 454 451 455 452 // If the element has a transform-origin that has fixed lengths, and the renderer has zero size, … … 706 703 707 704 m_graphicsLayer->setPosition(FloatPoint(relativeCompositingBounds.location() - graphicsLayerParentLocation)); 705 m_graphicsLayer->setSize(contentsSize); 708 706 m_graphicsLayer->setOffsetFromRenderer(toIntSize(localCompositingBounds.location())); 709 707 710 FloatSize oldSize = m_graphicsLayer->size();711 if (oldSize != contentsSize) {712 m_graphicsLayer->setSize(contentsSize);713 // Usually invalidation will happen via layout etc, but if we've affected the layer714 // size by constraining relative to a clipping ancestor or the viewport, we715 // have to invalidate to avoid showing stretched content.716 if (m_boundsConstrainedByClipping)717 m_graphicsLayer->setNeedsDisplay();718 }719 708 if (!m_isMainFrameRenderViewLayer) { 720 709 // For non-root layers, background is always painted by the primary graphics layer. … … 733 722 734 723 if (m_maskLayer) { 735 if (m_maskLayer->size() != m_graphicsLayer->size()) { 736 m_maskLayer->setSize(m_graphicsLayer->size()); 737 m_maskLayer->setNeedsDisplay(); 738 } 724 m_maskLayer->setSize(m_graphicsLayer->size()); 739 725 m_maskLayer->setPosition(FloatPoint()); 740 726 m_maskLayer->setOffsetFromRenderer(m_graphicsLayer->offsetFromRenderer()); … … 793 779 794 780 m_foregroundLayer->setPosition(foregroundPosition); 795 if (foregroundSize != m_foregroundLayer->size()) { 796 m_foregroundLayer->setSize(foregroundSize); 797 m_foregroundLayer->setNeedsDisplay(); 798 } 781 m_foregroundLayer->setSize(foregroundSize); 799 782 m_foregroundLayer->setOffsetFromRenderer(foregroundOffset); 800 783 } … … 809 792 } 810 793 m_backgroundLayer->setPosition(backgroundPosition); 811 if (backgroundSize != m_backgroundLayer->size()) { 812 m_backgroundLayer->setSize(backgroundSize); 813 m_backgroundLayer->setNeedsDisplay(); 814 } 794 m_backgroundLayer->setSize(backgroundSize); 815 795 m_backgroundLayer->setOffsetFromRenderer(m_graphicsLayer->offsetFromRenderer()); 816 796 } … … 856 836 857 837 if (m_foregroundLayer) { 858 if (m_foregroundLayer->size() != m_scrollingContentsLayer->size()) 859 m_foregroundLayer->setSize(m_scrollingContentsLayer->size()); 860 m_foregroundLayer->setNeedsDisplay(); 838 m_foregroundLayer->setSize(m_scrollingContentsLayer->size()); 861 839 m_foregroundLayer->setOffsetFromRenderer(m_scrollingContentsLayer->offsetFromRenderer()); 862 840 } -
trunk/Source/WebCore/rendering/RenderLayerBacking.h
r154009 r154470 302 302 303 303 bool m_artificiallyInflatedBounds; // bounds had to be made non-zero to make transform-origin work 304 bool m_boundsConstrainedByClipping;305 304 bool m_isMainFrameRenderViewLayer; 306 305 bool m_usingTiledCacheLayer;
Note: See TracChangeset
for help on using the changeset viewer.