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