Bug 929506 - Check that the GLContext is not destroyed in MakeCurrent. r=bjacob

This commit is contained in:
Nicolas Silva 2013-12-03 11:44:37 +01:00
parent 9f29252945
commit 7da987c39c
6 changed files with 8 additions and 8 deletions

View File

@ -456,7 +456,7 @@ GLContext::InitWithPrefix(const char *prefix, bool trygl)
};
mInitialized = LoadSymbols(&symbols[0], trygl, prefix);
MakeCurrent();
if (mInitialized) {
unsigned int version = 0;

View File

@ -2391,6 +2391,9 @@ public:
#endif
bool MakeCurrent(bool aForce = false) {
if (IsDestroyed()) {
return false;
}
#ifdef MOZ_ENABLE_GL_TRACKING
PR_SetThreadPrivate(sCurrentGLContextTLS, this);

View File

@ -121,7 +121,6 @@ public:
bool Init()
{
MakeCurrent();
if (!InitWithPrefix("gl", true))
return false;

View File

@ -331,6 +331,10 @@ public:
#endif
}
SetupLookupFunction();
if (!InitWithPrefix("gl", true))
return false;
bool current = MakeCurrent();
if (!current) {
gfx::LogFailure(NS_LITERAL_CSTRING(
@ -338,10 +342,6 @@ public:
return false;
}
SetupLookupFunction();
if (!InitWithPrefix("gl", true))
return false;
PR_STATIC_ASSERT(sizeof(GLint) >= sizeof(int32_t));
mMaxTextureImageSize = INT32_MAX;

View File

@ -861,7 +861,6 @@ TRY_AGAIN_NO_SHARING:
bool Init()
{
MakeCurrent();
SetupLookupFunction();
if (!InitWithPrefix("gl", true)) {
return false;

View File

@ -315,7 +315,6 @@ public:
if (!mDC || !mContext)
return false;
MakeCurrent();
SetupLookupFunction();
if (!InitWithPrefix("gl", true))
return false;