Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayer.cpp

Issue 2060053002: Set paintingLayerNeedsRepaint() in layout tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Set paintingLayerNeedsRepaint() in layout tree Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
5 * 5 *
6 * Other contributors: 6 * Other contributors:
7 * Robert O'Callahan <roc+@cs.cmu.edu> 7 * Robert O'Callahan <roc+@cs.cmu.edu>
8 * David Baron <dbaron@fas.harvard.edu> 8 * David Baron <dbaron@fas.harvard.edu>
9 * Christian Biesinger <cbiesinger@web.de> 9 * Christian Biesinger <cbiesinger@web.de>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 if (layoutObject()->isInFlowPositioned()) { 802 if (layoutObject()->isInFlowPositioned()) {
803 LayoutSize newOffset = layoutObject()->offsetForInFlowPosition(); 803 LayoutSize newOffset = layoutObject()->offsetForInFlowPosition();
804 if (m_rareData || !newOffset.isZero()) 804 if (m_rareData || !newOffset.isZero())
805 ensureRareData().offsetForInFlowPosition = newOffset; 805 ensureRareData().offsetForInFlowPosition = newOffset;
806 localPoint.move(newOffset); 806 localPoint.move(newOffset);
807 } else if (m_rareData) { 807 } else if (m_rareData) {
808 m_rareData->offsetForInFlowPosition = LayoutSize(); 808 m_rareData->offsetForInFlowPosition = LayoutSize();
809 } 809 }
810 810
811 if (m_location != localPoint) { 811 if (m_location != localPoint) {
812 setNeedsRepaint(); 812 layoutObject()->setPaintingLayerNeedsRepaint();
813 } 813 }
814 m_location = localPoint; 814 m_location = localPoint;
815 815
816 #if ENABLE(ASSERT) 816 #if ENABLE(ASSERT)
817 m_needsPositionUpdate = false; 817 m_needsPositionUpdate = false;
818 #endif 818 #endif
819 } 819 }
820 820
821 TransformationMatrix PaintLayer::perspectiveTransform() const 821 TransformationMatrix PaintLayer::perspectiveTransform() const
822 { 822 {
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
1190 child->stackingNode()->dirtyStackingContextZOrderLists(); 1190 child->stackingNode()->dirtyStackingContextZOrderLists();
1191 } 1191 }
1192 1192
1193 // Non-self-painting children paint into this layer, so the visible contents status of this layer is affected. 1193 // Non-self-painting children paint into this layer, so the visible contents status of this layer is affected.
1194 if (!child->isSelfPaintingLayer()) 1194 if (!child->isSelfPaintingLayer())
1195 dirtyVisibleContentStatus(); 1195 dirtyVisibleContentStatus();
1196 1196
1197 dirtyAncestorChainVisibleDescendantStatus(); 1197 dirtyAncestorChainVisibleDescendantStatus();
1198 dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); 1198 dirtyAncestorChainHasSelfPaintingLayerDescendantStatus();
1199 1199
1200 child->setNeedsRepaint(); 1200 child->layoutObject()->setPaintingLayerNeedsRepaint();
1201 1201
1202 child->updateDescendantDependentFlags(); 1202 child->updateDescendantDependentFlags();
1203 } 1203 }
1204 1204
1205 PaintLayer* PaintLayer::removeChild(PaintLayer* oldChild) 1205 PaintLayer* PaintLayer::removeChild(PaintLayer* oldChild)
1206 { 1206 {
1207 if (oldChild->previousSibling()) 1207 if (oldChild->previousSibling())
1208 oldChild->previousSibling()->setNextSibling(oldChild->nextSibling()); 1208 oldChild->previousSibling()->setNextSibling(oldChild->nextSibling());
1209 if (oldChild->nextSibling()) 1209 if (oldChild->nextSibling())
1210 oldChild->nextSibling()->setPreviousSibling(oldChild->previousSibling()) ; 1210 oldChild->nextSibling()->setPreviousSibling(oldChild->previousSibling()) ;
(...skipping 28 matching lines...) Expand all
1239 dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); 1239 dirtyAncestorChainHasSelfPaintingLayerDescendantStatus();
1240 1240
1241 oldChild->updateDescendantDependentFlags(); 1241 oldChild->updateDescendantDependentFlags();
1242 1242
1243 if (oldChild->m_hasVisibleContent || oldChild->m_hasVisibleDescendant) 1243 if (oldChild->m_hasVisibleContent || oldChild->m_hasVisibleDescendant)
1244 dirtyAncestorChainVisibleDescendantStatus(); 1244 dirtyAncestorChainVisibleDescendantStatus();
1245 1245
1246 if (oldChild->enclosingPaginationLayer()) 1246 if (oldChild->enclosingPaginationLayer())
1247 oldChild->clearPaginationRecursive(); 1247 oldChild->clearPaginationRecursive();
1248 1248
1249 setNeedsRepaint(); 1249 layoutObject()->setPaintingLayerNeedsRepaint();
1250 1250
1251 return oldChild; 1251 return oldChild;
1252 } 1252 }
1253 1253
1254 void PaintLayer::removeOnlyThisLayerAfterStyleChange() 1254 void PaintLayer::removeOnlyThisLayerAfterStyleChange()
1255 { 1255 {
1256 if (!m_parent) 1256 if (!m_parent)
1257 return; 1257 return;
1258 1258
1259 bool didSetPaintInvalidation = false; 1259 bool didSetPaintInvalidation = false;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
1317 curr->moveLayers(m_parent, this); 1317 curr->moveLayers(m_parent, this);
1318 1318
1319 // If the previous paint invalidation container is not a stacking context an d this object is 1319 // If the previous paint invalidation container is not a stacking context an d this object is
1320 // stacked content, creating this layer may cause this object and its descen dants to change 1320 // stacked content, creating this layer may cause this object and its descen dants to change
1321 // paint invalidation container. 1321 // paint invalidation container.
1322 bool didSetPaintInvalidation = false; 1322 bool didSetPaintInvalidation = false;
1323 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled() && !layoutObject()->is LayoutView() && layoutObject()->isRooted() && layoutObject()->styleRef().isStack ed()) { 1323 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled() && !layoutObject()->is LayoutView() && layoutObject()->isRooted() && layoutObject()->styleRef().isStack ed()) {
1324 const LayoutBoxModelObject& previousPaintInvalidationContainer = layoutO bject()->parent()->containerForPaintInvalidation(); 1324 const LayoutBoxModelObject& previousPaintInvalidationContainer = layoutO bject()->parent()->containerForPaintInvalidation();
1325 if (!previousPaintInvalidationContainer.styleRef().isStackingContext()) { 1325 if (!previousPaintInvalidationContainer.styleRef().isStackingContext()) {
1326 layoutObject()->invalidatePaintIncludingNonSelfPaintingLayerDescenda nts(previousPaintInvalidationContainer); 1326 layoutObject()->invalidatePaintIncludingNonSelfPaintingLayerDescenda nts(previousPaintInvalidationContainer);
1327 // Set needsRepaint along the original compositingContainer chain.
1328 layoutObject()->parent()->enclosingLayer()->setNeedsRepaint();
1329 didSetPaintInvalidation = true; 1327 didSetPaintInvalidation = true;
1330 } 1328 }
1331 } 1329 }
1332 1330
1333 if (!didSetPaintInvalidation && isSelfPaintingLayer() && m_parent) { 1331 if (!didSetPaintInvalidation && isSelfPaintingLayer() && m_parent) {
1334 if (PaintLayer* enclosingSelfPaintingLayer = m_parent->enclosingSelfPain tingLayer()) 1332 if (PaintLayer* enclosingSelfPaintingLayer = m_parent->enclosingSelfPain tingLayer())
1335 mergeNeedsPaintPhaseFlagsFrom(*enclosingSelfPaintingLayer); 1333 mergeNeedsPaintPhaseFlagsFrom(*enclosingSelfPaintingLayer);
1336 } 1334 }
1337 1335
1338 // Clear out all the clip rects. 1336 // Clear out all the clip rects.
(...skipping 1507 matching lines...) Expand 10 before | Expand all | Expand 10 after
2846 } 2844 }
2847 } else { 2845 } else {
2848 rect.append(logicalBoundingBox()); 2846 rect.append(logicalBoundingBox());
2849 rects.set(this, rect); 2847 rects.set(this, rect);
2850 } 2848 }
2851 } 2849 }
2852 } 2850 }
2853 2851
2854 void PaintLayer::setNeedsRepaint() 2852 void PaintLayer::setNeedsRepaint()
2855 { 2853 {
2854 DCHECK(layoutObject()->document().lifecycle().state() == DocumentLifecycle:: InPaintInvalidation
2855 || layoutObject()->document().lifecycle().state() == DocumentLifecycle:: InPrePaint);
2856
2857 if (m_needsRepaint)
2858 return;
2859
2856 m_needsRepaint = true; 2860 m_needsRepaint = true;
2857
2858 // Do this unconditionally to ensure container chain is marked when composit ing status of the layer changes.
2859 markCompositingContainerChainForNeedsRepaint(); 2861 markCompositingContainerChainForNeedsRepaint();
2860 } 2862 }
2861 2863
2862 void PaintLayer::markCompositingContainerChainForNeedsRepaint() 2864 void PaintLayer::markCompositingContainerChainForNeedsRepaint()
2863 { 2865 {
2864 // Need to access compositingState(). We've ensured correct flag setting whe n compositingState() changes. 2866 // Need to access compositingState(). We've ensured correct flag setting whe n compositingState() changes.
2865 DisableCompositingQueryAsserts disabler; 2867 DisableCompositingQueryAsserts disabler;
2866 2868
2867 PaintLayer* layer = this; 2869 PaintLayer* layer = this;
2868 while (true) { 2870 while (true) {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
2925 2927
2926 void showLayerTree(const blink::LayoutObject* layoutObject) 2928 void showLayerTree(const blink::LayoutObject* layoutObject)
2927 { 2929 {
2928 if (!layoutObject) { 2930 if (!layoutObject) {
2929 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); 2931 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n");
2930 return; 2932 return;
2931 } 2933 }
2932 showLayerTree(layoutObject->enclosingLayer()); 2934 showLayerTree(layoutObject->enclosingLayer());
2933 } 2935 }
2934 #endif 2936 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintInvalidator.cpp ('k') | third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698