OLD | NEW |
---|---|
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/layer_tree_host.h" | 5 #include "cc/layer_tree_host.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
269 } | 269 } |
270 | 270 |
271 DCHECK_EQ(layer->id(), layerImpl->id()); | 271 DCHECK_EQ(layer->id(), layerImpl->id()); |
272 layer->pushPropertiesTo(layerImpl); | 272 layer->pushPropertiesTo(layerImpl); |
273 | 273 |
274 pushPropertiesRecursive(layer->maskLayer(), layerImpl->maskLayer()); | 274 pushPropertiesRecursive(layer->maskLayer(), layerImpl->maskLayer()); |
275 pushPropertiesRecursive(layer->replicaLayer(), layerImpl->replicaLayer()); | 275 pushPropertiesRecursive(layer->replicaLayer(), layerImpl->replicaLayer()); |
276 | 276 |
277 const std::vector<scoped_refptr<Layer> >& children = layer->children(); | 277 const std::vector<scoped_refptr<Layer> >& children = layer->children(); |
278 const ScopedPtrVector<LayerImpl>& implChildren = layerImpl->children(); | 278 const ScopedPtrVector<LayerImpl>& implChildren = layerImpl->children(); |
279 DCHECK_EQ(children.size(), implChildren.size()); | 279 DCHECK(children.size() <= implChildren.size()); |
Ian Vollick
2013/01/15 20:33:48
I think we need to be more explicit about impl-onl
| |
280 | 280 |
281 for (size_t i = 0; i < children.size(); ++i) { | 281 for (size_t i = 0; i < children.size(); ++i) { |
282 pushPropertiesRecursive(children[i].get(), implChildren[i]); | 282 pushPropertiesRecursive(children[i].get(), implChildren[i]); |
283 } | 283 } |
284 } | 284 } |
285 | 285 |
286 // This function commits the LayerTreeHost to an impl tree. When modifying | 286 // This function commits the LayerTreeHost to an impl tree. When modifying |
287 // this function, keep in mind that the function *runs* on the impl thread! Any | 287 // this function, keep in mind that the function *runs* on the impl thread! Any |
288 // code that is logically a main thread operation, e.g. deletion of a Layer, | 288 // code that is logically a main thread operation, e.g. deletion of a Layer, |
289 // should be delayed until the LayerTreeHost::commitComplete, which will run | 289 // should be delayed until the LayerTreeHost::commitComplete, which will run |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
323 | 323 |
324 if (m_rootLayer && m_hudLayer) | 324 if (m_rootLayer && m_hudLayer) |
325 syncTree->set_hud_layer(static_cast<HeadsUpDisplayLayerImpl*>(LayerTreeH ostCommon::findLayerInSubtree(syncTree->RootLayer(), m_hudLayer->id()))); | 325 syncTree->set_hud_layer(static_cast<HeadsUpDisplayLayerImpl*>(LayerTreeH ostCommon::findLayerInSubtree(syncTree->RootLayer(), m_hudLayer->id()))); |
326 else | 326 else |
327 syncTree->set_hud_layer(0); | 327 syncTree->set_hud_layer(0); |
328 | 328 |
329 syncTree->set_source_frame_number(commitNumber()); | 329 syncTree->set_source_frame_number(commitNumber()); |
330 syncTree->set_background_color(m_backgroundColor); | 330 syncTree->set_background_color(m_backgroundColor); |
331 syncTree->set_has_transparent_background(m_hasTransparentBackground); | 331 syncTree->set_has_transparent_background(m_hasTransparentBackground); |
332 | 332 |
333 if (m_settings.pageScalePinchZoomEnabled) | |
334 hostImpl->pinchZoomViewport().AddPinchZoomScrollbarsToTree(syncTree); | |
Ian Vollick
2013/01/15 20:33:48
I don't like that this function is getting littere
| |
335 | |
333 hostImpl->setViewportSize(layoutViewportSize(), deviceViewportSize()); | 336 hostImpl->setViewportSize(layoutViewportSize(), deviceViewportSize()); |
334 hostImpl->setDeviceScaleFactor(deviceScaleFactor()); | 337 hostImpl->setDeviceScaleFactor(deviceScaleFactor()); |
335 hostImpl->setPageScaleFactorAndLimits(m_pageScaleFactor, m_minPageScaleFacto r, m_maxPageScaleFactor); | 338 hostImpl->setPageScaleFactorAndLimits(m_pageScaleFactor, m_minPageScaleFacto r, m_maxPageScaleFactor); |
336 hostImpl->setDebugState(m_debugState); | 339 hostImpl->setDebugState(m_debugState); |
337 | 340 |
338 m_commitNumber++; | 341 m_commitNumber++; |
339 } | 342 } |
340 | 343 |
341 void LayerTreeHost::willCommit() | 344 void LayerTreeHost::willCommit() |
342 { | 345 { |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
889 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn dex) | 892 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn dex) |
890 setAnimationEventsRecursive(events, layer->children()[childIndex].get(), wallClockTime); | 893 setAnimationEventsRecursive(events, layer->children()[childIndex].get(), wallClockTime); |
891 } | 894 } |
892 | 895 |
893 skia::RefPtr<SkPicture> LayerTreeHost::capturePicture() | 896 skia::RefPtr<SkPicture> LayerTreeHost::capturePicture() |
894 { | 897 { |
895 return m_proxy->capturePicture(); | 898 return m_proxy->capturePicture(); |
896 } | 899 } |
897 | 900 |
898 } // namespace cc | 901 } // namespace cc |
OLD | NEW |