diff options
| author | 2011-01-26 11:52:02 -0800 | |
|---|---|---|
| committer | 2011-01-31 15:35:29 -0800 | |
| commit | 0eb8851e8cc35f443646000220e42dba3adfab8b (patch) | |
| tree | 2a5c2d98f125ed99c2a22bfb6aa0925de5a4b574 | |
| parent | a2e8538a87acc64721cc604cf2ca6dc44ec08acf (diff) | |
Clear GL errors before updating a SurfaceTexture.
Change-Id: Ibdac657ae9e9ccae53c63abed9caf1f1513915c2
| -rw-r--r-- | libs/gui/SurfaceTexture.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libs/gui/SurfaceTexture.cpp b/libs/gui/SurfaceTexture.cpp index 1dadd53891..236ff4fd14 100644 --- a/libs/gui/SurfaceTexture.cpp +++ b/libs/gui/SurfaceTexture.cpp @@ -219,11 +219,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; } |