| 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 28 matching lines...) Expand all Loading... |
| 39 * other provisions required by the MPL or the GPL, as the case may be. | 39 * other provisions required by the MPL or the GPL, as the case may be. |
| 40 * If you do not delete the provisions above, a recipient may use your | 40 * If you do not delete the provisions above, a recipient may use your |
| 41 * version of this file under any of the LGPL, the MPL or the GPL. | 41 * version of this file under any of the LGPL, the MPL or the GPL. |
| 42 */ | 42 */ |
| 43 | 43 |
| 44 #include "sky/engine/config.h" | 44 #include "sky/engine/config.h" |
| 45 #include "sky/engine/core/rendering/RenderLayerStackingNode.h" | 45 #include "sky/engine/core/rendering/RenderLayerStackingNode.h" |
| 46 | 46 |
| 47 #include "sky/engine/core/rendering/RenderLayer.h" | 47 #include "sky/engine/core/rendering/RenderLayer.h" |
| 48 #include "sky/engine/core/rendering/RenderView.h" | 48 #include "sky/engine/core/rendering/RenderView.h" |
| 49 #include "sky/engine/core/rendering/compositing/RenderLayerCompositor.h" | |
| 50 #include "sky/engine/public/platform/Platform.h" | 49 #include "sky/engine/public/platform/Platform.h" |
| 51 | 50 |
| 52 namespace blink { | 51 namespace blink { |
| 53 | 52 |
| 54 // FIXME: This should not require RenderLayer. There is currently a cycle where | 53 // FIXME: This should not require RenderLayer. There is currently a cycle where |
| 55 // in order to determine if we shoulBeNormalFlowOnly() we have to ask the render | 54 // in order to determine if we shoulBeNormalFlowOnly() we have to ask the render |
| 56 // layer about some of its state. | 55 // layer about some of its state. |
| 57 RenderLayerStackingNode::RenderLayerStackingNode(RenderLayer* layer) | 56 RenderLayerStackingNode::RenderLayerStackingNode(RenderLayer* layer) |
| 58 : m_layer(layer) | 57 : m_layer(layer) |
| 59 , m_normalFlowListDirty(true) | 58 , m_normalFlowListDirty(true) |
| (...skipping 21 matching lines...) Expand all Loading... |
| 81 } | 80 } |
| 82 #endif | 81 #endif |
| 83 } | 82 } |
| 84 | 83 |
| 85 // Helper for the sorting of layers by z-index. | 84 // Helper for the sorting of layers by z-index. |
| 86 static inline bool compareZIndex(RenderLayerStackingNode* first, RenderLayerStac
kingNode* second) | 85 static inline bool compareZIndex(RenderLayerStackingNode* first, RenderLayerStac
kingNode* second) |
| 87 { | 86 { |
| 88 return first->zIndex() < second->zIndex(); | 87 return first->zIndex() < second->zIndex(); |
| 89 } | 88 } |
| 90 | 89 |
| 91 RenderLayerCompositor* RenderLayerStackingNode::compositor() const | |
| 92 { | |
| 93 ASSERT(renderer()->view()); | |
| 94 return renderer()->view()->compositor(); | |
| 95 } | |
| 96 | |
| 97 void RenderLayerStackingNode::dirtyZOrderLists() | 90 void RenderLayerStackingNode::dirtyZOrderLists() |
| 98 { | 91 { |
| 99 ASSERT(m_layerListMutationAllowed); | 92 ASSERT(m_layerListMutationAllowed); |
| 100 ASSERT(isStackingContext()); | 93 ASSERT(isStackingContext()); |
| 101 | 94 |
| 102 #if ENABLE(ASSERT) | 95 #if ENABLE(ASSERT) |
| 103 updateStackingParentForZOrderLists(0); | 96 updateStackingParentForZOrderLists(0); |
| 104 #endif | 97 #endif |
| 105 | 98 |
| 106 if (m_posZOrderList) | 99 if (m_posZOrderList) |
| 107 m_posZOrderList->clear(); | 100 m_posZOrderList->clear(); |
| 108 if (m_negZOrderList) | 101 if (m_negZOrderList) |
| 109 m_negZOrderList->clear(); | 102 m_negZOrderList->clear(); |
| 110 m_zOrderListsDirty = true; | 103 m_zOrderListsDirty = true; |
| 111 | |
| 112 if (!renderer()->documentBeingDestroyed()) | |
| 113 compositor()->setNeedsCompositingUpdate(CompositingUpdateRebuildTree); | |
| 114 } | 104 } |
| 115 | 105 |
| 116 void RenderLayerStackingNode::dirtyStackingContextZOrderLists() | 106 void RenderLayerStackingNode::dirtyStackingContextZOrderLists() |
| 117 { | 107 { |
| 118 if (RenderLayerStackingNode* stackingNode = ancestorStackingContextNode()) | 108 if (RenderLayerStackingNode* stackingNode = ancestorStackingContextNode()) |
| 119 stackingNode->dirtyZOrderLists(); | 109 stackingNode->dirtyZOrderLists(); |
| 120 } | 110 } |
| 121 | 111 |
| 122 void RenderLayerStackingNode::dirtyNormalFlowList() | 112 void RenderLayerStackingNode::dirtyNormalFlowList() |
| 123 { | 113 { |
| 124 ASSERT(m_layerListMutationAllowed); | 114 ASSERT(m_layerListMutationAllowed); |
| 125 | 115 |
| 126 #if ENABLE(ASSERT) | 116 #if ENABLE(ASSERT) |
| 127 updateStackingParentForNormalFlowList(0); | 117 updateStackingParentForNormalFlowList(0); |
| 128 #endif | 118 #endif |
| 129 | 119 |
| 130 if (m_normalFlowList) | 120 if (m_normalFlowList) |
| 131 m_normalFlowList->clear(); | 121 m_normalFlowList->clear(); |
| 132 m_normalFlowListDirty = true; | 122 m_normalFlowListDirty = true; |
| 133 | |
| 134 if (!renderer()->documentBeingDestroyed()) | |
| 135 compositor()->setNeedsCompositingUpdate(CompositingUpdateRebuildTree); | |
| 136 } | 123 } |
| 137 | 124 |
| 138 void RenderLayerStackingNode::rebuildZOrderLists() | 125 void RenderLayerStackingNode::rebuildZOrderLists() |
| 139 { | 126 { |
| 140 ASSERT(m_layerListMutationAllowed); | 127 ASSERT(m_layerListMutationAllowed); |
| 141 ASSERT(isDirtyStackingContext()); | 128 ASSERT(isDirtyStackingContext()); |
| 142 | 129 |
| 143 for (RenderLayer* child = layer()->firstChild(); child; child = child->nextS
ibling()) | 130 for (RenderLayer* child = layer()->firstChild(); child; child = child->nextS
ibling()) |
| 144 child->stackingNode()->collectLayers(m_posZOrderList, m_negZOrderList); | 131 child->stackingNode()->collectLayers(m_posZOrderList, m_negZOrderList); |
| 145 | 132 |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 } | 277 } |
| 291 return 0; | 278 return 0; |
| 292 } | 279 } |
| 293 | 280 |
| 294 RenderLayerModelObject* RenderLayerStackingNode::renderer() const | 281 RenderLayerModelObject* RenderLayerStackingNode::renderer() const |
| 295 { | 282 { |
| 296 return m_layer->renderer(); | 283 return m_layer->renderer(); |
| 297 } | 284 } |
| 298 | 285 |
| 299 } // namespace blink | 286 } // namespace blink |
| OLD | NEW |