| 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/view_manager/gles2/command_buffer_local.h" | 5 #include "components/view_manager/gles2/command_buffer_local.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "components/view_manager/gles2/command_buffer_local_client.h" | 8 #include "components/view_manager/gles2/command_buffer_local_client.h" |
| 9 #include "components/view_manager/gles2/gpu_memory_tracker.h" | 9 #include "components/view_manager/gles2/gpu_memory_tracker.h" |
| 10 #include "components/view_manager/gles2/mojo_gpu_memory_buffer.h" | 10 #include "components/view_manager/gles2/mojo_gpu_memory_buffer.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 69 |
| 70 if (!context_->MakeCurrent(surface_.get())) | 70 if (!context_->MakeCurrent(surface_.get())) |
| 71 return false; | 71 return false; |
| 72 | 72 |
| 73 // TODO(piman): ShaderTranslatorCache is currently per-ContextGroup but | 73 // TODO(piman): ShaderTranslatorCache is currently per-ContextGroup but |
| 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, nullptr, nullptr, nullptr, | 79 new gpu::gles2::ShaderTranslatorCache, |
| 80 bind_generates_resource); | 80 new gpu::gles2::FramebufferCompletenessCache, nullptr, nullptr, |
| 81 nullptr, bind_generates_resource); |
| 81 | 82 |
| 82 command_buffer_.reset( | 83 command_buffer_.reset( |
| 83 new gpu::CommandBufferService(context_group->transfer_buffer_manager())); | 84 new gpu::CommandBufferService(context_group->transfer_buffer_manager())); |
| 84 bool result = command_buffer_->Initialize(); | 85 bool result = command_buffer_->Initialize(); |
| 85 DCHECK(result); | 86 DCHECK(result); |
| 86 | 87 |
| 87 decoder_.reset(::gpu::gles2::GLES2Decoder::Create(context_group.get())); | 88 decoder_.reset(::gpu::gles2::GLES2Decoder::Create(context_group.get())); |
| 88 scheduler_.reset(new gpu::GpuScheduler(command_buffer_.get(), decoder_.get(), | 89 scheduler_.reset(new gpu::GpuScheduler(command_buffer_.get(), decoder_.get(), |
| 89 decoder_.get())); | 90 decoder_.get())); |
| 90 decoder_->set_engine(scheduler_.get()); | 91 decoder_->set_engine(scheduler_.get()); |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 void CommandBufferLocal::OnContextLost(uint32_t reason) { | 256 void CommandBufferLocal::OnContextLost(uint32_t reason) { |
| 256 if (client_) | 257 if (client_) |
| 257 client_->DidLoseContext(); | 258 client_->DidLoseContext(); |
| 258 } | 259 } |
| 259 | 260 |
| 260 void CommandBufferLocal::OnSyncPointRetired() { | 261 void CommandBufferLocal::OnSyncPointRetired() { |
| 261 scheduler_->SetScheduled(true); | 262 scheduler_->SetScheduled(true); |
| 262 } | 263 } |
| 263 | 264 |
| 264 } // namespace gles2 | 265 } // namespace gles2 |
| OLD | NEW |