| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_local.h" | 5 #include "components/mus/gles2/command_buffer_local.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "components/mus/gles2/command_buffer_local_client.h" | 8 #include "components/mus/gles2/command_buffer_local_client.h" |
| 9 #include "components/mus/gles2/gpu_memory_tracker.h" | 9 #include "components/mus/gles2/gpu_memory_tracker.h" |
| 10 #include "components/mus/gles2/mojo_gpu_memory_buffer.h" | 10 #include "components/mus/gles2/mojo_gpu_memory_buffer.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 // only needs to be per-thread. | 74 // only needs to be per-thread. |
| 75 bool bind_generates_resource = false; | 75 bool bind_generates_resource = false; |
| 76 scoped_refptr<gpu::gles2::ContextGroup> context_group = | 76 scoped_refptr<gpu::gles2::ContextGroup> context_group = |
| 77 new gpu::gles2::ContextGroup( | 77 new gpu::gles2::ContextGroup( |
| 78 gpu_state_->mailbox_manager(), new gles2::GpuMemoryTracker, | 78 gpu_state_->mailbox_manager(), new gles2::GpuMemoryTracker, |
| 79 new gpu::gles2::ShaderTranslatorCache, | 79 new gpu::gles2::ShaderTranslatorCache, |
| 80 new gpu::gles2::FramebufferCompletenessCache, nullptr, nullptr, | 80 new gpu::gles2::FramebufferCompletenessCache, nullptr, nullptr, |
| 81 nullptr, bind_generates_resource); | 81 nullptr, bind_generates_resource); |
| 82 | 82 |
| 83 command_buffer_.reset( | 83 command_buffer_.reset( |
| 84 new gpu::CommandBufferService(context_group->transfer_buffer_manager())); | 84 new gpu::CommandBufferService(context_group->transfer_buffer_manager(), |
| 85 kCommandBufferNamespace_InProcess, |
| 86 0)); |
| 85 bool result = command_buffer_->Initialize(); | 87 bool result = command_buffer_->Initialize(); |
| 86 DCHECK(result); | 88 DCHECK(result); |
| 87 | 89 |
| 88 decoder_.reset(::gpu::gles2::GLES2Decoder::Create(context_group.get())); | 90 decoder_.reset(::gpu::gles2::GLES2Decoder::Create(context_group.get())); |
| 89 scheduler_.reset(new gpu::GpuScheduler(command_buffer_.get(), decoder_.get(), | 91 scheduler_.reset(new gpu::GpuScheduler(command_buffer_.get(), decoder_.get(), |
| 90 decoder_.get())); | 92 decoder_.get())); |
| 91 decoder_->set_engine(scheduler_.get()); | 93 decoder_->set_engine(scheduler_.get()); |
| 92 decoder_->SetResizeCallback( | 94 decoder_->SetResizeCallback( |
| 93 base::Bind(&CommandBufferLocal::OnResize, base::Unretained(this))); | 95 base::Bind(&CommandBufferLocal::OnResize, base::Unretained(this))); |
| 94 decoder_->SetWaitSyncPointCallback( | 96 decoder_->SetWaitSyncPointCallback( |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 void CommandBufferLocal::OnContextLost(uint32_t reason) { | 255 void CommandBufferLocal::OnContextLost(uint32_t reason) { |
| 254 if (client_) | 256 if (client_) |
| 255 client_->DidLoseContext(); | 257 client_->DidLoseContext(); |
| 256 } | 258 } |
| 257 | 259 |
| 258 void CommandBufferLocal::OnSyncPointRetired() { | 260 void CommandBufferLocal::OnSyncPointRetired() { |
| 259 scheduler_->SetScheduled(true); | 261 scheduler_->SetScheduled(true); |
| 260 } | 262 } |
| 261 | 263 |
| 262 } // namespace gles2 | 264 } // namespace gles2 |
| OLD | NEW |