Don't call Init() twice. r?jrmuizel
draft
Don't call Init() twice. r?jrmuizel
From 322e5f7070f813eb810ed6465c82970cd85906a5 Mon Sep 17 00:00:00 2001
---
gfx/gl/GLContextProviderEGL.cpp | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
MozReview-Commit-ID: DnyE1zYP15C
--- a/gfx/gl/GLContextProviderEGL.cpp
+++ b/gfx/gl/GLContextProviderEGL.cpp
@@ -934,43 +934,37 @@ GLContextEGL::CreateEGLPBufferOffscreenC
SurfaceCaps configCaps;
EGLConfig config = ChooseConfig(&sEGLLibrary, flags, minCaps, &configCaps);
if (config == EGL_NO_CONFIG) {
NS_WARNING("Failed to find a compatible config.");
return nullptr;
}
- if (GLContext::ShouldSpew())
+ if (GLContext::ShouldSpew()) {
sEGLLibrary.DumpEGLConfig(config);
+ }
mozilla::gfx::IntSize pbSize(size);
EGLSurface surface = GLContextEGL::CreatePBufferSurfaceTryingPowerOfTwo(config,
LOCAL_EGL_NONE,
pbSize);
if (!surface) {
NS_WARNING("Failed to create PBuffer for context!");
return nullptr;
}
-
RefPtr<GLContextEGL> gl = GLContextEGL::CreateGLContext(flags, configCaps, nullptr, true,
config, surface);
if (!gl) {
NS_WARNING("Failed to create GLContext from PBuffer");
sEGLLibrary.fDestroySurface(sEGLLibrary.Display(), surface);
return nullptr;
}
- if (!gl->Init()) {
- NS_WARNING("Failed to initialize GLContext!");
- // GLContextEGL::dtor will destroy |surface| for us.
- return nullptr;
- }
-
return gl.forget();
}
/*static*/ already_AddRefed<GLContext>
GLContextProviderEGL::CreateHeadless(CreateContextFlags flags)
{
mozilla::gfx::IntSize dummySize = mozilla::gfx::IntSize(16, 16);
SurfaceCaps dummyCaps = SurfaceCaps::Any();