OLD | NEW |
---|---|
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 Loading... | |
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)); | |
piman
2015/09/15 22:51:05
I guess we need a namespace for mojo too.
David Yen
2015/09/15 23:09:03
I'm not too familiar with mojo, does this class ha
| |
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 Loading... | |
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 |
OLD | NEW |