Chromium Code Reviews| Index: content/common/gpu/gpu_command_buffer_stub.cc |
| diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc |
| index d0ed3d1c42908ca3b99bd7de42dc60870fad4c93..9b17c44890f47dc1e474f587046c8144eb3a7c13 100644 |
| --- a/content/common/gpu/gpu_command_buffer_stub.cc |
| +++ b/content/common/gpu/gpu_command_buffer_stub.cc |
| @@ -13,6 +13,7 @@ |
| #include "base/json/json_writer.h" |
| #include "base/macros.h" |
| #include "base/memory/shared_memory.h" |
| +#include "base/sys_info.h" |
| #include "base/time/time.h" |
| #include "base/trace_event/trace_event.h" |
| #include "build/build_config.h" |
| @@ -164,8 +165,7 @@ gfx::GLSurface::Format GetSurfaceFormatFromAttribute( |
| const gpu::gles2::ContextCreationAttribHelper& attrib, |
| bool use_virtualized_gl_context) { |
|
no sievers
2016/02/17 23:38:01
nit: this argument is unused now
Jinsuk Kim
2016/02/18 02:57:24
Done.
|
| gfx::GLSurface::Format format = gfx::GLSurface::SURFACE_DEFAULT; // ARGB8888 |
| - if (!use_virtualized_gl_context && |
| - attrib.red_size <= 5 && |
| + if (attrib.red_size <= 5 && |
| attrib.green_size <= 6 && |
| attrib.blue_size <= 5 && |
| attrib.alpha_size == 0) { |
| @@ -561,8 +561,13 @@ void GpuCommandBufferStub::OnInitialize( |
| } |
| scoped_refptr<gfx::GLContext> context; |
| - if (use_virtualized_gl_context_ && channel_->share_group()) { |
| - context = channel_->share_group()->GetSharedContext(); |
| + gfx::GLShareGroup* share_group = channel_->share_group(); |
| + |
| + // On-screen 16-bit surfaces on low-end device won't use virtualized context. |
|
no sievers
2016/02/17 23:38:01
You mean 32-bit surfaces, right?
Jinsuk Kim
2016/02/18 02:57:24
My bad.. removed the comment as this part is being
|
| + if (handle_.is_null() || |
| + !base::SysInfo::IsLowEndDevice() || |
|
no sievers
2016/02/17 23:38:01
You could actually generalize this and just say th
Jinsuk Kim
2016/02/18 02:57:24
Done.
|
| + surface_format_ == gfx::GLSurface::SURFACE_RGB565) { |
| + context = share_group->GetSharedContext(); |
| if (!context.get()) { |
| context = gfx::GLContext::CreateGLContext( |
| channel_->share_group(), |
| @@ -578,7 +583,7 @@ void GpuCommandBufferStub::OnInitialize( |
| // This should be a non-virtual GL context. |
| DCHECK(context->GetHandle()); |
| context = new gpu::GLContextVirtual( |
| - channel_->share_group(), context.get(), decoder_->AsWeakPtr()); |
| + share_group, context.get(), decoder_->AsWeakPtr()); |
| if (!context->Initialize(surface_.get(), gpu_preference_)) { |
| // TODO(sievers): The real context created above for the default |
| // offscreen surface might not be compatible with this surface. |
| @@ -593,7 +598,7 @@ void GpuCommandBufferStub::OnInitialize( |
| } |
| if (!context.get()) { |
| context = gfx::GLContext::CreateGLContext( |
| - channel_->share_group(), surface_.get(), gpu_preference_); |
| + share_group, surface_.get(), gpu_preference_); |
| } |
| if (!context.get()) { |
| DLOG(ERROR) << "Failed to create context."; |