Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1467)

Unified Diff: content/common/gpu/gpu_command_buffer_stub.cc

Issue 1106773002: gpu: Disallow zero sized offscreen framebuffers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed glGetError dcheck Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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() {
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698