Bug 1185815 - Hoist generation increment. r=jgilbert

So 'default' WebGL objects are in the same generation as the current context.
This commit is contained in:
Dan Glastonbury 2015-07-21 14:38:52 +10:00
parent cd012536c9
commit cb2c61433b

View File

@ -901,6 +901,11 @@ WebGLContext::SetDimensions(int32_t signedWidth, int32_t signedHeight)
return NS_ERROR_FAILURE; // exit without changing the value of mGeneration
}
// increment the generation number - Do this early because later
// in CreateOffscreenGL(), "default" objects are created that will
// pick up the old generation.
++mGeneration;
// Get some prefs for some preferred/overriden things
NS_ENSURE_TRUE(Preferences::GetRootBranch(), NS_ERROR_FAILURE);
@ -949,9 +954,6 @@ WebGLContext::SetDimensions(int32_t signedWidth, int32_t signedHeight)
mResetLayer = true;
mOptionsFrozen = true;
// increment the generation number
++mGeneration;
// Update our internal stuff:
if (gl->WorkAroundDriverBugs() && gl->IsANGLE()) {
if (!mOptions.alpha && gl->Caps().alpha)