mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 665070 - part 5: implement WebGLContext::UpdateWebGLErrorAndClearGLError - r=jrmuizel
This commit is contained in:
parent
b9a7e5c7a7
commit
1d72ac0fab
@ -395,6 +395,23 @@ public:
|
||||
// See section 2.2 in the WebGL spec.
|
||||
void EnsureBackbufferClearedAsNeeded();
|
||||
|
||||
// checks for GL errors, clears any pending GL error, stores the current GL error in currentGLError,
|
||||
// and copies it into mWebGLError if it doesn't already have an error set
|
||||
void UpdateWebGLErrorAndClearGLError(GLenum *currentGLError) {
|
||||
// get and clear GL error in ALL cases
|
||||
*currentGLError = gl->GetAndClearError();
|
||||
// only store in mWebGLError if is hasn't already recorded an error
|
||||
if (!mWebGLError)
|
||||
mWebGLError = *currentGLError;
|
||||
}
|
||||
|
||||
// checks for GL errors, clears any pending GL error,
|
||||
// and stores the current GL error into mWebGLError if it doesn't already have an error set
|
||||
void UpdateWebGLErrorAndClearGLError() {
|
||||
GLenum currentGLError;
|
||||
UpdateWebGLErrorAndClearGLError(¤tGLError);
|
||||
}
|
||||
|
||||
protected:
|
||||
void SetDontKnowIfNeedFakeBlack() {
|
||||
mFakeBlackStatus = DontKnowIfNeedFakeBlack;
|
||||
|
@ -2226,18 +2226,9 @@ WebGLContext::GetError(WebGLenum *_retval)
|
||||
{
|
||||
MakeContextCurrent();
|
||||
|
||||
// Always call GetAndClearError to clear any pending
|
||||
// real GL error.
|
||||
WebGLenum err = gl->GetAndClearError();
|
||||
|
||||
// mWebGLError has the first error that occurred,
|
||||
// whether synthesized or real; if it's not NO_ERROR, use it.
|
||||
if (mWebGLError != LOCAL_GL_NO_ERROR) {
|
||||
err = mWebGLError;
|
||||
mWebGLError = LOCAL_GL_NO_ERROR;
|
||||
}
|
||||
|
||||
*_retval = err;
|
||||
UpdateWebGLErrorAndClearGLError();
|
||||
*_retval = mWebGLError;
|
||||
mWebGLError = LOCAL_GL_NO_ERROR;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user