Don't call Init() twice. r?jrmuizel draft
authorJeff Gilbert <jdashg@gmail.com>
Tue, 12 Apr 2016 13:56:41 -0700
changeset 354501 0860a44f78a9a03da39fb552fc650219de79f6ef
parent 354500 3cd5b67d7916a1aadbd43f5f43f1c57c211f9306
child 354502 b1d4c37a188ddf1b8e37c9ec914821cb48577ad7
push id16095
push userjgilbert@mozilla.com
push dateThu, 21 Apr 2016 00:49:36 +0000
reviewersjrmuizel
milestone48.0a1
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
gfx/gl/GLContextProviderEGL.cpp
--- 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();