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

Unified Diff: ui/gl/gl_surface_egl.cc

Issue 293293002: Updating calls to offscreen buffers to use a size of (0,0) when they do not require an actual buffer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 7 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: ui/gl/gl_surface_egl.cc
diff --git a/ui/gl/gl_surface_egl.cc b/ui/gl/gl_surface_egl.cc
index 040f8087f92d6a985e19f75d6ea5993914f2ecc3..f978b23883cb13269f518e592699dab07aed2082 100644
--- a/ui/gl/gl_surface_egl.cc
+++ b/ui/gl/gl_surface_egl.cc
@@ -489,6 +489,10 @@ void NativeViewGLSurfaceEGL::SetHandle(EGLSurface surface) {
PbufferGLSurfaceEGL::PbufferGLSurfaceEGL(const gfx::Size& size)
: size_(size),
surface_(NULL) {
+ // Some implementations of Pbuffer do not support having a 0 size. For such
+ // cases use a (1, 1) surface.
+ if (size_.GetArea() == 0)
+ size_.SetSize(1, 1);
}
bool PbufferGLSurfaceEGL::Initialize() {
@@ -500,12 +504,6 @@ bool PbufferGLSurfaceEGL::Initialize() {
return false;
}
- if (size_.GetArea() == 0) {
- LOG(ERROR) << "Error: surface has zero area "
- << size_.width() << " x " << size_.height();
- return false;
- }
-
// Allocate the new pbuffer surface before freeing the old one to ensure
// they have different addresses. If they have the same address then a
// future call to MakeCurrent might early out because it appears the current

Powered by Google App Engine
This is Rietveld 408576698