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

Side by Side Diff: services/gles2/command_buffer_impl.cc

Issue 1348283004: Use MailboxManagerSync on android. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: add todo comment Created 5 years, 3 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 | « services/gles2/command_buffer_driver.cc ('k') | services/gles2/gpu_state.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "services/gles2/command_buffer_impl.h" 5 #include "services/gles2/command_buffer_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "gpu/command_buffer/service/sync_point_manager.h" 9 #include "gpu/command_buffer/service/sync_point_manager.h"
10 #include "services/gles2/command_buffer_driver.h" 10 #include "services/gles2/command_buffer_driver.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 driver_task_runner_->PostTask( 117 driver_task_runner_->PostTask(
118 FROM_HERE, base::Bind(&CommandBufferDriver::DestroyTransferBuffer, 118 FROM_HERE, base::Bind(&CommandBufferDriver::DestroyTransferBuffer,
119 base::Unretained(driver_.get()), id)); 119 base::Unretained(driver_.get()), id));
120 } 120 }
121 121
122 void CommandBufferImpl::InsertSyncPoint(bool retire) { 122 void CommandBufferImpl::InsertSyncPoint(bool retire) {
123 uint32_t sync_point = sync_point_manager_->GenerateSyncPoint(); 123 uint32_t sync_point = sync_point_manager_->GenerateSyncPoint();
124 sync_point_client_->DidInsertSyncPoint(sync_point); 124 sync_point_client_->DidInsertSyncPoint(sync_point);
125 if (retire) { 125 if (retire) {
126 driver_task_runner_->PostTask( 126 driver_task_runner_->PostTask(
127 FROM_HERE, base::Bind(&gpu::SyncPointManager::RetireSyncPoint, 127 FROM_HERE, base::Bind(&CommandBufferDriver::RetireSyncPointOnGpuThread,
128 sync_point_manager_, sync_point)); 128 base::Unretained(driver_.get()), sync_point));
129 } 129 }
130 } 130 }
131 131
132 void CommandBufferImpl::RetireSyncPoint(uint32_t sync_point) { 132 void CommandBufferImpl::RetireSyncPoint(uint32_t sync_point) {
133 driver_task_runner_->PostTask( 133 driver_task_runner_->PostTask(
134 FROM_HERE, base::Bind(&gpu::SyncPointManager::RetireSyncPoint, 134 FROM_HERE, base::Bind(&CommandBufferDriver::RetireSyncPointOnGpuThread,
135 sync_point_manager_, sync_point)); 135 base::Unretained(driver_.get()), sync_point));
136 } 136 }
137 137
138 void CommandBufferImpl::Echo(const mojo::Callback<void()>& callback) { 138 void CommandBufferImpl::Echo(const mojo::Callback<void()>& callback) {
139 driver_task_runner_->PostTaskAndReply(FROM_HERE, base::Bind(&base::DoNothing), 139 driver_task_runner_->PostTaskAndReply(FROM_HERE, base::Bind(&base::DoNothing),
140 base::Bind(&RunCallback, callback)); 140 base::Bind(&RunCallback, callback));
141 } 141 }
142 142
143 void CommandBufferImpl::DidLoseContext() { 143 void CommandBufferImpl::DidLoseContext() {
144 NotifyAndDestroy(); 144 NotifyAndDestroy();
145 } 145 }
(...skipping 30 matching lines...) Expand all
176 control_task_runner_->PostTask( 176 control_task_runner_->PostTask(
177 FROM_HERE, 177 FROM_HERE,
178 base::Bind(&CommandBufferImpl::Destroy, base::Unretained(this))); 178 base::Bind(&CommandBufferImpl::Destroy, base::Unretained(this)));
179 } 179 }
180 180
181 void CommandBufferImpl::Destroy() { 181 void CommandBufferImpl::Destroy() {
182 delete this; 182 delete this;
183 } 183 }
184 184
185 } // namespace gles2 185 } // namespace gles2
OLDNEW
« no previous file with comments | « services/gles2/command_buffer_driver.cc ('k') | services/gles2/gpu_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698