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

Unified Diff: gpu/ipc/in_process_command_buffer.cc

Issue 2529703002: Mus: Install SwapBuffersCompleted/VSync callbacks to DirectOutputSurface(Ozone) (Closed)
Patch Set: Grab capabilities from the InProcessCommandBuffer instead of making them up Created 4 years, 1 month 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 | « gpu/ipc/in_process_command_buffer.h ('k') | services/ui/surfaces/direct_output_surface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/ipc/in_process_command_buffer.cc
diff --git a/gpu/ipc/in_process_command_buffer.cc b/gpu/ipc/in_process_command_buffer.cc
index 9ed647621779c9d9c71d499f415e36a109207ce0..1a1c72d32049d4728a07fb8192c4570f717918d0 100644
--- a/gpu/ipc/in_process_command_buffer.cc
+++ b/gpu/ipc/in_process_command_buffer.cc
@@ -1082,6 +1082,39 @@ void InProcessCommandBuffer::DidCreateAcceleratedSurfaceChildWindow(
void InProcessCommandBuffer::DidSwapBuffersComplete(
SwapBuffersCompleteParams params) {
+ if (!origin_task_runner_) {
+ DidSwapBuffersCompleteOnOriginThread(std::move(params));
+ return;
+ }
+ origin_task_runner_->PostTask(
+ FROM_HERE,
+ base::Bind(&InProcessCommandBuffer::DidSwapBuffersCompleteOnOriginThread,
+ client_thread_weak_ptr_, base::Passed(&params)));
+}
+
+const gles2::FeatureInfo* InProcessCommandBuffer::GetFeatureInfo() const {
+ return context_group_->feature_info();
+}
+
+void InProcessCommandBuffer::SetLatencyInfoCallback(
+ const LatencyInfoCallback& callback) {
+ // TODO(fsamuel): Implement this.
+}
+
+void InProcessCommandBuffer::UpdateVSyncParameters(base::TimeTicks timebase,
+ base::TimeDelta interval) {
+ if (!origin_task_runner_) {
+ UpdateVSyncParametersOnOriginThread(timebase, interval);
+ return;
+ }
+ origin_task_runner_->PostTask(
+ FROM_HERE,
+ base::Bind(&InProcessCommandBuffer::UpdateVSyncParametersOnOriginThread,
+ client_thread_weak_ptr_, timebase, interval));
+}
+
+void InProcessCommandBuffer::DidSwapBuffersCompleteOnOriginThread(
+ SwapBuffersCompleteParams params) {
#if defined(OS_MACOSX)
gpu::GpuProcessHostedCALayerTreeParamsMac params_mac;
params_mac.ca_context_id = params.ca_context_id;
@@ -1110,17 +1143,9 @@ void InProcessCommandBuffer::DidSwapBuffersComplete(
}
}
-const gles2::FeatureInfo* InProcessCommandBuffer::GetFeatureInfo() const {
- return context_group_->feature_info();
-}
-
-void InProcessCommandBuffer::SetLatencyInfoCallback(
- const LatencyInfoCallback& callback) {
- // TODO(fsamuel): Implement this.
-}
-
-void InProcessCommandBuffer::UpdateVSyncParameters(base::TimeTicks timebase,
- base::TimeDelta interval) {
+void InProcessCommandBuffer::UpdateVSyncParametersOnOriginThread(
+ base::TimeTicks timebase,
+ base::TimeDelta interval) {
if (!update_vsync_parameters_completion_callback_.is_null())
update_vsync_parameters_completion_callback_.Run(timebase, interval);
}
« no previous file with comments | « gpu/ipc/in_process_command_buffer.h ('k') | services/ui/surfaces/direct_output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698