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

Unified Diff: gpu/command_buffer/service/in_process_command_buffer.cc

Issue 1345813002: Added a unique command buffer ID for command buffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved functions to GpuControl 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 side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/in_process_command_buffer.cc
diff --git a/gpu/command_buffer/service/in_process_command_buffer.cc b/gpu/command_buffer/service/in_process_command_buffer.cc
index 6997cecdbf2de82fd668b4f7155050e5790e0727..2b34b2e453f041aedd4be5cb2cda61e25477f9cc 100644
--- a/gpu/command_buffer/service/in_process_command_buffer.cc
+++ b/gpu/command_buffer/service/in_process_command_buffer.cc
@@ -54,6 +54,8 @@ namespace gpu {
namespace {
+base::StaticAtomicSequenceNumber g_next_command_buffer_id;
+
template <typename T>
static void RunTaskWithResult(base::Callback<T(void)> task,
T* result,
@@ -174,7 +176,8 @@ gpu::gles2::ProgramCache* InProcessCommandBuffer::Service::program_cache() {
InProcessCommandBuffer::InProcessCommandBuffer(
const scoped_refptr<Service>& service)
- : context_lost_(false),
+ : command_buffer_id_(g_next_command_buffer_id.GetNext()),
+ context_lost_(false),
idle_work_pending_(false),
image_factory_(nullptr),
last_put_offset_(-1),
@@ -845,6 +848,14 @@ bool InProcessCommandBuffer::IsGpuChannelLost() {
return false;
}
+CommandBufferNamespace InProcessCommandBuffer::GetNamespaceID() const {
+ return kCommandBufferNamespace_InProcess;
+}
+
+uint64_t InProcessCommandBuffer::GetCommandBufferID() const {
+ return command_buffer_id_;
+}
+
uint32 InProcessCommandBuffer::CreateStreamTextureOnGpuThread(
uint32 client_texture_id) {
#if defined(OS_ANDROID)

Powered by Google App Engine
This is Rietveld 408576698