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

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 817603002: cc: Make scheduling be driven by vsync for android webview. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix rebase compile errors. Created 5 years, 8 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/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('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/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <map> 9 #include <map>
10 10
(...skipping 1427 matching lines...) Expand 10 before | Expand all | Expand 10 after
1438 resource_pool_->ReduceResourceUsage(); 1438 resource_pool_->ReduceResourceUsage();
1439 } 1439 }
1440 // If we're not visible, we likely released resources, so we want to 1440 // If we're not visible, we likely released resources, so we want to
1441 // aggressively flush here to make sure those DeleteTextures make it to the 1441 // aggressively flush here to make sure those DeleteTextures make it to the
1442 // GPU process to free up the memory. 1442 // GPU process to free up the memory.
1443 if (output_surface_->context_provider() && !visible_) { 1443 if (output_surface_->context_provider() && !visible_) {
1444 output_surface_->context_provider()->ContextGL()->ShallowFlushCHROMIUM(); 1444 output_surface_->context_provider()->ContextGL()->ShallowFlushCHROMIUM();
1445 } 1445 }
1446 } 1446 }
1447 1447
1448 void LayerTreeHostImpl::OnDraw() {
1449 client_->OnDrawForOutputSurface();
1450 }
1451
1448 void LayerTreeHostImpl::OnCanDrawStateChangedForTree() { 1452 void LayerTreeHostImpl::OnCanDrawStateChangedForTree() {
1449 client_->OnCanDrawStateChanged(CanDraw()); 1453 client_->OnCanDrawStateChanged(CanDraw());
1450 } 1454 }
1451 1455
1452 CompositorFrameMetadata LayerTreeHostImpl::MakeCompositorFrameMetadata() const { 1456 CompositorFrameMetadata LayerTreeHostImpl::MakeCompositorFrameMetadata() const {
1453 CompositorFrameMetadata metadata; 1457 CompositorFrameMetadata metadata;
1454 metadata.device_scale_factor = device_scale_factor_; 1458 metadata.device_scale_factor = device_scale_factor_;
1455 metadata.page_scale_factor = active_tree_->current_page_scale_factor(); 1459 metadata.page_scale_factor = active_tree_->current_page_scale_factor();
1456 metadata.scrollable_viewport_size = active_tree_->ScrollableViewportSize(); 1460 metadata.scrollable_viewport_size = active_tree_->ScrollableViewportSize();
1457 metadata.root_layer_size = active_tree_->ScrollableSize(); 1461 metadata.root_layer_size = active_tree_->ScrollableSize();
(...skipping 1968 matching lines...) Expand 10 before | Expand all | Expand 10 after
3426 new_target.SetToMin(layer_impl->MaxScrollOffset()); 3430 new_target.SetToMin(layer_impl->MaxScrollOffset());
3427 3431
3428 curve->UpdateTarget( 3432 curve->UpdateTarget(
3429 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time) 3433 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time)
3430 .InSecondsF(), 3434 .InSecondsF(),
3431 new_target); 3435 new_target);
3432 3436
3433 return true; 3437 return true;
3434 } 3438 }
3435 } // namespace cc 3439 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698