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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 199523002: cc: Throttle swaps in Scheduler instead of OutputSurface (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Actually, unittests need CC_EXPORT. Created 6 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 4a945a224384de89251c3b1d7a2b888f932c4999..d1909f8ffe92cdbdc4bc9bbddb35e7c7705afe66 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1301,8 +1301,8 @@ void LayerTreeHostImpl::DidSwapBuffers() {
client_->DidSwapBuffersOnImplThread();
}
-void LayerTreeHostImpl::OnSwapBuffersComplete() {
- client_->OnSwapBuffersCompleteOnImplThread();
+void LayerTreeHostImpl::DidSwapBuffersComplete() {
+ client_->DidSwapBuffersCompleteOnImplThread();
}
void LayerTreeHostImpl::ReclaimResources(const CompositorFrameAck* ack) {
@@ -1901,8 +1901,11 @@ bool LayerTreeHostImpl::InitializeRenderer(
GetRendererCapabilities().allow_rasterize_on_demand);
}
- // Setup BeginFrameEmulation if it's not supported natively
- if (!settings_.begin_impl_frame_scheduling_enabled) {
+ if (!settings_.throttle_frame_production) {
+ // Disable VSync
+ output_surface->SetThrottleFrameProduction(false);
+ } else if (!settings_.begin_impl_frame_scheduling_enabled) {
+ // Setup BeginFrameEmulation if it's not supported natively
const base::TimeDelta display_refresh_interval =
base::TimeDelta::FromMicroseconds(
base::Time::kMicrosecondsPerSecond /
@@ -1910,7 +1913,6 @@ bool LayerTreeHostImpl::InitializeRenderer(
output_surface->InitializeBeginFrameEmulation(
proxy_->ImplThreadTaskRunner(),
- settings_.throttle_frame_production,
display_refresh_interval);
}
@@ -1918,7 +1920,7 @@ bool LayerTreeHostImpl::InitializeRenderer(
output_surface->capabilities().max_frames_pending;
if (max_frames_pending <= 0)
max_frames_pending = OutputSurface::DEFAULT_MAX_FRAMES_PENDING;
- output_surface->SetMaxFramesPending(max_frames_pending);
+ client_->SetMaxSwapsPendingOnImplThread(max_frames_pending);
resource_provider_ = resource_provider.Pass();
output_surface_ = output_surface.Pass();
« 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