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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
292 syncTree->set_hud_layer(static_cast<HeadsUpDisplayLayerImpl*>(LayerTreeH ostCommon::findLayerInSubtree(syncTree->RootLayer(), m_hudLayer->id()))); | 292 syncTree->set_hud_layer(static_cast<HeadsUpDisplayLayerImpl*>(LayerTreeH ostCommon::findLayerInSubtree(syncTree->RootLayer(), m_hudLayer->id()))); |
293 else | 293 else |
294 syncTree->set_hud_layer(0); | 294 syncTree->set_hud_layer(0); |
295 | 295 |
296 syncTree->set_source_frame_number(commitNumber()); | 296 syncTree->set_source_frame_number(commitNumber()); |
297 syncTree->set_background_color(m_backgroundColor); | 297 syncTree->set_background_color(m_backgroundColor); |
298 syncTree->set_has_transparent_background(m_hasTransparentBackground); | 298 syncTree->set_has_transparent_background(m_hasTransparentBackground); |
299 | 299 |
300 syncTree->FindRootScrollLayer(); | 300 syncTree->FindRootScrollLayer(); |
301 | 301 |
302 if (m_settings.implSidePainting) { | |
danakj
2013/01/28 20:29:03
how about pulling out the appropriate page_scale_d
aelias_OOO_until_Jul13
2013/01/29 06:05:14
Done.
| |
303 DCHECK_EQ(1, syncTree->sent_page_scale_delta()); | |
304 syncTree->SetPageScaleFactorAndLimits(m_pageScaleFactor, m_minPageScaleF actor, m_maxPageScaleFactor); | |
305 syncTree->SetPageScaleDelta(hostImpl->activeTree()->page_scale_delta() / hostImpl->activeTree()->sent_page_scale_delta()); | |
danakj
2013/01/28 20:29:03
Can you add a comment here similar to the scroll c
enne (OOO)
2013/01/28 21:03:46
Yeah, this will still be needed given that we don'
aelias_OOO_until_Jul13
2013/01/29 06:05:14
Added comment.
| |
306 } else { | |
307 syncTree->SetPageScaleFactorAndLimits(m_pageScaleFactor, m_minPageScaleF actor, m_maxPageScaleFactor); | |
308 syncTree->SetPageScaleDelta(syncTree->page_scale_delta() / syncTree->sen t_page_scale_delta()); | |
309 syncTree->set_sent_page_scale_delta(1); | |
310 } | |
311 #if 0 | |
312 if (layer->layerTreeImpl()->settings().implSidePainting) { | |
313 DCHECK(layer->layerTreeImpl()->IsPendingTree()); | |
314 LayerImpl* active_twin = layer->layerTreeImpl()->FindActiveTreeLayerById (id()); | |
315 // Update the scroll delta from the active layer, which may have | |
316 // adjusted its scroll delta prior to this pending layer being created. | |
317 // This code is identical to that in LayerImpl::setScrollDelta. | |
318 if (active_twin) { | |
319 DCHECK(layer->sentScrollDelta().IsZero()); | |
320 layer->setScrollDelta(active_twin->scrollDelta() - active_twin->sent ScrollDelta()); | |
321 } | |
322 } else { | |
323 layer->setScrollDelta(layer->scrollDelta() - layer->sentScrollDelta()); | |
324 layer->setSentScrollDelta(gfx::Vector2d()); | |
325 } | |
326 #endif | |
327 | |
302 if (!m_settings.implSidePainting) { | 328 if (!m_settings.implSidePainting) { |
303 // If we're not in impl-side painting, the tree is immediately | 329 // If we're not in impl-side painting, the tree is immediately |
304 // considered active. | 330 // considered active. |
305 syncTree->DidBecomeActive(); | 331 syncTree->DidBecomeActive(); |
306 } | 332 } |
307 | 333 |
308 hostImpl->setViewportSize(layoutViewportSize(), deviceViewportSize()); | 334 hostImpl->setViewportSize(layoutViewportSize(), deviceViewportSize()); |
309 hostImpl->setDeviceScaleFactor(deviceScaleFactor()); | 335 hostImpl->setDeviceScaleFactor(deviceScaleFactor()); |
310 hostImpl->setPageScaleFactorAndLimits(m_pageScaleFactor, m_minPageScaleFacto r, m_maxPageScaleFactor); | |
311 hostImpl->setDebugState(m_debugState); | 336 hostImpl->setDebugState(m_debugState); |
312 hostImpl->savePaintTime(m_renderingStats.totalPaintTime); | 337 hostImpl->savePaintTime(m_renderingStats.totalPaintTime); |
313 | 338 |
314 if (newImplTreeHasNoEvictedResources) { | 339 if (newImplTreeHasNoEvictedResources) { |
315 if (syncTree->ContentsTexturesPurged()) | 340 if (syncTree->ContentsTexturesPurged()) |
316 syncTree->ResetContentsTexturesPurged(); | 341 syncTree->ResetContentsTexturesPurged(); |
317 } | 342 } |
318 | 343 |
319 m_commitNumber++; | 344 m_commitNumber++; |
320 } | 345 } |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
850 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn dex) | 875 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn dex) |
851 setAnimationEventsRecursive(events, layer->children()[childIndex].get(), wallClockTime); | 876 setAnimationEventsRecursive(events, layer->children()[childIndex].get(), wallClockTime); |
852 } | 877 } |
853 | 878 |
854 skia::RefPtr<SkPicture> LayerTreeHost::capturePicture() | 879 skia::RefPtr<SkPicture> LayerTreeHost::capturePicture() |
855 { | 880 { |
856 return m_proxy->capturePicture(); | 881 return m_proxy->capturePicture(); |
857 } | 882 } |
858 | 883 |
859 } // namespace cc | 884 } // namespace cc |
OLD | NEW |