Bug 715190 - Clear existing GL errors before trying to check for a new one r=clord

This commit is contained in:
James Willcox 2012-01-04 21:51:11 -05:00
Родитель ab6dbded4e
Коммит 462e0daa64
2 изменённых файлов: 16 добавлений и 0 удалений

Просмотреть файл

@ -50,6 +50,7 @@ import javax.microedition.khronos.opengles.GL10;
* Encapsulates the logic needed to draw the single-tiled Gecko texture
*/
public class WidgetTileLayer extends Layer {
private static final String LOGTAG = "WidgetTileLayer";
private int[] mTextureIDs;
private CairoImage mImage;
@ -110,7 +111,16 @@ public class WidgetTileLayer extends Layer {
0);
float top = viewport.height() - (bounds.top + bounds.height());
// There may be errors from a previous GL call, so clear them first because
// we want to check for one below
while (GLES11.glGetError() != GLES11.GL_NO_ERROR);
GLES11Ext.glDrawTexfOES(bounds.left, top, 0.0f, bounds.width(), bounds.height());
int error = GLES11.glGetError();
if (error != GLES11.GL_NO_ERROR) {
Log.i(LOGTAG, "Failed to draw texture: " + error);
}
}
}

Просмотреть файл

@ -234,6 +234,11 @@ private:
namespace mozilla {
static void clearGLError()
{
while (glGetError() != GL_NO_ERROR);
}
static bool ensureNoGLError(const char* name)
{
bool result = true;
@ -443,6 +448,7 @@ AndroidGraphicBuffer::Bind()
return false;
}
clearGLError();
sGLFunctions.fImageTargetTexture2DOES(GL_TEXTURE_2D, mEGLImage);
return ensureNoGLError("glEGLImageTargetTexture2DOES");
}