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

Side by Side Diff: gpu/command_buffer/client/gles2_implementation.cc

Issue 2550583002: gpu: Thread-safe command buffer state lookup. (Closed)
Patch Set: piman's review Created 4 years 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // A class to emulate GLES2 over command buffers. 5 // A class to emulate GLES2 over command buffers.
6 6
7 #include "gpu/command_buffer/client/gles2_implementation.h" 7 #include "gpu/command_buffer/client/gles2_implementation.h"
8 8
9 #include <GLES2/gl2.h> 9 #include <GLES2/gl2.h>
10 #include <GLES2/gl2ext.h> 10 #include <GLES2/gl2ext.h>
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 intermediate_sync_token, 398 intermediate_sync_token,
399 base::Bind(&GLES2Implementation::RunIfContextNotLost, 399 base::Bind(&GLES2Implementation::RunIfContextNotLost,
400 weak_ptr_factory_.GetWeakPtr(), 400 weak_ptr_factory_.GetWeakPtr(),
401 callback)); 401 callback));
402 } else { 402 } else {
403 // Invalid sync token, just call the callback immediately. 403 // Invalid sync token, just call the callback immediately.
404 callback.Run(); 404 callback.Run();
405 } 405 }
406 } 406 }
407 407
408 // For some command buffer implementations this can be called from any thread.
409 // It's safe to access gpu_control_ without the lock because it is const.
410 bool GLES2Implementation::IsFenceSyncReleased(uint64_t release_count) {
411 return gpu_control_->IsFenceSyncReleased(release_count);
412 }
413
408 void GLES2Implementation::SignalQuery(uint32_t query, 414 void GLES2Implementation::SignalQuery(uint32_t query,
409 const base::Closure& callback) { 415 const base::Closure& callback) {
410 // Flush previously entered commands to ensure ordering with any 416 // Flush previously entered commands to ensure ordering with any
411 // glBeginQueryEXT() calls that may have been put into the context. 417 // glBeginQueryEXT() calls that may have been put into the context.
412 ShallowFlushCHROMIUM(); 418 ShallowFlushCHROMIUM();
413 gpu_control_->SignalQuery( 419 gpu_control_->SignalQuery(
414 query, 420 query,
415 base::Bind(&GLES2Implementation::RunIfContextNotLost, 421 base::Bind(&GLES2Implementation::RunIfContextNotLost,
416 weak_ptr_factory_.GetWeakPtr(), 422 weak_ptr_factory_.GetWeakPtr(),
417 callback)); 423 callback));
(...skipping 6612 matching lines...) Expand 10 before | Expand all | Expand 10 after
7030 cached_extensions_.clear(); 7036 cached_extensions_.clear();
7031 } 7037 }
7032 7038
7033 // Include the auto-generated part of this file. We split this because it means 7039 // Include the auto-generated part of this file. We split this because it means
7034 // we can easily edit the non-auto generated parts right here in this file 7040 // we can easily edit the non-auto generated parts right here in this file
7035 // instead of having to edit some template or the code generator. 7041 // instead of having to edit some template or the code generator.
7036 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" 7042 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h"
7037 7043
7038 } // namespace gles2 7044 } // namespace gles2
7039 } // namespace gpu 7045 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698