Bug 1390386 - fGetError should use BEFORE_GL_CALL. - r=jrmuizel
MozReview-Commit-ID: B8sR38Bzjb5
--- a/gfx/gl/GLContext.h
+++ b/gfx/gl/GLContext.h
@@ -562,36 +562,27 @@ private:
GLenum err = RawGetError();
if (err)
while (RawGetError()) {}
return err;
}
-public:
GLenum FlushErrors() const {
GLenum err = RawGetErrorAndClear();
if (!mTopError)
mTopError = err;
return err;
}
- // We smash all errors together, so you never have to loop on this. We
- // guarantee that immediately after this call, there are no errors left.
- GLenum fGetError() {
- FlushErrors();
-
- GLenum err = mTopError;
- mTopError = LOCAL_GL_NO_ERROR;
- return err;
- }
-
////////////////////////////////////
// Use this safer option.
+
+public:
class LocalErrorScope;
private:
std::stack<const LocalErrorScope*> mLocalErrorScopeStack;
public:
class LocalErrorScope {
GLContext& mGL;
@@ -778,16 +769,29 @@ public:
return mSyncGLCallCount;
}
void ResetSyncCallCount(const char* resetReason) const;
// -----------------------------------------------------------------------------
// GL official entry points
public:
+ // We smash all errors together, so you never have to loop on this. We
+ // guarantee that immediately after this call, there are no errors left.
+ GLenum fGetError() {
+ GLenum err = LOCAL_GL_CONTEXT_LOST;
+ BEFORE_GL_CALL;
+
+ FlushErrors();
+ err = mTopError;
+ mTopError = LOCAL_GL_NO_ERROR;
+
+ AFTER_GL_CALL;
+ return err;
+ }
void fActiveTexture(GLenum texture) {
BEFORE_GL_CALL;
mSymbols.fActiveTexture(texture);
AFTER_GL_CALL;
}
void fAttachShader(GLuint program, GLuint shader) {