OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 m_client->verifyNotPainting(); | 92 m_client->verifyNotPainting(); |
93 #endif | 93 #endif |
94 } | 94 } |
95 | 95 |
96 GraphicsLayer::~GraphicsLayer() | 96 GraphicsLayer::~GraphicsLayer() |
97 { | 97 { |
98 #ifndef NDEBUG | 98 #ifndef NDEBUG |
99 if (m_client) | 99 if (m_client) |
100 m_client->verifyNotPainting(); | 100 m_client->verifyNotPainting(); |
101 #endif | 101 #endif |
| 102 |
| 103 if (m_replicatedLayer) |
| 104 m_replicatedLayer->setReplicatedByLayer(0); |
| 105 |
102 removeAllChildren(); | 106 removeAllChildren(); |
103 removeFromParent(); | 107 removeFromParent(); |
104 } | 108 } |
105 | 109 |
106 void GraphicsLayer::setParent(GraphicsLayer* layer) | 110 void GraphicsLayer::setParent(GraphicsLayer* layer) |
107 { | 111 { |
108 ASSERT(!layer || !layer->hasAncestor(this)); | 112 ASSERT(!layer || !layer->hasAncestor(this)); |
109 m_parent = layer; | 113 m_parent = layer; |
110 } | 114 } |
111 | 115 |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 m_replicaLayer->noteDeviceOrPageScaleFactorChangedIncludingDescendants()
; | 256 m_replicaLayer->noteDeviceOrPageScaleFactorChangedIncludingDescendants()
; |
253 | 257 |
254 const Vector<GraphicsLayer*>& childLayers = children(); | 258 const Vector<GraphicsLayer*>& childLayers = children(); |
255 size_t numChildren = childLayers.size(); | 259 size_t numChildren = childLayers.size(); |
256 for (size_t i = 0; i < numChildren; ++i) | 260 for (size_t i = 0; i < numChildren; ++i) |
257 childLayers[i]->noteDeviceOrPageScaleFactorChangedIncludingDescendants()
; | 261 childLayers[i]->noteDeviceOrPageScaleFactorChangedIncludingDescendants()
; |
258 } | 262 } |
259 | 263 |
260 void GraphicsLayer::setReplicatedByLayer(GraphicsLayer* layer) | 264 void GraphicsLayer::setReplicatedByLayer(GraphicsLayer* layer) |
261 { | 265 { |
| 266 if (m_replicaLayer == layer) |
| 267 return; |
| 268 |
| 269 if (m_replicaLayer) |
| 270 m_replicaLayer->setReplicatedLayer(0); |
| 271 |
262 if (layer) | 272 if (layer) |
263 layer->setReplicatedLayer(this); | 273 layer->setReplicatedLayer(this); |
264 | 274 |
265 m_replicaLayer = layer; | 275 m_replicaLayer = layer; |
266 } | 276 } |
267 | 277 |
268 void GraphicsLayer::setOffsetFromRenderer(const IntSize& offset) | 278 void GraphicsLayer::setOffsetFromRenderer(const IntSize& offset) |
269 { | 279 { |
270 if (offset == m_offsetFromRenderer) | 280 if (offset == m_offsetFromRenderer) |
271 return; | 281 return; |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 { | 655 { |
646 if (!layer) | 656 if (!layer) |
647 return; | 657 return; |
648 | 658 |
649 WTF::String output = layer->layerTreeAsText(LayerTreeAsTextDebug); | 659 WTF::String output = layer->layerTreeAsText(LayerTreeAsTextDebug); |
650 fprintf(stderr, "%s\n", output.utf8().data()); | 660 fprintf(stderr, "%s\n", output.utf8().data()); |
651 } | 661 } |
652 #endif | 662 #endif |
653 | 663 |
654 #endif // USE(ACCELERATED_COMPOSITING) | 664 #endif // USE(ACCELERATED_COMPOSITING) |
OLD | NEW |