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 <queue> | 7 #include <queue> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 else | 430 else |
431 surface_ = gfx::GLSurface::CreateViewGLSurface(params.window); | 431 surface_ = gfx::GLSurface::CreateViewGLSurface(params.window); |
432 } | 432 } |
433 | 433 |
434 if (!surface_.get()) { | 434 if (!surface_.get()) { |
435 LOG(ERROR) << "Could not create GLSurface."; | 435 LOG(ERROR) << "Could not create GLSurface."; |
436 DestroyOnGpuThread(); | 436 DestroyOnGpuThread(); |
437 return false; | 437 return false; |
438 } | 438 } |
439 | 439 |
440 if (service_->UseVirtualizedGLContexts()) { | 440 if (service_->UseVirtualizedGLContexts() || |
| 441 decoder_->GetContextGroup() |
| 442 ->feature_info() |
| 443 ->workarounds() |
| 444 .use_virtualized_gl_contexts) { |
441 context_ = gl_share_group_->GetSharedContext(); | 445 context_ = gl_share_group_->GetSharedContext(); |
442 if (!context_.get()) { | 446 if (!context_.get()) { |
443 context_ = gfx::GLContext::CreateGLContext( | 447 context_ = gfx::GLContext::CreateGLContext( |
444 gl_share_group_.get(), surface_.get(), params.gpu_preference); | 448 gl_share_group_.get(), surface_.get(), params.gpu_preference); |
445 gl_share_group_->SetSharedContext(context_.get()); | 449 gl_share_group_->SetSharedContext(context_.get()); |
446 } | 450 } |
447 | 451 |
448 context_ = new GLContextVirtual( | 452 context_ = new GLContextVirtual( |
449 gl_share_group_.get(), context_.get(), decoder_->AsWeakPtr()); | 453 gl_share_group_.get(), context_.get(), decoder_->AsWeakPtr()); |
450 if (context_->Initialize(surface_.get(), params.gpu_preference)) { | 454 if (context_->Initialize(surface_.get(), params.gpu_preference)) { |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
945 | 949 |
946 #if defined(OS_ANDROID) | 950 #if defined(OS_ANDROID) |
947 scoped_refptr<gfx::SurfaceTexture> | 951 scoped_refptr<gfx::SurfaceTexture> |
948 InProcessCommandBuffer::GetSurfaceTexture(uint32 stream_id) { | 952 InProcessCommandBuffer::GetSurfaceTexture(uint32 stream_id) { |
949 DCHECK(stream_texture_manager_); | 953 DCHECK(stream_texture_manager_); |
950 return stream_texture_manager_->GetSurfaceTexture(stream_id); | 954 return stream_texture_manager_->GetSurfaceTexture(stream_id); |
951 } | 955 } |
952 #endif | 956 #endif |
953 | 957 |
954 } // namespace gpu | 958 } // namespace gpu |
OLD | NEW |