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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 return gpu_preferences_; | 159 return gpu_preferences_; |
160 } | 160 } |
161 | 161 |
162 const gpu::GpuDriverBugWorkarounds& | 162 const gpu::GpuDriverBugWorkarounds& |
163 InProcessCommandBuffer::Service::gpu_driver_bug_workarounds() { | 163 InProcessCommandBuffer::Service::gpu_driver_bug_workarounds() { |
164 return gpu_driver_bug_workarounds_; | 164 return gpu_driver_bug_workarounds_; |
165 } | 165 } |
166 | 166 |
167 scoped_refptr<gl::GLShareGroup> InProcessCommandBuffer::Service::share_group() { | 167 scoped_refptr<gl::GLShareGroup> InProcessCommandBuffer::Service::share_group() { |
168 if (!share_group_.get()) | 168 if (!share_group_.get()) |
169 share_group_ = new gl::GLShareGroup; | 169 share_group_ = new gl::GLShareGroup(); |
170 return share_group_; | 170 return share_group_; |
171 } | 171 } |
172 | 172 |
173 scoped_refptr<gles2::MailboxManager> | 173 scoped_refptr<gles2::MailboxManager> |
174 InProcessCommandBuffer::Service::mailbox_manager() { | 174 InProcessCommandBuffer::Service::mailbox_manager() { |
175 if (!mailbox_manager_.get()) { | 175 if (!mailbox_manager_.get()) { |
176 mailbox_manager_ = gles2::MailboxManager::Create(gpu_preferences()); | 176 mailbox_manager_ = gles2::MailboxManager::Create(gpu_preferences()); |
177 } | 177 } |
178 return mailbox_manager_; | 178 return mailbox_manager_; |
179 } | 179 } |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 | 355 |
356 sync_point_order_data_ = SyncPointOrderData::Create(); | 356 sync_point_order_data_ = SyncPointOrderData::Create(); |
357 sync_point_client_ = service_->sync_point_manager()->CreateSyncPointClient( | 357 sync_point_client_ = service_->sync_point_manager()->CreateSyncPointClient( |
358 sync_point_order_data_, GetNamespaceID(), GetCommandBufferID()); | 358 sync_point_order_data_, GetNamespaceID(), GetCommandBufferID()); |
359 | 359 |
360 if (service_->UseVirtualizedGLContexts() || | 360 if (service_->UseVirtualizedGLContexts() || |
361 decoder_->GetContextGroup() | 361 decoder_->GetContextGroup() |
362 ->feature_info() | 362 ->feature_info() |
363 ->workarounds() | 363 ->workarounds() |
364 .use_virtualized_gl_contexts) { | 364 .use_virtualized_gl_contexts) { |
365 context_ = gl_share_group_->GetSharedContext(); | 365 context_ = gl_share_group_->GetSharedContext(surface_.get()); |
366 if (!context_.get()) { | 366 if (!context_.get()) { |
367 context_ = gl::init::CreateGLContext( | 367 context_ = gl::init::CreateGLContext( |
368 gl_share_group_.get(), surface_.get(), params.attribs.gpu_preference); | 368 gl_share_group_.get(), surface_.get(), params.attribs.gpu_preference); |
369 gl_share_group_->SetSharedContext(context_.get()); | 369 gl_share_group_->SetSharedContext(surface_.get(), context_.get()); |
370 } | 370 } |
371 | 371 |
372 context_ = new GLContextVirtual( | 372 context_ = new GLContextVirtual( |
373 gl_share_group_.get(), context_.get(), decoder_->AsWeakPtr()); | 373 gl_share_group_.get(), context_.get(), decoder_->AsWeakPtr()); |
374 if (context_->Initialize(surface_.get(), params.attribs.gpu_preference)) { | 374 if (context_->Initialize(surface_.get(), params.attribs.gpu_preference)) { |
375 VLOG(1) << "Created virtual GL context."; | 375 VLOG(1) << "Created virtual GL context."; |
376 } else { | 376 } else { |
377 context_ = NULL; | 377 context_ = NULL; |
378 } | 378 } |
379 } else { | 379 } else { |
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1061 framebuffer_completeness_cache_ = | 1061 framebuffer_completeness_cache_ = |
1062 new gpu::gles2::FramebufferCompletenessCache; | 1062 new gpu::gles2::FramebufferCompletenessCache; |
1063 return framebuffer_completeness_cache_; | 1063 return framebuffer_completeness_cache_; |
1064 } | 1064 } |
1065 | 1065 |
1066 SyncPointManager* GpuInProcessThread::sync_point_manager() { | 1066 SyncPointManager* GpuInProcessThread::sync_point_manager() { |
1067 return sync_point_manager_; | 1067 return sync_point_manager_; |
1068 } | 1068 } |
1069 | 1069 |
1070 } // namespace gpu | 1070 } // namespace gpu |
OLD | NEW |