WAR driver bug where surfaces of size 0 fail.
Change-Id: I72b356c4cfb71f2342479ca21238b763d02e729d
diff --git a/rsContext.cpp b/rsContext.cpp
index c5ee7ee..bb38825 100644
--- a/rsContext.cpp
+++ b/rsContext.cpp
@@ -743,7 +743,9 @@
rsAssert(mIsGraphicsContext);
EGLBoolean ret;
- if (mEGL.mSurface != NULL) {
+ // WAR: Some drivers fail to handle 0 size surfaces correcntly.
+ // Use the pbuffer to avoid this pitfall.
+ if ((mEGL.mSurface != NULL) || (w == 0) || (h == 0)) {
ret = eglMakeCurrent(mEGL.mDisplay, mEGL.mSurfaceDefault, mEGL.mSurfaceDefault, mEGL.mContext);
checkEglError("eglMakeCurrent", ret);