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

Side by Side Diff: services/gles2/command_buffer_driver.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.h ('k') | services/gles2/command_buffer_impl.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_driver.h" 5 #include "services/gles2/command_buffer_driver.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/shared_memory.h" 9 #include "base/memory/shared_memory.h"
10 #include "gpu/command_buffer/common/constants.h" 10 #include "gpu/command_buffer/common/constants.h"
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 OnContextLost(state.context_lost_reason); 229 OnContextLost(state.context_lost_reason);
230 } 230 }
231 231
232 void CommandBufferDriver::OnResize(gfx::Size size, float scale_factor) { 232 void CommandBufferDriver::OnResize(gfx::Size size, float scale_factor) {
233 surface_->Resize(size); 233 surface_->Resize(size);
234 } 234 }
235 235
236 bool CommandBufferDriver::OnWaitSyncPoint(uint32_t sync_point) { 236 bool CommandBufferDriver::OnWaitSyncPoint(uint32_t sync_point) {
237 if (!sync_point) 237 if (!sync_point)
238 return true; 238 return true;
239 if (mailbox_manager_->UsesSync())
240 mailbox_manager_->PullTextureUpdates(sync_point);
239 if (sync_point_manager_->IsSyncPointRetired(sync_point)) 241 if (sync_point_manager_->IsSyncPointRetired(sync_point))
240 return true; 242 return true;
241 scheduler_->SetScheduled(false); 243 scheduler_->SetScheduled(false);
242 sync_point_manager_->AddSyncPointCallback( 244 sync_point_manager_->AddSyncPointCallback(
243 sync_point, base::Bind(&CommandBufferDriver::OnSyncPointRetired, 245 sync_point, base::Bind(&CommandBufferDriver::OnSyncPointRetired,
244 weak_factory_.GetWeakPtr())); 246 weak_factory_.GetWeakPtr()));
245 return scheduler_->IsScheduled(); 247 return scheduler_->IsScheduled();
246 } 248 }
247 249
248 void CommandBufferDriver::OnSyncPointRetired() { 250 void CommandBufferDriver::OnSyncPointRetired() {
249 scheduler_->SetScheduled(true); 251 scheduler_->SetScheduled(true);
250 } 252 }
251 253
254 void CommandBufferDriver::RetireSyncPointOnGpuThread(uint32 sync_point) {
255 if (mailbox_manager_->UsesSync())
256 mailbox_manager_->PushTextureUpdates(sync_point);
257 sync_point_manager_->RetireSyncPoint(sync_point);
258 }
259
252 void CommandBufferDriver::OnContextLost(uint32_t reason) { 260 void CommandBufferDriver::OnContextLost(uint32_t reason) {
253 loss_observer_->DidLoseContext(reason); 261 loss_observer_->DidLoseContext(reason);
254 client_->DidLoseContext(); 262 client_->DidLoseContext();
255 } 263 }
256 264
257 void CommandBufferDriver::OnUpdateVSyncParameters( 265 void CommandBufferDriver::OnUpdateVSyncParameters(
258 const base::TimeTicks timebase, 266 const base::TimeTicks timebase,
259 const base::TimeDelta interval) { 267 const base::TimeDelta interval) {
260 client_->UpdateVSyncParameters(timebase, interval); 268 client_->UpdateVSyncParameters(timebase, interval);
261 } 269 }
262 270
263 } // namespace gles2 271 } // namespace gles2
OLDNEW
« no previous file with comments | « services/gles2/command_buffer_driver.h ('k') | services/gles2/command_buffer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698