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 e14cf986092b9c8817dcd3024e2474890734c368..29ad1da9a4b17615d5d98da9821ab44cf5d9d9ce 100644 |
--- a/content/common/gpu/gpu_command_buffer_stub.cc |
+++ b/content/common/gpu/gpu_command_buffer_stub.cc |
@@ -201,6 +201,14 @@ GpuCommandBufferStub::GpuCommandBufferStub( |
use_virtualized_gl_context_ |= |
context_group_->feature_info()->workarounds().use_virtualized_gl_contexts; |
+ |
+ bool is_offscreen = surface_id_ == 0; |
+ if (is_offscreen && initial_size_.IsEmpty()) { |
hendrikw
2015/04/24 18:33:38
I might rename initial_size_ to initial_offscreen_
|
+ // 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); |
+ } |
} |
GpuCommandBufferStub::~GpuCommandBufferStub() { |