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 "gpu/command_buffer/service/in_process_command_buffer.h" | 5 #include "gpu/command_buffer/service/in_process_command_buffer.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <queue> | 10 #include <queue> |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 // ThreadTaskRunnerHandle, which will re-add a new task to the, AtExitManager, | 146 // ThreadTaskRunnerHandle, which will re-add a new task to the, AtExitManager, |
147 // which causes a deadlock because it's already locked. | 147 // which causes a deadlock because it's already locked. |
148 base::ThreadTaskRunnerHandle::IsSet(); | 148 base::ThreadTaskRunnerHandle::IsSet(); |
149 return g_default_service.Get().gpu_thread; | 149 return g_default_service.Get().gpu_thread; |
150 } | 150 } |
151 | 151 |
152 } // anonyous namespace | 152 } // anonyous namespace |
153 | 153 |
154 InProcessCommandBuffer::Service::Service() {} | 154 InProcessCommandBuffer::Service::Service() {} |
155 | 155 |
156 InProcessCommandBuffer::Service::Service(const GpuPreferences& gpu_preferences) | 156 InProcessCommandBuffer::Service::Service( |
157 : gpu_preferences_(gpu_preferences) {} | 157 const GpuPreferences& gpu_preferences, |
| 158 const GpuDriverBugWorkarounds& gpu_driver_bug_workarounds) |
| 159 : gpu_preferences_(gpu_preferences), |
| 160 gpu_driver_bug_workarounds_(gpu_driver_bug_workarounds) {} |
158 | 161 |
159 InProcessCommandBuffer::Service::~Service() {} | 162 InProcessCommandBuffer::Service::~Service() {} |
160 | 163 |
161 const gpu::GpuPreferences& | 164 const gpu::GpuPreferences& |
162 InProcessCommandBuffer::Service::gpu_preferences() { | 165 InProcessCommandBuffer::Service::gpu_preferences() { |
163 return gpu_preferences_; | 166 return gpu_preferences_; |
164 } | 167 } |
165 | 168 |
| 169 const gpu::GpuDriverBugWorkarounds& |
| 170 InProcessCommandBuffer::Service::gpu_driver_bug_workarounds() { |
| 171 return gpu_driver_bug_workarounds_; |
| 172 } |
| 173 |
166 scoped_refptr<gfx::GLShareGroup> | 174 scoped_refptr<gfx::GLShareGroup> |
167 InProcessCommandBuffer::Service::share_group() { | 175 InProcessCommandBuffer::Service::share_group() { |
168 if (!share_group_.get()) | 176 if (!share_group_.get()) |
169 share_group_ = new gfx::GLShareGroup; | 177 share_group_ = new gfx::GLShareGroup; |
170 return share_group_; | 178 return share_group_; |
171 } | 179 } |
172 | 180 |
173 scoped_refptr<gles2::MailboxManager> | 181 scoped_refptr<gles2::MailboxManager> |
174 InProcessCommandBuffer::Service::mailbox_manager() { | 182 InProcessCommandBuffer::Service::mailbox_manager() { |
175 if (!mailbox_manager_.get()) { | 183 if (!mailbox_manager_.get()) { |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 | 348 |
341 #if defined(OS_ANDROID) | 349 #if defined(OS_ANDROID) |
342 stream_texture_manager_.reset(new StreamTextureManagerInProcess); | 350 stream_texture_manager_.reset(new StreamTextureManagerInProcess); |
343 #endif | 351 #endif |
344 | 352 |
345 bool bind_generates_resource = false; | 353 bool bind_generates_resource = false; |
346 decoder_.reset(gles2::GLES2Decoder::Create( | 354 decoder_.reset(gles2::GLES2Decoder::Create( |
347 params.context_group | 355 params.context_group |
348 ? params.context_group->decoder_->GetContextGroup() | 356 ? params.context_group->decoder_->GetContextGroup() |
349 : new gles2::ContextGroup(service_->gpu_preferences(), | 357 : new gles2::ContextGroup(service_->gpu_preferences(), |
| 358 service_->gpu_driver_bug_workarounds(), |
350 service_->mailbox_manager(), NULL, | 359 service_->mailbox_manager(), NULL, |
351 service_->shader_translator_cache(), | 360 service_->shader_translator_cache(), |
352 service_->framebuffer_completeness_cache(), | 361 service_->framebuffer_completeness_cache(), |
353 NULL, service_->subscription_ref_set(), | 362 NULL, service_->subscription_ref_set(), |
354 service_->pending_valuebuffer_state(), | 363 service_->pending_valuebuffer_state(), |
355 bind_generates_resource))); | 364 bind_generates_resource))); |
356 | 365 |
357 executor_.reset(new CommandExecutor(command_buffer.get(), decoder_.get(), | 366 executor_.reset(new CommandExecutor(command_buffer.get(), decoder_.get(), |
358 decoder_.get())); | 367 decoder_.get())); |
359 command_buffer->SetGetBufferChangeCallback(base::Bind( | 368 command_buffer->SetGetBufferChangeCallback(base::Bind( |
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1092 framebuffer_completeness_cache_ = | 1101 framebuffer_completeness_cache_ = |
1093 new gpu::gles2::FramebufferCompletenessCache; | 1102 new gpu::gles2::FramebufferCompletenessCache; |
1094 return framebuffer_completeness_cache_; | 1103 return framebuffer_completeness_cache_; |
1095 } | 1104 } |
1096 | 1105 |
1097 SyncPointManager* GpuInProcessThread::sync_point_manager() { | 1106 SyncPointManager* GpuInProcessThread::sync_point_manager() { |
1098 return sync_point_manager_; | 1107 return sync_point_manager_; |
1099 } | 1108 } |
1100 | 1109 |
1101 } // namespace gpu | 1110 } // namespace gpu |
OLD | NEW |