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

Side by Side Diff: Source/core/paint/DeprecatedPaintLayer.cpp

Issue 1188363002: Compute the normal flow list on the fly (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Reviewnated patch! Created 5 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 | Annotate | Revision Log
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 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after
1133 child->setNextSibling(beforeChild); 1133 child->setNextSibling(beforeChild);
1134 ASSERT(beforeChild != child); 1134 ASSERT(beforeChild != child);
1135 } else { 1135 } else {
1136 setLastChild(child); 1136 setLastChild(child);
1137 } 1137 }
1138 1138
1139 child->m_parent = this; 1139 child->m_parent = this;
1140 1140
1141 setNeedsCompositingInputsUpdate(); 1141 setNeedsCompositingInputsUpdate();
1142 1142
1143 if (!child->stackingNode()->isTreatedAsStackingContextForPainting()) 1143 if (!child->stackingNode()->isTreatedAsStackingContextForPainting() && !layo utObject()->documentBeingDestroyed())
1144 m_stackingNode->dirtyNormalFlowList(); 1144 compositor()->setNeedsCompositingUpdate(CompositingUpdateRebuildTree);
1145 1145
1146 if (child->stackingNode()->isTreatedAsStackingContextForPainting() || child- >firstChild()) { 1146 if (child->stackingNode()->isTreatedAsStackingContextForPainting() || child- >firstChild()) {
1147 // Dirty the z-order list in which we are contained. The ancestorStackin gContextNode() can be null in the 1147 // Dirty the z-order list in which we are contained. The ancestorStackin gContextNode() can be null in the
1148 // case where we're building up generated content layers. This is ok, si nce the lists will start 1148 // case where we're building up generated content layers. This is ok, si nce the lists will start
1149 // off dirty in that case anyway. 1149 // off dirty in that case anyway.
1150 child->stackingNode()->dirtyStackingContextZOrderLists(); 1150 child->stackingNode()->dirtyStackingContextZOrderLists();
1151 } 1151 }
1152 1152
1153 dirtyAncestorChainVisibleDescendantStatus(); 1153 dirtyAncestorChainVisibleDescendantStatus();
1154 dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); 1154 dirtyAncestorChainHasSelfPaintingLayerDescendantStatus();
1155 1155
1156 child->updateDescendantDependentFlags(); 1156 child->updateDescendantDependentFlags();
1157 } 1157 }
1158 1158
1159 DeprecatedPaintLayer* DeprecatedPaintLayer::removeChild(DeprecatedPaintLayer* ol dChild) 1159 DeprecatedPaintLayer* DeprecatedPaintLayer::removeChild(DeprecatedPaintLayer* ol dChild)
1160 { 1160 {
1161 if (oldChild->previousSibling()) 1161 if (oldChild->previousSibling())
1162 oldChild->previousSibling()->setNextSibling(oldChild->nextSibling()); 1162 oldChild->previousSibling()->setNextSibling(oldChild->nextSibling());
1163 if (oldChild->nextSibling()) 1163 if (oldChild->nextSibling())
1164 oldChild->nextSibling()->setPreviousSibling(oldChild->previousSibling()) ; 1164 oldChild->nextSibling()->setPreviousSibling(oldChild->previousSibling()) ;
1165 1165
1166 if (m_first == oldChild) 1166 if (m_first == oldChild)
1167 m_first = oldChild->nextSibling(); 1167 m_first = oldChild->nextSibling();
1168 if (m_last == oldChild) 1168 if (m_last == oldChild)
1169 m_last = oldChild->previousSibling(); 1169 m_last = oldChild->previousSibling();
1170 1170
1171 if (!oldChild->stackingNode()->isTreatedAsStackingContextForPainting()) 1171 if (!oldChild->stackingNode()->isTreatedAsStackingContextForPainting() && !l ayoutObject()->documentBeingDestroyed())
1172 m_stackingNode->dirtyNormalFlowList(); 1172 compositor()->setNeedsCompositingUpdate(CompositingUpdateRebuildTree);
1173
1173 if (oldChild->stackingNode()->isTreatedAsStackingContextForPainting() || old Child->firstChild()) { 1174 if (oldChild->stackingNode()->isTreatedAsStackingContextForPainting() || old Child->firstChild()) {
1174 // Dirty the z-order list in which we are contained. When called via th e 1175 // Dirty the z-order list in which we are contained. When called via th e
1175 // reattachment process in removeOnlyThisLayer, the layer may already be disconnected 1176 // reattachment process in removeOnlyThisLayer, the layer may already be disconnected
1176 // from the main layer tree, so we need to null-check the 1177 // from the main layer tree, so we need to null-check the
1177 // |stackingContext| value. 1178 // |stackingContext| value.
1178 oldChild->stackingNode()->dirtyStackingContextZOrderLists(); 1179 oldChild->stackingNode()->dirtyStackingContextZOrderLists();
1179 } 1180 }
1180 1181
1181 if (layoutObject()->style()->visibility() != VISIBLE) 1182 if (layoutObject()->style()->visibility() != VISIBLE)
1182 dirtyVisibleContentStatus(); 1183 dirtyVisibleContentStatus();
(...skipping 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after
2397 if (paintsWithFilters() && layoutObject()->style()->filter().hasFilterThatAf fectsOpacity()) 2398 if (paintsWithFilters() && layoutObject()->style()->filter().hasFilterThatAf fectsOpacity())
2398 return false; 2399 return false;
2399 2400
2400 // FIXME: Handle simple transforms. 2401 // FIXME: Handle simple transforms.
2401 if (paintsWithTransform(PaintBehaviorNormal)) 2402 if (paintsWithTransform(PaintBehaviorNormal))
2402 return false; 2403 return false;
2403 2404
2404 // FIXME: Remove this check. 2405 // FIXME: Remove this check.
2405 // This function should not be called when layer-lists are dirty. 2406 // This function should not be called when layer-lists are dirty.
2406 // It is somehow getting triggered during style update. 2407 // It is somehow getting triggered during style update.
2407 if (m_stackingNode->zOrderListsDirty() || m_stackingNode->normalFlowListDirt y()) 2408 if (m_stackingNode->zOrderListsDirty())
2408 return false; 2409 return false;
2409 2410
2410 // FIXME: We currently only check the immediate layoutObject, 2411 // FIXME: We currently only check the immediate layoutObject,
2411 // which will miss many cases. 2412 // which will miss many cases.
2412 if (layoutObject()->backgroundIsKnownToBeOpaqueInRect(localRect)) 2413 if (layoutObject()->backgroundIsKnownToBeOpaqueInRect(localRect))
2413 return true; 2414 return true;
2414 2415
2415 // We can't consult child layers if we clip, since they might cover 2416 // We can't consult child layers if we clip, since they might cover
2416 // parts of the rect that are clipped out. 2417 // parts of the rect that are clipped out.
2417 if (layoutObject()->hasOverflowClip()) 2418 if (layoutObject()->hasOverflowClip())
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
2740 2741
2741 void showLayerTree(const blink::LayoutObject* layoutObject) 2742 void showLayerTree(const blink::LayoutObject* layoutObject)
2742 { 2743 {
2743 if (!layoutObject) { 2744 if (!layoutObject) {
2744 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); 2745 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n");
2745 return; 2746 return;
2746 } 2747 }
2747 showLayerTree(layoutObject->enclosingLayer()); 2748 showLayerTree(layoutObject->enclosingLayer());
2748 } 2749 }
2749 #endif 2750 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698