Bug 863477 - Use SurfaceCaps::Any() for CreateOffscreen for GLContexts for NPAPI plugins. r=cpeterson

This commit is contained in:
Jeff Gilbert 2013-04-25 09:35:50 -07:00
parent 27cb228e61
commit 1eda226668
3 changed files with 9 additions and 3 deletions

View File

@ -83,8 +83,8 @@ static bool EnsureGLContext()
{
if (!sPluginContext) {
gfxIntSize dummySize(16, 16);
GLContext::SurfaceCaps dummyCaps;
sPluginContext = GLContextProvider::CreateOffscreen(dummySize, dummyCaps);
sPluginContext = GLContextProvider::CreateOffscreen(dummySize,
GLContext::SurfaceCaps::Any());
}
return sPluginContext != nullptr;

View File

@ -869,9 +869,12 @@ GLContext::UpdatePixelFormat()
PixelBufferFormat format = QueryPixelFormat();
#ifdef DEBUG
const SurfaceCaps& caps = Caps();
MOZ_ASSERT(!caps.any, "Did you forget to DetermineCaps()?");
MOZ_ASSERT(caps.color == !!format.red);
MOZ_ASSERT(caps.color == !!format.green);
MOZ_ASSERT(caps.color == !!format.blue);
MOZ_ASSERT(caps.alpha == !!format.alpha);
MOZ_ASSERT(caps.depth == !!format.depth);
MOZ_ASSERT(caps.stencil == !!format.stencil);

View File

@ -1195,7 +1195,10 @@ public:
fViewport(0, 0, size.width, size.height);
mCaps = mScreen->Caps();
UpdateGLFormats(caps);
if (mCaps.any)
DetermineCaps();
UpdateGLFormats(mCaps);
UpdatePixelFormat();
return true;