Changeset 39640 in webkit
- Timestamp:
- Jan 5, 2009 9:37:27 PM (15 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r39639 r39640 1 2009-01-05 Simon Fraser <simon.fraser@apple.com> 2 3 Reviewed by Dave Hyatt 4 5 https://bugs.webkit.org/show_bug.cgi?id=22985 6 7 Add an assertion that clip rects are being used when painting with the same 8 rootLayer that they were computed with. 9 10 Fix two issues detected by the assertion: 11 12 RenderLayer::updateClipRects() should not unconditionally update the clip rects 13 on its parent, but stop when reaching rootLayer (just like calculateClipRects()). 14 15 We need to pass the temporaryClipRects flag down through reflection painting 16 to handle the case of nested reflections. 17 18 Also use temporary clip rects in RenderTreeAsText, since that code does not 19 reset the painting root for transformed layers, so cached clip rects will not 20 match those used for painting. 21 22 * rendering/RenderLayer.cpp: 23 (WebCore::RenderLayer::RenderLayer): 24 (WebCore::RenderLayer::paintLayer): 25 (WebCore::RenderLayer::updateClipRects): 26 (WebCore::RenderLayer::clearClipRects): 27 * rendering/RenderLayer.h: 28 * rendering/RenderTreeAsText.cpp: 29 (WebCore::writeLayers): 30 1 31 2009-01-05 Adam Treat <adam.treat@torchmobile.com> 2 32 -
trunk/WebCore/rendering/RenderLayer.cpp
r39635 r39640 141 141 , m_overflowList(0) 142 142 , m_clipRects(0) 143 #ifndef NDEBUG 144 , m_clipRectsRoot(0) 145 #endif 143 146 , m_scrollDimensionsDirty(true) 144 147 , m_zOrderListsDirty(true) … … 1713 1716 // Mark that we are now inside replica painting. 1714 1717 m_paintingInsideReflection = true; 1715 reflectionLayer()->paintLayer(rootLayer, p, paintDirtyRect, haveTransparency, paintRestriction, paintingRoot );1718 reflectionLayer()->paintLayer(rootLayer, p, paintDirtyRect, haveTransparency, paintRestriction, paintingRoot, false, temporaryClipRects); 1716 1719 m_paintingInsideReflection = false; 1717 1720 } … … 2003 2006 void RenderLayer::updateClipRects(const RenderLayer* rootLayer) 2004 2007 { 2005 if (m_clipRects) 2008 if (m_clipRects) { 2009 ASSERT(rootLayer == m_clipRectsRoot); 2006 2010 return; // We have the correct cached value. 2007 2008 if (parent()) 2009 parent()->updateClipRects(rootLayer); 2011 } 2012 2013 // For transformed layers, the root layer was shifted to be us, so there is no need to 2014 // examine the parent. We want to cache clip rects with us as the root. 2015 RenderLayer* parentLayer = rootLayer != this ? parent() : 0; 2016 if (parentLayer) 2017 parentLayer->updateClipRects(rootLayer); 2010 2018 2011 2019 ClipRects clipRects; 2012 2020 calculateClipRects(rootLayer, clipRects, true); 2013 2021 2014 if (parent () && parent()->clipRects() && clipRects == *parent()->clipRects())2015 m_clipRects = parent ()->clipRects();2022 if (parentLayer && parentLayer->clipRects() && clipRects == *parentLayer->clipRects()) 2023 m_clipRects = parentLayer->clipRects(); 2016 2024 else 2017 2025 m_clipRects = new (m_object->renderArena()) ClipRects(clipRects); 2018 2026 m_clipRects->ref(); 2027 #ifndef NDEBUG 2028 m_clipRectsRoot = rootLayer; 2029 #endif 2019 2030 } 2020 2031 … … 2270 2281 m_clipRects->deref(m_object->renderArena()); 2271 2282 m_clipRects = 0; 2283 #ifndef NDEBUG 2284 m_clipRectsRoot = 0; 2285 #endif 2272 2286 } 2273 2287 } -
trunk/WebCore/rendering/RenderLayer.h
r39635 r39640 479 479 480 480 ClipRects* m_clipRects; // Cached clip rects used when painting and hit testing. 481 #ifndef NDEBUG 482 const RenderLayer* m_clipRectsRoot; // Root layer used to compute clip rects. 483 #endif 481 484 482 485 bool m_scrollDimensionsDirty : 1; -
trunk/WebCore/rendering/RenderTreeAsText.cpp
r34589 r39640 417 417 // Calculate the clip rects we should use. 418 418 IntRect layerBounds, damageRect, clipRectToApply, outlineRect; 419 l->calculateRects(rootLayer, paintDirtyRect, layerBounds, damageRect, clipRectToApply, outlineRect );419 l->calculateRects(rootLayer, paintDirtyRect, layerBounds, damageRect, clipRectToApply, outlineRect, true); 420 420 421 421 // Ensure our lists are up-to-date.
Note: See TracChangeset
for help on using the changeset viewer.