| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 const gpu::GpuPreferences& | 158 const gpu::GpuPreferences& |
| 159 InProcessCommandBuffer::Service::gpu_preferences() { | 159 InProcessCommandBuffer::Service::gpu_preferences() { |
| 160 return gpu_preferences_; | 160 return gpu_preferences_; |
| 161 } | 161 } |
| 162 | 162 |
| 163 const gpu::GpuDriverBugWorkarounds& | 163 const gpu::GpuDriverBugWorkarounds& |
| 164 InProcessCommandBuffer::Service::gpu_driver_bug_workarounds() { | 164 InProcessCommandBuffer::Service::gpu_driver_bug_workarounds() { |
| 165 return gpu_driver_bug_workarounds_; | 165 return gpu_driver_bug_workarounds_; |
| 166 } | 166 } |
| 167 | 167 |
| 168 scoped_refptr<gfx::GLShareGroup> | 168 scoped_refptr<gl::GLShareGroup> InProcessCommandBuffer::Service::share_group() { |
| 169 InProcessCommandBuffer::Service::share_group() { | |
| 170 if (!share_group_.get()) | 169 if (!share_group_.get()) |
| 171 share_group_ = new gfx::GLShareGroup; | 170 share_group_ = new gl::GLShareGroup; |
| 172 return share_group_; | 171 return share_group_; |
| 173 } | 172 } |
| 174 | 173 |
| 175 scoped_refptr<gles2::MailboxManager> | 174 scoped_refptr<gles2::MailboxManager> |
| 176 InProcessCommandBuffer::Service::mailbox_manager() { | 175 InProcessCommandBuffer::Service::mailbox_manager() { |
| 177 if (!mailbox_manager_.get()) { | 176 if (!mailbox_manager_.get()) { |
| 178 mailbox_manager_ = gles2::MailboxManager::Create(gpu_preferences()); | 177 mailbox_manager_ = gles2::MailboxManager::Create(gpu_preferences()); |
| 179 } | 178 } |
| 180 return mailbox_manager_; | 179 return mailbox_manager_; |
| 181 } | 180 } |
| 182 | 181 |
| 183 gpu::gles2::ProgramCache* InProcessCommandBuffer::Service::program_cache() { | 182 gpu::gles2::ProgramCache* InProcessCommandBuffer::Service::program_cache() { |
| 184 if (!program_cache_.get() && | 183 if (!program_cache_.get() && |
| 185 (gfx::g_driver_gl.ext.b_GL_ARB_get_program_binary || | 184 (gl::g_driver_gl.ext.b_GL_ARB_get_program_binary || |
| 186 gfx::g_driver_gl.ext.b_GL_OES_get_program_binary) && | 185 gl::g_driver_gl.ext.b_GL_OES_get_program_binary) && |
| 187 !gpu_preferences().disable_gpu_program_cache) { | 186 !gpu_preferences().disable_gpu_program_cache) { |
| 188 program_cache_.reset(new gpu::gles2::MemoryProgramCache( | 187 program_cache_.reset(new gpu::gles2::MemoryProgramCache( |
| 189 gpu_preferences().gpu_program_cache_size, | 188 gpu_preferences().gpu_program_cache_size, |
| 190 gpu_preferences().disable_gpu_shader_disk_cache)); | 189 gpu_preferences().disable_gpu_shader_disk_cache)); |
| 191 } | 190 } |
| 192 return program_cache_.get(); | 191 return program_cache_.get(); |
| 193 } | 192 } |
| 194 | 193 |
| 195 InProcessCommandBuffer::InProcessCommandBuffer( | 194 InProcessCommandBuffer::InProcessCommandBuffer( |
| 196 const scoped_refptr<Service>& service) | 195 const scoped_refptr<Service>& service) |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 CheckSequencedThread(); | 239 CheckSequencedThread(); |
| 241 command_buffer_lock_.AssertAcquired(); | 240 command_buffer_lock_.AssertAcquired(); |
| 242 | 241 |
| 243 if (!MakeCurrent()) | 242 if (!MakeCurrent()) |
| 244 return; | 243 return; |
| 245 | 244 |
| 246 executor_->PutChanged(); | 245 executor_->PutChanged(); |
| 247 } | 246 } |
| 248 | 247 |
| 249 bool InProcessCommandBuffer::Initialize( | 248 bool InProcessCommandBuffer::Initialize( |
| 250 scoped_refptr<gfx::GLSurface> surface, | 249 scoped_refptr<gl::GLSurface> surface, |
| 251 bool is_offscreen, | 250 bool is_offscreen, |
| 252 gfx::AcceleratedWidget window, | 251 gfx::AcceleratedWidget window, |
| 253 const gfx::Size& size, | 252 const gfx::Size& size, |
| 254 const gles2::ContextCreationAttribHelper& attribs, | 253 const gles2::ContextCreationAttribHelper& attribs, |
| 255 gfx::GpuPreference gpu_preference, | 254 gl::GpuPreference gpu_preference, |
| 256 InProcessCommandBuffer* share_group, | 255 InProcessCommandBuffer* share_group, |
| 257 GpuMemoryBufferManager* gpu_memory_buffer_manager, | 256 GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| 258 ImageFactory* image_factory) { | 257 ImageFactory* image_factory) { |
| 259 DCHECK(!share_group || service_.get() == share_group->service_.get()); | 258 DCHECK(!share_group || service_.get() == share_group->service_.get()); |
| 260 | 259 |
| 261 if (surface) { | 260 if (surface) { |
| 262 // GPU thread must be the same as client thread due to GLSurface not being | 261 // GPU thread must be the same as client thread due to GLSurface not being |
| 263 // thread safe. | 262 // thread safe. |
| 264 sequence_checker_.reset(new base::SequenceChecker); | 263 sequence_checker_.reset(new base::SequenceChecker); |
| 265 surface_ = surface; | 264 surface_ = surface; |
| (...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1045 framebuffer_completeness_cache_ = | 1044 framebuffer_completeness_cache_ = |
| 1046 new gpu::gles2::FramebufferCompletenessCache; | 1045 new gpu::gles2::FramebufferCompletenessCache; |
| 1047 return framebuffer_completeness_cache_; | 1046 return framebuffer_completeness_cache_; |
| 1048 } | 1047 } |
| 1049 | 1048 |
| 1050 SyncPointManager* GpuInProcessThread::sync_point_manager() { | 1049 SyncPointManager* GpuInProcessThread::sync_point_manager() { |
| 1051 return sync_point_manager_; | 1050 return sync_point_manager_; |
| 1052 } | 1051 } |
| 1053 | 1052 |
| 1054 } // namespace gpu | 1053 } // namespace gpu |
| OLD | NEW |