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

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: Fixed copyright 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..37b60c72e9a9daed8f43f4ffbfb88e7357b86ebe 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,9 @@ gpu::gles2::ProgramCache* InProcessCommandBuffer::Service::program_cache() {
InProcessCommandBuffer::InProcessCommandBuffer(
const scoped_refptr<Service>& service)
- : context_lost_(false),
+ : CommandBuffer(kCommandBufferNamespace_InProcess,
+ g_next_command_buffer_id.GetNext()),
+ context_lost_(false),
idle_work_pending_(false),
image_factory_(nullptr),
last_put_offset_(-1),
@@ -289,7 +293,9 @@ bool InProcessCommandBuffer::InitializeOnGpuThread(
manager->Initialize();
scoped_ptr<CommandBufferService> command_buffer(
- new CommandBufferService(transfer_buffer_manager_.get()));
+ new CommandBufferService(transfer_buffer_manager_.get(),
+ namespace_id(),
+ command_buffer_id()));
command_buffer->SetPutOffsetChangeCallback(base::Bind(
&InProcessCommandBuffer::PumpCommands, gpu_thread_weak_ptr_));
command_buffer->SetParseErrorCallback(base::Bind(

Powered by Google App Engine
This is Rietveld 408576698