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 float page_scale_delta, sent_page_scale_delta; |
| 303 if (m_settings.implSidePainting) { |
| 304 // Update the delta from the active tree, which may have |
| 305 // adjusted its delta prior to the pending tree being created. |
| 306 // This code is equivalent to that in LayerTreeImpl::SetPageScaleDelta. |
| 307 DCHECK_EQ(1, syncTree->sent_page_scale_delta()); |
| 308 page_scale_delta = hostImpl->activeTree()->page_scale_delta(); |
| 309 sent_page_scale_delta = hostImpl->activeTree()->sent_page_scale_delta(); |
| 310 } else { |
| 311 page_scale_delta = syncTree->page_scale_delta(); |
| 312 sent_page_scale_delta = syncTree->sent_page_scale_delta(); |
| 313 syncTree->set_sent_page_scale_delta(1); |
| 314 } |
| 315 |
| 316 syncTree->SetPageScaleFactorAndLimits(m_pageScaleFactor, m_minPageScaleFacto
r, m_maxPageScaleFactor); |
| 317 syncTree->SetPageScaleDelta(page_scale_delta / sent_page_scale_delta); |
| 318 |
302 if (!m_settings.implSidePainting) { | 319 if (!m_settings.implSidePainting) { |
303 // If we're not in impl-side painting, the tree is immediately | 320 // If we're not in impl-side painting, the tree is immediately |
304 // considered active. | 321 // considered active. |
305 syncTree->DidBecomeActive(); | 322 syncTree->DidBecomeActive(); |
306 } | 323 } |
307 | 324 |
308 hostImpl->setViewportSize(layoutViewportSize(), deviceViewportSize()); | 325 hostImpl->setViewportSize(layoutViewportSize(), deviceViewportSize()); |
309 hostImpl->setDeviceScaleFactor(deviceScaleFactor()); | 326 hostImpl->setDeviceScaleFactor(deviceScaleFactor()); |
310 hostImpl->setPageScaleFactorAndLimits(m_pageScaleFactor, m_minPageScaleFacto
r, m_maxPageScaleFactor); | |
311 hostImpl->setDebugState(m_debugState); | 327 hostImpl->setDebugState(m_debugState); |
312 hostImpl->savePaintTime(m_renderingStats.totalPaintTime); | 328 hostImpl->savePaintTime(m_renderingStats.totalPaintTime); |
313 | 329 |
314 if (newImplTreeHasNoEvictedResources) { | 330 if (newImplTreeHasNoEvictedResources) { |
315 if (syncTree->ContentsTexturesPurged()) | 331 if (syncTree->ContentsTexturesPurged()) |
316 syncTree->ResetContentsTexturesPurged(); | 332 syncTree->ResetContentsTexturesPurged(); |
317 } | 333 } |
318 | 334 |
319 m_commitNumber++; | 335 m_commitNumber++; |
320 } | 336 } |
(...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) | 866 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn
dex) |
851 setAnimationEventsRecursive(events, layer->children()[childIndex].get(),
wallClockTime); | 867 setAnimationEventsRecursive(events, layer->children()[childIndex].get(),
wallClockTime); |
852 } | 868 } |
853 | 869 |
854 skia::RefPtr<SkPicture> LayerTreeHost::capturePicture() | 870 skia::RefPtr<SkPicture> LayerTreeHost::capturePicture() |
855 { | 871 { |
856 return m_proxy->capturePicture(); | 872 return m_proxy->capturePicture(); |
857 } | 873 } |
858 | 874 |
859 } // namespace cc | 875 } // namespace cc |
OLD | NEW |