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 <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 gpu_state_->share_group(), surface_.get(), gfx::PreferIntegratedGpu); | 122 gpu_state_->share_group(), surface_.get(), gfx::PreferIntegratedGpu); |
123 if (!context_.get()) | 123 if (!context_.get()) |
124 return false; | 124 return false; |
125 | 125 |
126 if (!context_->MakeCurrent(surface_.get())) | 126 if (!context_->MakeCurrent(surface_.get())) |
127 return false; | 127 return false; |
128 | 128 |
129 // TODO(piman): ShaderTranslatorCache is currently per-ContextGroup but | 129 // TODO(piman): ShaderTranslatorCache is currently per-ContextGroup but |
130 // only needs to be per-thread. | 130 // only needs to be per-thread. |
131 const bool bind_generates_resource = attrib_helper.bind_generates_resource; | 131 const bool bind_generates_resource = attrib_helper.bind_generates_resource; |
132 scoped_refptr<gpu::gles2::FeatureInfo> feature_info = | |
133 new gpu::gles2::FeatureInfo(gpu_state_->gpu_driver_bug_workarounds()); | |
134 scoped_refptr<gpu::gles2::ContextGroup> context_group = | 132 scoped_refptr<gpu::gles2::ContextGroup> context_group = |
135 new gpu::gles2::ContextGroup( | 133 new gpu::gles2::ContextGroup( |
136 gpu_state_->gpu_preferences(), gpu_state_->mailbox_manager(), | 134 gpu_state_->gpu_preferences(), gpu_state_->mailbox_manager(), |
137 new GpuMemoryTracker, | 135 new GpuMemoryTracker, |
138 new gpu::gles2::ShaderTranslatorCache(gpu_state_->gpu_preferences()), | 136 new gpu::gles2::ShaderTranslatorCache(gpu_state_->gpu_preferences()), |
139 new gpu::gles2::FramebufferCompletenessCache, feature_info, nullptr, | 137 new gpu::gles2::FramebufferCompletenessCache, nullptr, nullptr, |
140 nullptr, bind_generates_resource); | 138 nullptr, bind_generates_resource); |
141 | 139 |
142 command_buffer_.reset( | 140 command_buffer_.reset( |
143 new gpu::CommandBufferService(context_group->transfer_buffer_manager())); | 141 new gpu::CommandBufferService(context_group->transfer_buffer_manager())); |
144 bool result = command_buffer_->Initialize(); | 142 bool result = command_buffer_->Initialize(); |
145 DCHECK(result); | 143 DCHECK(result); |
146 | 144 |
147 decoder_.reset(::gpu::gles2::GLES2Decoder::Create(context_group.get())); | 145 decoder_.reset(::gpu::gles2::GLES2Decoder::Create(context_group.get())); |
148 executor_.reset(new gpu::CommandExecutor(command_buffer_.get(), | 146 executor_.reset(new gpu::CommandExecutor(command_buffer_.get(), |
149 decoder_.get(), decoder_.get())); | 147 decoder_.get(), decoder_.get())); |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 } | 543 } |
546 | 544 |
547 void CommandBufferDriver::OnGpuCompletedSwapBuffers(gfx::SwapResult result) { | 545 void CommandBufferDriver::OnGpuCompletedSwapBuffers(gfx::SwapResult result) { |
548 DCHECK(CalledOnValidThread()); | 546 DCHECK(CalledOnValidThread()); |
549 if (client_) { | 547 if (client_) { |
550 client_->OnGpuCompletedSwapBuffers(result); | 548 client_->OnGpuCompletedSwapBuffers(result); |
551 } | 549 } |
552 } | 550 } |
553 | 551 |
554 } // namespace mus | 552 } // namespace mus |
OLD | NEW |