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

Side by Side Diff: components/mus/gles2/command_buffer_driver.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 unified diff | Download patch
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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 // only needs to be per-thread. 91 // only needs to be per-thread.
92 bool bind_generates_resource = false; 92 bool bind_generates_resource = false;
93 scoped_refptr<gpu::gles2::ContextGroup> context_group = 93 scoped_refptr<gpu::gles2::ContextGroup> context_group =
94 new gpu::gles2::ContextGroup( 94 new gpu::gles2::ContextGroup(
95 gpu_state_->mailbox_manager(), new GpuMemoryTracker, 95 gpu_state_->mailbox_manager(), new GpuMemoryTracker,
96 new gpu::gles2::ShaderTranslatorCache, 96 new gpu::gles2::ShaderTranslatorCache,
97 new gpu::gles2::FramebufferCompletenessCache, nullptr, nullptr, 97 new gpu::gles2::FramebufferCompletenessCache, nullptr, nullptr,
98 nullptr, bind_generates_resource); 98 nullptr, bind_generates_resource);
99 99
100 command_buffer_.reset( 100 command_buffer_.reset(
101 new gpu::CommandBufferService(context_group->transfer_buffer_manager())); 101 new gpu::CommandBufferService(context_group->transfer_buffer_manager(),
102 kCommandBufferNamespace_Invalid, 0));
102 bool result = command_buffer_->Initialize(); 103 bool result = command_buffer_->Initialize();
103 DCHECK(result); 104 DCHECK(result);
104 105
105 decoder_.reset(::gpu::gles2::GLES2Decoder::Create(context_group.get())); 106 decoder_.reset(::gpu::gles2::GLES2Decoder::Create(context_group.get()));
106 scheduler_.reset(new gpu::GpuScheduler(command_buffer_.get(), decoder_.get(), 107 scheduler_.reset(new gpu::GpuScheduler(command_buffer_.get(), decoder_.get(),
107 decoder_.get())); 108 decoder_.get()));
108 decoder_->set_engine(scheduler_.get()); 109 decoder_->set_engine(scheduler_.get());
109 decoder_->SetResizeCallback( 110 decoder_->SetResizeCallback(
110 base::Bind(&CommandBufferDriver::OnResize, base::Unretained(this))); 111 base::Bind(&CommandBufferDriver::OnResize, base::Unretained(this)));
111 decoder_->SetWaitSyncPointCallback(base::Bind( 112 decoder_->SetWaitSyncPointCallback(base::Bind(
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 297
297 void CommandBufferDriver::DestroyDecoder() { 298 void CommandBufferDriver::DestroyDecoder() {
298 if (decoder_) { 299 if (decoder_) {
299 bool have_context = decoder_->MakeCurrent(); 300 bool have_context = decoder_->MakeCurrent();
300 decoder_->Destroy(have_context); 301 decoder_->Destroy(have_context);
301 decoder_.reset(); 302 decoder_.reset();
302 } 303 }
303 } 304 }
304 305
305 } // namespace gles2 306 } // namespace gles2
OLDNEW
« no previous file with comments | « no previous file | components/mus/gles2/command_buffer_local.cc » ('j') | mojo/gles2/command_buffer_client_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698