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

Side by Side Diff: components/mus/gles2/command_buffer_driver.cc

Issue 1348363003: content/gpu: Simplify stub scheduling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gpu_channel_stream
Patch Set: fix android compile error sigh 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 | « no previous file | components/mus/gles2/command_buffer_local.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 "components/mus/gles2/command_buffer_driver.h" 5 #include "components/mus/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 "components/mus/gles2/command_buffer_type_conversions.h" 10 #include "components/mus/gles2/command_buffer_type_conversions.h"
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 281
282 bool CommandBufferDriver::OnWaitSyncPoint(uint32_t sync_point) { 282 bool CommandBufferDriver::OnWaitSyncPoint(uint32_t sync_point) {
283 if (!sync_point) 283 if (!sync_point)
284 return true; 284 return true;
285 if (gpu_state_->sync_point_manager()->IsSyncPointRetired(sync_point)) 285 if (gpu_state_->sync_point_manager()->IsSyncPointRetired(sync_point))
286 return true; 286 return true;
287 scheduler_->SetScheduled(false); 287 scheduler_->SetScheduled(false);
288 gpu_state_->sync_point_manager()->AddSyncPointCallback( 288 gpu_state_->sync_point_manager()->AddSyncPointCallback(
289 sync_point, base::Bind(&CommandBufferDriver::OnSyncPointRetired, 289 sync_point, base::Bind(&CommandBufferDriver::OnSyncPointRetired,
290 weak_factory_.GetWeakPtr())); 290 weak_factory_.GetWeakPtr()));
291 return scheduler_->IsScheduled(); 291 return scheduler_->scheduled();
292 } 292 }
293 293
294 void CommandBufferDriver::OnSyncPointRetired() { 294 void CommandBufferDriver::OnSyncPointRetired() {
295 scheduler_->SetScheduled(true); 295 scheduler_->SetScheduled(true);
296 } 296 }
297 297
298 void CommandBufferDriver::OnContextLost(uint32_t reason) { 298 void CommandBufferDriver::OnContextLost(uint32_t reason) {
299 loss_observer_->DidLoseContext(reason); 299 loss_observer_->DidLoseContext(reason);
300 client_->DidLoseContext(); 300 client_->DidLoseContext();
301 } 301 }
302 302
303 void CommandBufferDriver::DestroyDecoder() { 303 void CommandBufferDriver::DestroyDecoder() {
304 if (decoder_) { 304 if (decoder_) {
305 bool have_context = decoder_->MakeCurrent(); 305 bool have_context = decoder_->MakeCurrent();
306 decoder_->Destroy(have_context); 306 decoder_->Destroy(have_context);
307 decoder_.reset(); 307 decoder_.reset();
308 } 308 }
309 } 309 }
310 310
311 } // namespace mus 311 } // namespace mus
OLDNEW
« no previous file with comments | « no previous file | components/mus/gles2/command_buffer_local.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698