Index: gpu/ipc/service/gpu_command_buffer_stub.cc |
diff --git a/gpu/ipc/service/gpu_command_buffer_stub.cc b/gpu/ipc/service/gpu_command_buffer_stub.cc |
index a3fec2cc52e6b9f7096119869b8035c3bb6e02c5..d7a2c370c1cba0154cba65dff901d9714d9ed67b 100644 |
--- a/gpu/ipc/service/gpu_command_buffer_stub.cc |
+++ b/gpu/ipc/service/gpu_command_buffer_stub.cc |
@@ -476,7 +476,7 @@ |
// Virtualize PreferIntegratedGpu contexts by default on OS X to prevent |
// performance regressions when enabling FCM. |
// http://crbug.com/180463 |
- if (init_params.attribs.gpu_preference == gl::PreferIntegratedGpu) |
+ if (init_params.gpu_preference == gl::PreferIntegratedGpu) |
use_virtualized_gl_context_ = true; |
#endif |
@@ -506,6 +506,14 @@ |
use_virtualized_gl_context_ = false; |
#endif |
+ gfx::Size initial_size = init_params.size; |
+ if (offscreen && initial_size.IsEmpty()) { |
+ // If we're an offscreen surface with zero width and/or height, set to a |
+ // non-zero size so that we have a complete framebuffer for operations like |
+ // glClear. |
+ initial_size = gfx::Size(1, 1); |
+ } |
+ |
command_buffer_.reset(new CommandBufferService( |
context_group_->transfer_buffer_manager())); |
@@ -538,7 +546,7 @@ |
context = gl_share_group->GetSharedContext(); |
if (!context.get()) { |
context = gl::init::CreateGLContext(gl_share_group, default_surface, |
- init_params.attribs.gpu_preference); |
+ init_params.gpu_preference); |
if (!context.get()) { |
DLOG(ERROR) << "Failed to create shared context for virtualization."; |
return false; |
@@ -555,8 +563,7 @@ |
gl::GetGLImplementation() == gl::kGLImplementationMockGL); |
context = new GLContextVirtual( |
gl_share_group, context.get(), decoder_->AsWeakPtr()); |
- if (!context->Initialize(surface_.get(), |
- init_params.attribs.gpu_preference)) { |
+ if (!context->Initialize(surface_.get(), init_params.gpu_preference)) { |
// The real context created above for the default offscreen surface |
// might not be compatible with this surface. |
context = NULL; |
@@ -566,7 +573,7 @@ |
} |
if (!context.get()) { |
context = gl::init::CreateGLContext(gl_share_group, surface_.get(), |
- init_params.attribs.gpu_preference); |
+ init_params.gpu_preference); |
} |
if (!context.get()) { |
DLOG(ERROR) << "Failed to create context."; |
@@ -589,7 +596,7 @@ |
} |
// Initialize the decoder with either the view or pbuffer GLContext. |
- if (!decoder_->Initialize(surface_, context, offscreen, |
+ if (!decoder_->Initialize(surface_, context, offscreen, initial_size, |
gpu::gles2::DisallowedFeatures(), |
init_params.attribs)) { |
DLOG(ERROR) << "Failed to initialize decoder."; |