зеркало из https://github.com/mozilla/pjs.git
Bug 715190 - Clear existing GL errors before trying to check for a new one r=clord
This commit is contained in:
Родитель
f01856886a
Коммит
07da46f5ad
|
@ -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");
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче