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

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

Issue 1176503002: Rename isNormalFlowOnly to something meaningful (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Nittified! 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 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 // Each paginated layer has to paint on its own. There is no recurring into child layers. Each 476 // Each paginated layer has to paint on its own. There is no recurring into child layers. Each
477 // layer has to be checked individually and genuinely know if it is going to have to split 477 // layer has to be checked individually and genuinely know if it is going to have to split
478 // itself up when painting only its contents (and not any other descendant l ayers). We track an 478 // itself up when painting only its contents (and not any other descendant l ayers). We track an
479 // enclosingPaginationLayer instead of using a simple bit, since we want to be able to get back 479 // enclosingPaginationLayer instead of using a simple bit, since we want to be able to get back
480 // to that layer easily. 480 // to that layer easily.
481 if (layoutObject()->isLayoutFlowThread()) { 481 if (layoutObject()->isLayoutFlowThread()) {
482 m_enclosingPaginationLayer = this; 482 m_enclosingPaginationLayer = this;
483 return; 483 return;
484 } 484 }
485 485
486 if (m_stackingNode->isNormalFlowOnly()) { 486 if (!m_stackingNode->isTreatedAsStackingContextForPainting()) {
487 // We cannot take the fast path for spanners, as they do not have their nearest ancestor 487 // We cannot take the fast path for spanners, as they do not have their nearest ancestor
488 // pagination layer (flow thread) in their containing block chain. 488 // pagination layer (flow thread) in their containing block chain.
489 if (!layoutObject()->isColumnSpanAll()) { 489 if (!layoutObject()->isColumnSpanAll()) {
490 // Content inside a transform is not considered to be paginated, sin ce we simply 490 // Content inside a transform is not considered to be paginated, sin ce we simply
491 // paint the transform multiple times in each column, so we don't ha ve to use 491 // paint the transform multiple times in each column, so we don't ha ve to use
492 // fragments for the transformed content. 492 // fragments for the transformed content.
493 m_enclosingPaginationLayer = parent()->enclosingPaginationLayer(); 493 m_enclosingPaginationLayer = parent()->enclosingPaginationLayer();
494 if (m_enclosingPaginationLayer && m_enclosingPaginationLayer->hasTra nsformRelatedProperty()) 494 if (m_enclosingPaginationLayer && m_enclosingPaginationLayer->hasTra nsformRelatedProperty())
495 m_enclosingPaginationLayer = 0; 495 m_enclosingPaginationLayer = 0;
496 return; 496 return;
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
886 886
887 TransformState transformState(TransformState::ApplyTransformDirection, Float Point()); 887 TransformState transformState(TransformState::ApplyTransformDirection, Float Point());
888 // FIXME: add a test that checks flipped writing mode and ApplyContainerFlip are correct. 888 // FIXME: add a test that checks flipped writing mode and ApplyContainerFlip are correct.
889 layoutObject()->mapLocalToContainer(properties.transformAncestor ? propertie s.transformAncestor->layoutObject() : 0, transformState, ApplyContainerFlip); 889 layoutObject()->mapLocalToContainer(properties.transformAncestor ? propertie s.transformAncestor->layoutObject() : 0, transformState, ApplyContainerFlip);
890 transformState.flatten(); 890 transformState.flatten();
891 return LayoutPoint(transformState.lastPlanarPoint()); 891 return LayoutPoint(transformState.lastPlanarPoint());
892 } 892 }
893 893
894 const DeprecatedPaintLayer* DeprecatedPaintLayer::compositingContainer() const 894 const DeprecatedPaintLayer* DeprecatedPaintLayer::compositingContainer() const
895 { 895 {
896 if (stackingNode()->isNormalFlowOnly()) 896 if (!stackingNode()->isTreatedAsStackingContextForPainting())
897 return parent(); 897 return parent();
898 if (DeprecatedPaintLayerStackingNode* ancestorStackingNode = stackingNode()- >ancestorStackingContextNode()) 898 if (DeprecatedPaintLayerStackingNode* ancestorStackingNode = stackingNode()- >ancestorStackingContextNode())
899 return ancestorStackingNode->layer(); 899 return ancestorStackingNode->layer();
900 return 0; 900 return 0;
901 } 901 }
902 902
903 bool DeprecatedPaintLayer::isPaintInvalidationContainer() const 903 bool DeprecatedPaintLayer::isPaintInvalidationContainer() const
904 { 904 {
905 return compositingState() == PaintsIntoOwnBacking || compositingState() == P aintsIntoGroupedBacking; 905 return compositingState() == PaintsIntoOwnBacking || compositingState() == P aintsIntoGroupedBacking;
906 } 906 }
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
1143 child->setNextSibling(beforeChild); 1143 child->setNextSibling(beforeChild);
1144 ASSERT(beforeChild != child); 1144 ASSERT(beforeChild != child);
1145 } else { 1145 } else {
1146 setLastChild(child); 1146 setLastChild(child);
1147 } 1147 }
1148 1148
1149 child->m_parent = this; 1149 child->m_parent = this;
1150 1150
1151 setNeedsCompositingInputsUpdate(); 1151 setNeedsCompositingInputsUpdate();
1152 1152
1153 if (child->stackingNode()->isNormalFlowOnly()) 1153 if (!child->stackingNode()->isTreatedAsStackingContextForPainting())
1154 m_stackingNode->dirtyNormalFlowList(); 1154 m_stackingNode->dirtyNormalFlowList();
1155 1155
1156 if (!child->stackingNode()->isNormalFlowOnly() || child->firstChild()) { 1156 if (child->stackingNode()->isTreatedAsStackingContextForPainting() || child- >firstChild()) {
1157 // Dirty the z-order list in which we are contained. The ancestorStackin gContextNode() can be null in the 1157 // Dirty the z-order list in which we are contained. The ancestorStackin gContextNode() can be null in the
1158 // case where we're building up generated content layers. This is ok, si nce the lists will start 1158 // case where we're building up generated content layers. This is ok, si nce the lists will start
1159 // off dirty in that case anyway. 1159 // off dirty in that case anyway.
1160 child->stackingNode()->dirtyStackingContextZOrderLists(); 1160 child->stackingNode()->dirtyStackingContextZOrderLists();
1161 } 1161 }
1162 1162
1163 dirtyAncestorChainVisibleDescendantStatus(); 1163 dirtyAncestorChainVisibleDescendantStatus();
1164 dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); 1164 dirtyAncestorChainHasSelfPaintingLayerDescendantStatus();
1165 1165
1166 child->updateDescendantDependentFlags(); 1166 child->updateDescendantDependentFlags();
1167 } 1167 }
1168 1168
1169 DeprecatedPaintLayer* DeprecatedPaintLayer::removeChild(DeprecatedPaintLayer* ol dChild) 1169 DeprecatedPaintLayer* DeprecatedPaintLayer::removeChild(DeprecatedPaintLayer* ol dChild)
1170 { 1170 {
1171 if (oldChild->previousSibling()) 1171 if (oldChild->previousSibling())
1172 oldChild->previousSibling()->setNextSibling(oldChild->nextSibling()); 1172 oldChild->previousSibling()->setNextSibling(oldChild->nextSibling());
1173 if (oldChild->nextSibling()) 1173 if (oldChild->nextSibling())
1174 oldChild->nextSibling()->setPreviousSibling(oldChild->previousSibling()) ; 1174 oldChild->nextSibling()->setPreviousSibling(oldChild->previousSibling()) ;
1175 1175
1176 if (m_first == oldChild) 1176 if (m_first == oldChild)
1177 m_first = oldChild->nextSibling(); 1177 m_first = oldChild->nextSibling();
1178 if (m_last == oldChild) 1178 if (m_last == oldChild)
1179 m_last = oldChild->previousSibling(); 1179 m_last = oldChild->previousSibling();
1180 1180
1181 if (oldChild->stackingNode()->isNormalFlowOnly()) 1181 if (!oldChild->stackingNode()->isTreatedAsStackingContextForPainting())
1182 m_stackingNode->dirtyNormalFlowList(); 1182 m_stackingNode->dirtyNormalFlowList();
1183 if (!oldChild->stackingNode()->isNormalFlowOnly() || oldChild->firstChild()) { 1183 if (oldChild->stackingNode()->isTreatedAsStackingContextForPainting() || old Child->firstChild()) {
1184 // Dirty the z-order list in which we are contained. When called via th e 1184 // Dirty the z-order list in which we are contained. When called via th e
1185 // reattachment process in removeOnlyThisLayer, the layer may already be disconnected 1185 // reattachment process in removeOnlyThisLayer, the layer may already be disconnected
1186 // from the main layer tree, so we need to null-check the 1186 // from the main layer tree, so we need to null-check the
1187 // |stackingContext| value. 1187 // |stackingContext| value.
1188 oldChild->stackingNode()->dirtyStackingContextZOrderLists(); 1188 oldChild->stackingNode()->dirtyStackingContextZOrderLists();
1189 } 1189 }
1190 1190
1191 if (layoutObject()->style()->visibility() != VISIBLE) 1191 if (layoutObject()->style()->visibility() != VISIBLE)
1192 dirtyVisibleContentStatus(); 1192 dirtyVisibleContentStatus();
1193 1193
(...skipping 1349 matching lines...) Expand 10 before | Expand all | Expand 10 after
2543 m_scrollableArea->updateAfterStyleChange(oldStyle); 2543 m_scrollableArea->updateAfterStyleChange(oldStyle);
2544 2544
2545 return true; 2545 return true;
2546 } 2546 }
2547 2547
2548 void DeprecatedPaintLayer::styleChanged(StyleDifference diff, const ComputedStyl e* oldStyle) 2548 void DeprecatedPaintLayer::styleChanged(StyleDifference diff, const ComputedStyl e* oldStyle)
2549 { 2549 {
2550 if (attemptDirectCompositingUpdate(diff, oldStyle)) 2550 if (attemptDirectCompositingUpdate(diff, oldStyle))
2551 return; 2551 return;
2552 2552
2553 m_stackingNode->updateIsNormalFlowOnly(); 2553 m_stackingNode->updateIsTreatedAsStackingContextForPainting();
2554 m_stackingNode->updateStackingNodesAfterStyleChange(oldStyle); 2554 m_stackingNode->updateStackingNodesAfterStyleChange(oldStyle);
2555 2555
2556 if (m_scrollableArea) 2556 if (m_scrollableArea)
2557 m_scrollableArea->updateAfterStyleChange(oldStyle); 2557 m_scrollableArea->updateAfterStyleChange(oldStyle);
2558 2558
2559 // Overlay scrollbars can make this layer self-painting so we need 2559 // Overlay scrollbars can make this layer self-painting so we need
2560 // to recompute the bit once scrollbars have been updated. 2560 // to recompute the bit once scrollbars have been updated.
2561 updateSelfPaintingLayer(); 2561 updateSelfPaintingLayer();
2562 2562
2563 if (!oldStyle || !layoutObject()->style()->reflectionDataEquivalent(oldStyle )) { 2563 if (!oldStyle || !layoutObject()->style()->reflectionDataEquivalent(oldStyle )) {
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
2712 2712
2713 void showLayerTree(const blink::LayoutObject* layoutObject) 2713 void showLayerTree(const blink::LayoutObject* layoutObject)
2714 { 2714 {
2715 if (!layoutObject) { 2715 if (!layoutObject) {
2716 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); 2716 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n");
2717 return; 2717 return;
2718 } 2718 }
2719 showLayerTree(layoutObject->enclosingLayer()); 2719 showLayerTree(layoutObject->enclosingLayer());
2720 } 2720 }
2721 #endif 2721 #endif
OLDNEW
« no previous file with comments | « Source/core/layout/compositing/GraphicsLayerUpdater.cpp ('k') | Source/core/paint/DeprecatedPaintLayerStackingNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698