OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 void CCLayerTreeHost::setNeedsRedraw() | 195 void CCLayerTreeHost::setNeedsRedraw() |
196 { | 196 { |
197 #if USE(THREADED_COMPOSITING) | 197 #if USE(THREADED_COMPOSITING) |
198 TRACE_EVENT("CCLayerTreeHost::setNeedsRedraw", this, 0); | 198 TRACE_EVENT("CCLayerTreeHost::setNeedsRedraw", this, 0); |
199 m_proxy->setNeedsRedraw(); | 199 m_proxy->setNeedsRedraw(); |
200 #else | 200 #else |
201 m_client->scheduleComposite(); | 201 m_client->scheduleComposite(); |
202 #endif | 202 #endif |
203 } | 203 } |
204 | 204 |
| 205 void CCLayerTreeHost::clearRenderSurfacesRecursive(LayerChromium* layer) |
| 206 { |
| 207 for (size_t i = 0; i < layer->children().size(); ++i) |
| 208 clearRenderSurfacesRecursive(layer->children()[i].get()); |
| 209 |
| 210 if (layer->replicaLayer()) |
| 211 clearRenderSurfacesRecursive(layer->replicaLayer()); |
| 212 |
| 213 if (layer->maskLayer()) |
| 214 clearRenderSurfacesRecursive(layer->maskLayer()); |
| 215 |
| 216 layer->clearRenderSurface(); |
| 217 } |
| 218 |
| 219 |
205 void CCLayerTreeHost::setRootLayer(GraphicsLayer* layer) | 220 void CCLayerTreeHost::setRootLayer(GraphicsLayer* layer) |
206 { | 221 { |
207 m_nonCompositedContentHost->graphicsLayer()->removeAllChildren(); | 222 m_nonCompositedContentHost->graphicsLayer()->removeAllChildren(); |
208 m_nonCompositedContentHost->invalidateEntireLayer(); | 223 m_nonCompositedContentHost->invalidateEntireLayer(); |
209 if (layer) | 224 if (layer) |
210 m_nonCompositedContentHost->graphicsLayer()->addChild(layer); | 225 m_nonCompositedContentHost->graphicsLayer()->addChild(layer); |
| 226 else { |
| 227 clearRenderSurfacesRecursive(rootLayer()->platformLayer()); |
| 228 m_nonCompositedContentHost->graphicsLayer()->platformLayer()->setLayerTr
eeHost(0); |
| 229 m_rootLayer->platformLayer()->setLayerTreeHost(0); |
| 230 } |
211 } | 231 } |
212 | 232 |
213 void CCLayerTreeHost::setViewport(const IntSize& viewportSize, const IntSize& co
ntentsSize, const IntPoint& scrollPosition) | 233 void CCLayerTreeHost::setViewport(const IntSize& viewportSize, const IntSize& co
ntentsSize, const IntPoint& scrollPosition) |
214 { | 234 { |
215 bool visibleRectChanged = m_viewportSize != viewportSize; | 235 bool visibleRectChanged = m_viewportSize != viewportSize; |
216 | 236 |
217 m_viewportSize = viewportSize; | 237 m_viewportSize = viewportSize; |
218 m_nonCompositedContentHost->setScrollPosition(scrollPosition); | 238 m_nonCompositedContentHost->setScrollPosition(scrollPosition); |
219 m_nonCompositedContentHost->graphicsLayer()->setSize(contentsSize); | 239 m_nonCompositedContentHost->graphicsLayer()->setSize(contentsSize); |
220 | 240 |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 if (layer->maskLayer()) | 415 if (layer->maskLayer()) |
396 updateCompositorResources(layer->maskLayer(), context); | 416 updateCompositorResources(layer->maskLayer(), context); |
397 if (layer->replicaLayer()) | 417 if (layer->replicaLayer()) |
398 updateCompositorResources(layer->replicaLayer(), context); | 418 updateCompositorResources(layer->replicaLayer(), context); |
399 | 419 |
400 if (layer->drawsContent()) | 420 if (layer->drawsContent()) |
401 layer->updateCompositorResources(context); | 421 layer->updateCompositorResources(context); |
402 } | 422 } |
403 | 423 |
404 } | 424 } |
OLD | NEW |