OLD | NEW |
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 918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
929 { | 929 { |
930 TransformState transformState(TransformState::ApplyTransformDirection, Float
Point()); | 930 TransformState transformState(TransformState::ApplyTransformDirection, Float
Point()); |
931 // FIXME: add a test that checks flipped writing mode and ApplyContainerFlip
are correct. | 931 // FIXME: add a test that checks flipped writing mode and ApplyContainerFlip
are correct. |
932 layoutObject()->mapLocalToAncestor(transformAncestor() ? transformAncestor()
->layoutObject() : nullptr, transformState, ApplyContainerFlip); | 932 layoutObject()->mapLocalToAncestor(transformAncestor() ? transformAncestor()
->layoutObject() : nullptr, transformState, ApplyContainerFlip); |
933 transformState.flatten(); | 933 transformState.flatten(); |
934 return LayoutPoint(transformState.lastPlanarPoint()); | 934 return LayoutPoint(transformState.lastPlanarPoint()); |
935 } | 935 } |
936 | 936 |
937 PaintLayer* PaintLayer::compositingContainer() const | 937 PaintLayer* PaintLayer::compositingContainer() const |
938 { | 938 { |
939 if (!stackingNode()->isTreatedAsOrStackingContext()) | 939 if (!stackingNode()->isStacked()) |
940 return parent(); | 940 return parent(); |
941 if (PaintLayerStackingNode* ancestorStackingNode = stackingNode()->ancestorS
tackingContextNode()) | 941 if (PaintLayerStackingNode* ancestorStackingNode = stackingNode()->ancestorS
tackingContextNode()) |
942 return ancestorStackingNode->layer(); | 942 return ancestorStackingNode->layer(); |
943 return nullptr; | 943 return nullptr; |
944 } | 944 } |
945 | 945 |
946 bool PaintLayer::isPaintInvalidationContainer() const | 946 bool PaintLayer::isPaintInvalidationContainer() const |
947 { | 947 { |
948 return compositingState() == PaintsIntoOwnBacking || compositingState() == P
aintsIntoGroupedBacking; | 948 return compositingState() == PaintsIntoOwnBacking || compositingState() == P
aintsIntoGroupedBacking; |
949 } | 949 } |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1206 child->setNextSibling(beforeChild); | 1206 child->setNextSibling(beforeChild); |
1207 ASSERT(beforeChild != child); | 1207 ASSERT(beforeChild != child); |
1208 } else { | 1208 } else { |
1209 setLastChild(child); | 1209 setLastChild(child); |
1210 } | 1210 } |
1211 | 1211 |
1212 child->m_parent = this; | 1212 child->m_parent = this; |
1213 | 1213 |
1214 setNeedsCompositingInputsUpdate(); | 1214 setNeedsCompositingInputsUpdate(); |
1215 | 1215 |
1216 if (!child->stackingNode()->isTreatedAsOrStackingContext() && !layoutObject(
)->documentBeingDestroyed()) | 1216 if (!child->stackingNode()->isStacked() && !layoutObject()->documentBeingDes
troyed()) |
1217 compositor()->setNeedsCompositingUpdate(CompositingUpdateRebuildTree); | 1217 compositor()->setNeedsCompositingUpdate(CompositingUpdateRebuildTree); |
1218 | 1218 |
1219 if (child->stackingNode()->isTreatedAsOrStackingContext() || child->firstChi
ld()) { | 1219 if (child->stackingNode()->isStacked() || child->firstChild()) { |
1220 // Dirty the z-order list in which we are contained. The ancestorStackin
gContextNode() can be null in the | 1220 // Dirty the z-order list in which we are contained. The ancestorStackin
gContextNode() can be null in the |
1221 // case where we're building up generated content layers. This is ok, si
nce the lists will start | 1221 // case where we're building up generated content layers. This is ok, si
nce the lists will start |
1222 // off dirty in that case anyway. | 1222 // off dirty in that case anyway. |
1223 child->stackingNode()->dirtyStackingContextZOrderLists(); | 1223 child->stackingNode()->dirtyStackingContextZOrderLists(); |
1224 } | 1224 } |
1225 | 1225 |
1226 // Non-self-painting children paint into this layer, so the visible contents
status of this layer is affected. | 1226 // Non-self-painting children paint into this layer, so the visible contents
status of this layer is affected. |
1227 if (!child->isSelfPaintingLayer()) | 1227 if (!child->isSelfPaintingLayer()) |
1228 dirtyVisibleContentStatus(); | 1228 dirtyVisibleContentStatus(); |
1229 | 1229 |
(...skipping 10 matching lines...) Expand all Loading... |
1240 if (oldChild->previousSibling()) | 1240 if (oldChild->previousSibling()) |
1241 oldChild->previousSibling()->setNextSibling(oldChild->nextSibling()); | 1241 oldChild->previousSibling()->setNextSibling(oldChild->nextSibling()); |
1242 if (oldChild->nextSibling()) | 1242 if (oldChild->nextSibling()) |
1243 oldChild->nextSibling()->setPreviousSibling(oldChild->previousSibling())
; | 1243 oldChild->nextSibling()->setPreviousSibling(oldChild->previousSibling())
; |
1244 | 1244 |
1245 if (m_first == oldChild) | 1245 if (m_first == oldChild) |
1246 m_first = oldChild->nextSibling(); | 1246 m_first = oldChild->nextSibling(); |
1247 if (m_last == oldChild) | 1247 if (m_last == oldChild) |
1248 m_last = oldChild->previousSibling(); | 1248 m_last = oldChild->previousSibling(); |
1249 | 1249 |
1250 if (!oldChild->stackingNode()->isTreatedAsOrStackingContext() && !layoutObje
ct()->documentBeingDestroyed()) | 1250 if (!oldChild->stackingNode()->isStacked() && !layoutObject()->documentBeing
Destroyed()) |
1251 compositor()->setNeedsCompositingUpdate(CompositingUpdateRebuildTree); | 1251 compositor()->setNeedsCompositingUpdate(CompositingUpdateRebuildTree); |
1252 | 1252 |
1253 if (oldChild->stackingNode()->isTreatedAsOrStackingContext() || oldChild->fi
rstChild()) { | 1253 if (oldChild->stackingNode()->isStacked() || oldChild->firstChild()) { |
1254 // Dirty the z-order list in which we are contained. When called via th
e | 1254 // Dirty the z-order list in which we are contained. When called via th
e |
1255 // reattachment process in removeOnlyThisLayer, the layer may already be
disconnected | 1255 // reattachment process in removeOnlyThisLayer, the layer may already be
disconnected |
1256 // from the main layer tree, so we need to null-check the | 1256 // from the main layer tree, so we need to null-check the |
1257 // |stackingContext| value. | 1257 // |stackingContext| value. |
1258 oldChild->stackingNode()->dirtyStackingContextZOrderLists(); | 1258 oldChild->stackingNode()->dirtyStackingContextZOrderLists(); |
1259 } | 1259 } |
1260 | 1260 |
1261 if (layoutObject()->style()->visibility() != VISIBLE) | 1261 if (layoutObject()->style()->visibility() != VISIBLE) |
1262 dirtyVisibleContentStatus(); | 1262 dirtyVisibleContentStatus(); |
1263 | 1263 |
(...skipping 1301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2565 // not possibly have changed. | 2565 // not possibly have changed. |
2566 m_rareData->compositedLayerMapping->setNeedsGraphicsLayerUpdate(GraphicsLaye
rUpdateLocal); | 2566 m_rareData->compositedLayerMapping->setNeedsGraphicsLayerUpdate(GraphicsLaye
rUpdateLocal); |
2567 compositor()->setNeedsCompositingUpdate(CompositingUpdateAfterGeometryChange
); | 2567 compositor()->setNeedsCompositingUpdate(CompositingUpdateAfterGeometryChange
); |
2568 | 2568 |
2569 if (m_scrollableArea) | 2569 if (m_scrollableArea) |
2570 m_scrollableArea->updateAfterStyleChange(oldStyle); | 2570 m_scrollableArea->updateAfterStyleChange(oldStyle); |
2571 | 2571 |
2572 return true; | 2572 return true; |
2573 } | 2573 } |
2574 | 2574 |
2575 void PaintLayer::styleChanged(StyleDifference diff, const ComputedStyle* oldStyl
e) | 2575 void PaintLayer::styleDidChange(StyleDifference diff, const ComputedStyle* oldSt
yle) |
2576 { | 2576 { |
2577 if (attemptDirectCompositingUpdate(diff, oldStyle)) | 2577 if (attemptDirectCompositingUpdate(diff, oldStyle)) |
2578 return; | 2578 return; |
2579 | 2579 |
2580 m_stackingNode->updateIsTreatedAsStackingContext(); | 2580 m_stackingNode->styleDidChange(oldStyle); |
2581 m_stackingNode->updateStackingNodesAfterStyleChange(oldStyle); | |
2582 | 2581 |
2583 if (m_scrollableArea) | 2582 if (m_scrollableArea) |
2584 m_scrollableArea->updateAfterStyleChange(oldStyle); | 2583 m_scrollableArea->updateAfterStyleChange(oldStyle); |
2585 | 2584 |
2586 // Overlay scrollbars can make this layer self-painting so we need | 2585 // Overlay scrollbars can make this layer self-painting so we need |
2587 // to recompute the bit once scrollbars have been updated. | 2586 // to recompute the bit once scrollbars have been updated. |
2588 updateSelfPaintingLayer(); | 2587 updateSelfPaintingLayer(); |
2589 | 2588 |
2590 if (!oldStyle || !layoutObject()->style()->reflectionDataEquivalent(oldStyle
)) { | 2589 if (!oldStyle || !layoutObject()->style()->reflectionDataEquivalent(oldStyle
)) { |
2591 ASSERT(!oldStyle || diff.needsFullLayout()); | 2590 ASSERT(!oldStyle || diff.needsFullLayout()); |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2839 | 2838 |
2840 void showLayerTree(const blink::LayoutObject* layoutObject) | 2839 void showLayerTree(const blink::LayoutObject* layoutObject) |
2841 { | 2840 { |
2842 if (!layoutObject) { | 2841 if (!layoutObject) { |
2843 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); | 2842 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); |
2844 return; | 2843 return; |
2845 } | 2844 } |
2846 showLayerTree(layoutObject->enclosingLayer()); | 2845 showLayerTree(layoutObject->enclosingLayer()); |
2847 } | 2846 } |
2848 #endif | 2847 #endif |
OLD | NEW |