summaryrefslogtreecommitdiffstats
path: root/libs/gui/SurfaceTexture.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/gui/SurfaceTexture.cpp')
-rw-r--r--libs/gui/SurfaceTexture.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/libs/gui/SurfaceTexture.cpp b/libs/gui/SurfaceTexture.cpp
index d6cc8ce..223cf09 100644
--- a/libs/gui/SurfaceTexture.cpp
+++ b/libs/gui/SurfaceTexture.cpp
@@ -220,11 +220,19 @@ status_t SurfaceTexture::updateTexImage() {
mSlots[mLastQueued].mEglImage = image;
mSlots[mLastQueued].mEglDisplay = dpy;
}
+
+ GLint error;
+ while ((error = glGetError()) != GL_NO_ERROR) {
+ LOGE("GL error cleared before updating SurfaceTexture: %#04x", error);
+ }
glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, (GLeglImageOES)image);
- GLint error = glGetError();
- if (error != GL_NO_ERROR) {
+ bool failed = false;
+ while ((error = glGetError()) != GL_NO_ERROR) {
LOGE("error binding external texture image %p (slot %d): %#04x",
image, mLastQueued, error);
+ failed = true;
+ }
+ if (failed) {
return -EINVAL;
}