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 bool result = command_buffer_->Initialize(); | 85 bool result = command_buffer_->Initialize(); |
86 DCHECK(result); | 86 DCHECK(result); |
87 | 87 |
88 decoder_.reset(::gpu::gles2::GLES2Decoder::Create(context_group.get())); | 88 decoder_.reset(::gpu::gles2::GLES2Decoder::Create(context_group.get())); |
89 scheduler_.reset(new gpu::GpuScheduler(command_buffer_.get(), decoder_.get(), | 89 scheduler_.reset(new gpu::GpuScheduler(command_buffer_.get(), decoder_.get(), |
90 decoder_.get())); | 90 decoder_.get())); |
91 decoder_->set_engine(scheduler_.get()); | 91 decoder_->set_engine(scheduler_.get()); |
92 decoder_->SetResizeCallback( | 92 decoder_->SetResizeCallback( |
93 base::Bind(&CommandBufferLocal::OnResize, base::Unretained(this))); | 93 base::Bind(&CommandBufferLocal::OnResize, base::Unretained(this))); |
94 decoder_->SetWaitSyncPointCallback( | 94 decoder_->SetWaitSyncPointCallback( |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 void CommandBufferLocal::OnContextLost(uint32_t reason) { | 253 void CommandBufferLocal::OnContextLost(uint32_t reason) { |
254 if (client_) | 254 if (client_) |
255 client_->DidLoseContext(); | 255 client_->DidLoseContext(); |
256 } | 256 } |
257 | 257 |
258 void CommandBufferLocal::OnSyncPointRetired() { | 258 void CommandBufferLocal::OnSyncPointRetired() { |
259 scheduler_->SetScheduled(true); | 259 scheduler_->SetScheduled(true); |
260 } | 260 } |
261 | 261 |
262 } // namespace gles2 | 262 } // namespace gles2 |
OLD | NEW |