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

Side by Side Diff: cc/layer_tree_host.cc

Issue 12093015: Move page scale ownership to LayerTreeImpl. (Closed) Base URL: http://git.chromium.org/chromium/src.git@coordchange3
Patch Set: Rebase to 179503 Created 7 years, 10 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 | « cc/cc.gyp ('k') | cc/layer_tree_host_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « cc/cc.gyp ('k') | cc/layer_tree_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698