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

Side by Side Diff: Source/WebCore/platform/graphics/GraphicsLayer.cpp

Issue 10169026: Merge 112939 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1084/
Patch Set: Created 8 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698