зеркало из https://github.com/mozilla/pjs.git
backout 29ee49bff6a1 (Bug 726396) due to webgl test failures
This commit is contained in:
Родитель
ec2885cfd5
Коммит
943cb76570
|
@ -1274,6 +1274,9 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
void *GetD3DShareHandle() {
|
void *GetD3DShareHandle() {
|
||||||
|
if (!mPBufferCanBindToTexture)
|
||||||
|
return nsnull;
|
||||||
|
|
||||||
if (!sEGLLibrary.HasANGLESurfaceD3DTexture2DShareHandle()) {
|
if (!sEGLLibrary.HasANGLESurfaceD3DTexture2DShareHandle()) {
|
||||||
return nsnull;
|
return nsnull;
|
||||||
}
|
}
|
||||||
|
@ -2360,7 +2363,7 @@ GLContextEGL::CreateEGLPBufferOffscreenContext(const gfxIntSize& aSize,
|
||||||
|
|
||||||
// if we're running under ANGLE, we can't set BIND_TO_TEXTURE --
|
// if we're running under ANGLE, we can't set BIND_TO_TEXTURE --
|
||||||
// it's not supported, and we have dx interop pbuffers anyway
|
// it's not supported, and we have dx interop pbuffers anyway
|
||||||
if (sEGLLibrary.IsANGLE() || bufferUnused)
|
if (sEGLLibrary.IsANGLE())
|
||||||
configCanBindToTexture = false;
|
configCanBindToTexture = false;
|
||||||
|
|
||||||
nsTArray<EGLint> attribs(32);
|
nsTArray<EGLint> attribs(32);
|
||||||
|
@ -2444,11 +2447,10 @@ TRY_ATTRIBS_AGAIN:
|
||||||
return nsnull;
|
return nsnull;
|
||||||
}
|
}
|
||||||
|
|
||||||
glContext->mPBufferCanBindToTexture = configCanBindToTexture;
|
if (!bufferUnused) {
|
||||||
|
|
||||||
if (!bufferUnused) { // We *are* using the buffer
|
|
||||||
glContext->SetOffscreenSize(aSize, pbsize);
|
glContext->SetOffscreenSize(aSize, pbsize);
|
||||||
glContext->mIsPBuffer = true;
|
glContext->mIsPBuffer = true;
|
||||||
|
glContext->mPBufferCanBindToTexture = configCanBindToTexture;
|
||||||
}
|
}
|
||||||
|
|
||||||
return glContext.forget();
|
return glContext.forget();
|
||||||
|
@ -2609,20 +2611,13 @@ GLContextProviderEGL::CreateOffscreen(const gfxIntSize& aSize,
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(ANDROID) || defined(XP_WIN)
|
#if defined(ANDROID) || defined(XP_WIN)
|
||||||
bool usePBuffers = false; // Generally, prefer FBOs to PBuffers
|
|
||||||
|
|
||||||
if (sEGLLibrary.IsANGLE())
|
|
||||||
usePBuffers = true; // For d3d share handle, we need an EGL surface
|
|
||||||
|
|
||||||
gfxIntSize pbufferSize = usePBuffers ? aSize : gfxIntSize(16, 16);
|
|
||||||
nsRefPtr<GLContextEGL> glContext =
|
nsRefPtr<GLContextEGL> glContext =
|
||||||
GLContextEGL::CreateEGLPBufferOffscreenContext(pbufferSize, aFormat, !usePBuffers);
|
GLContextEGL::CreateEGLPBufferOffscreenContext(gfxIntSize(16, 16), aFormat, true);
|
||||||
|
|
||||||
if (!glContext)
|
if (!glContext)
|
||||||
return nsnull;
|
return nsnull;
|
||||||
|
|
||||||
gfxIntSize fboSize = usePBuffers ? glContext->OffscreenActualSize() : aSize;
|
if (!glContext->ResizeOffscreenFBO(aSize, true))
|
||||||
if (!glContext->ResizeOffscreenFBO(fboSize, !usePBuffers))
|
|
||||||
return nsnull;
|
return nsnull;
|
||||||
|
|
||||||
return glContext.forget();
|
return glContext.forget();
|
||||||
|
|
Загрузка…
Ссылка в новой задаче