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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 221833009: cc: Move scheduling logic out of OutputSurface (Closed) Base URL: http://git.chromium.org/chromium/src.git@swapAck2Sched11
Patch Set: rebase; fix tests 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
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 05b6b2aadc147f9a0412572046d7014ce6e6d836..f6e7a6d040d358d26afba9498380b3e1f87b617d 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1490,6 +1490,8 @@ bool LayerTreeHostImpl::SwapBuffers(const LayerTreeHostImpl::FrameData& frame) {
void LayerTreeHostImpl::SetNeedsBeginFrame(bool enable) {
if (output_surface_)
output_surface_->SetNeedsBeginFrame(enable);
+ else
+ DCHECK(!enable);
}
void LayerTreeHostImpl::WillBeginImplFrame(const BeginFrameArgs& args) {
@@ -1856,20 +1858,18 @@ bool LayerTreeHostImpl::InitializeRenderer(
GetRendererCapabilities().allow_rasterize_on_demand);
}
- 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 /
- settings_.refresh_rate);
+ // Initialize vsync parameters to sane values.
+ const base::TimeDelta display_refresh_interval =
+ base::TimeDelta::FromMicroseconds(base::Time::kMicrosecondsPerSecond /
+ settings_.refresh_rate);
+ CommitVSyncParameters(base::TimeTicks(), display_refresh_interval);
- output_surface->InitializeBeginFrameEmulation(
- proxy_->ImplThreadTaskRunner(),
- display_refresh_interval);
- }
+ // TODO(biranderson): Don't use a hard-coded parent draw time.
Sami 2014/04/08 13:46:01 Hey no assigning TODOs to others :)
brianderson 2014/04/09 02:52:05 D'oh.
brianderson 2014/04/10 23:45:58 Done.
+ base::TimeDelta parent_draw_time =
+ output_surface->capabilities().adjust_deadline_for_parent
+ ? BeginFrameArgs::DefaultDeadlineAdjustment()
+ : base::TimeDelta();
+ client_->SetEstimatedParentDrawTime(parent_draw_time);
int max_frames_pending =
output_surface->capabilities().max_frames_pending;
@@ -1885,6 +1885,11 @@ bool LayerTreeHostImpl::InitializeRenderer(
return true;
}
+void LayerTreeHostImpl::CommitVSyncParameters(base::TimeTicks timebase,
+ base::TimeDelta interval) {
+ client_->CommitVSyncParameters(timebase, interval);
+}
+
bool LayerTreeHostImpl::DeferredInitialize(
scoped_refptr<ContextProvider> offscreen_context_provider) {
DCHECK(output_surface_->capabilities().deferred_gl_initialization);

Powered by Google App Engine
This is Rietveld 408576698