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

Side by Side Diff: components/mus/surfaces/top_level_display_client.cc

Issue 1821863002: Hook up ui::Compositor to Display's BeginFrameSource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unittests Created 4 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/mus/surfaces/top_level_display_client.h" 5 #include "components/mus/surfaces/top_level_display_client.h"
6 6
7 #include "base/thread_task_runner_handle.h" 7 #include "base/thread_task_runner_handle.h"
8 #include "cc/output/compositor_frame.h" 8 #include "cc/output/compositor_frame.h"
9 #include "cc/output/copy_output_request.h" 9 #include "cc/output/copy_output_request.h"
10 #include "cc/scheduler/begin_frame_source.h" 10 #include "cc/scheduler/begin_frame_source.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 void TopLevelDisplayClient::OutputSurfaceLost() { 93 void TopLevelDisplayClient::OutputSurfaceLost() {
94 if (!display_) // Shutdown case 94 if (!display_) // Shutdown case
95 return; 95 return;
96 display_.reset(); 96 display_.reset();
97 } 97 }
98 98
99 void TopLevelDisplayClient::SetMemoryPolicy( 99 void TopLevelDisplayClient::SetMemoryPolicy(
100 const cc::ManagedMemoryPolicy& policy) {} 100 const cc::ManagedMemoryPolicy& policy) {}
101 101
102 cc::BeginFrameSource* TopLevelDisplayClient::BeginFrameSourceForChildren() {
103 return synthetic_frame_source_.get();
104 }
105
102 void TopLevelDisplayClient::OnVSyncParametersUpdated(int64_t timebase, 106 void TopLevelDisplayClient::OnVSyncParametersUpdated(int64_t timebase,
103 int64_t interval) { 107 int64_t interval) {
104 auto timebase_time_ticks = base::TimeTicks::FromInternalValue(timebase); 108 auto timebase_time_ticks = base::TimeTicks::FromInternalValue(timebase);
105 auto interval_time_delta = base::TimeDelta::FromInternalValue(interval); 109 auto interval_time_delta = base::TimeDelta::FromInternalValue(interval);
106 110
107 if (interval_time_delta.is_zero()) { 111 if (interval_time_delta.is_zero()) {
108 // TODO(brianderson): We should not be receiving 0 intervals. 112 // TODO(brianderson): We should not be receiving 0 intervals.
109 interval_time_delta = cc::BeginFrameArgs::DefaultInterval(); 113 interval_time_delta = cc::BeginFrameArgs::DefaultInterval();
110 } 114 }
111 115
112 synthetic_frame_source_->OnUpdateVSyncParameters(timebase_time_ticks, 116 synthetic_frame_source_->OnUpdateVSyncParameters(timebase_time_ticks,
113 interval_time_delta); 117 interval_time_delta);
114 } 118 }
115 119
116 void TopLevelDisplayClient::ReturnResources( 120 void TopLevelDisplayClient::ReturnResources(
117 const cc::ReturnedResourceArray& resources) { 121 const cc::ReturnedResourceArray& resources) {
118 // TODO(fsamuel): Implement this. 122 // TODO(fsamuel): Implement this.
119 } 123 }
120 124
121 void TopLevelDisplayClient::SetBeginFrameSource( 125 void TopLevelDisplayClient::SetBeginFrameSource(
122 cc::BeginFrameSource* begin_frame_source) { 126 cc::BeginFrameSource* begin_frame_source) {
123 // TODO(tansell): Implement this. 127 // TODO(tansell): Implement this.
124 } 128 }
125 129
126 } // namespace mus 130 } // namespace mus
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698