<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[265738] releases/WebKitGTK/webkit-2.28/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/265738">265738</a></dd>
<dt>Author</dt> <dd>aperez@igalia.com</dd>
<dt>Date</dt> <dd>2020-08-15 13:26:15 -0700 (Sat, 15 Aug 2020)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merged <a href="http://trac.webkit.org/projects/webkit/changeset/264986">r264986</a> - [GTK] Crash in Nicosia::GC3DLayer::makeContextCurrent due to failure in EGL display creation
https://bugs.webkit.org/show_bug.cgi?id=201507

Reviewed by Carlos Garcia Campos.

Ensure that EGL context and display creation failures are always
logged using RELEASE_LOG_INFO(), even for intermediate failures for
which a fallback will be tried next, in order to ease diagnosis of
related issues. Failure to create contexts at the end of the public
methods ::createContext() and ::createSharingContext() is still
logged with WTFLogAlways() to write a notice to standard error, and
let users/developers know that something failed and checking the
complete logs (e.g. with "journalctl" on Linux) may reveal more
information.

This also replaces the chains of "if" statements with a single
"switch" on the PlatformDisplay::Type enum, which makes the code
easier to follow and should be more robust as well.

No new tests needed.

* platform/graphics/egl/GLContextEGL.cpp:
(WebCore::GLContextEGL::getEGLConfig):
(WebCore::GLContextEGL::createWindowContext):
(WebCore::GLContextEGL::createSurfacelessContext):
(WebCore::GLContextEGL::createContext):
(WebCore::GLContextEGL::createSharingContext):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit228SourceWebCoreChangeLog">releases/WebKitGTK/webkit-2.28/Source/WebCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit228SourceWebCoreplatformgraphicseglGLContextEGLcpp">releases/WebKitGTK/webkit-2.28/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit228SourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.28/Source/WebCore/ChangeLog (265737 => 265738)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.28/Source/WebCore/ChangeLog  2020-08-15 20:26:09 UTC (rev 265737)
+++ releases/WebKitGTK/webkit-2.28/Source/WebCore/ChangeLog     2020-08-15 20:26:15 UTC (rev 265738)
</span><span class="lines">@@ -1,3 +1,33 @@
</span><ins>+2020-07-28  Adrian Perez de Castro  <aperez@igalia.com>
+
+        [GTK] Crash in Nicosia::GC3DLayer::makeContextCurrent due to failure in EGL display creation
+        https://bugs.webkit.org/show_bug.cgi?id=201507
+
+        Reviewed by Carlos Garcia Campos.
+
+        Ensure that EGL context and display creation failures are always
+        logged using RELEASE_LOG_INFO(), even for intermediate failures for
+        which a fallback will be tried next, in order to ease diagnosis of
+        related issues. Failure to create contexts at the end of the public
+        methods ::createContext() and ::createSharingContext() is still
+        logged with WTFLogAlways() to write a notice to standard error, and
+        let users/developers know that something failed and checking the
+        complete logs (e.g. with "journalctl" on Linux) may reveal more
+        information.
+
+        This also replaces the chains of "if" statements with a single
+        "switch" on the PlatformDisplay::Type enum, which makes the code
+        easier to follow and should be more robust as well.
+
+        No new tests needed.
+
+        * platform/graphics/egl/GLContextEGL.cpp:
+        (WebCore::GLContextEGL::getEGLConfig):
+        (WebCore::GLContextEGL::createWindowContext):
+        (WebCore::GLContextEGL::createSurfacelessContext):
+        (WebCore::GLContextEGL::createContext):
+        (WebCore::GLContextEGL::createSharingContext):
+
</ins><span class="cx"> 2020-04-03  Jack Lee  <shihchieh_lee@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Protect contentFrame in SubframeLoader::loadOrRedirectSubframe with RefPtr.
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit228SourceWebCoreplatformgraphicseglGLContextEGLcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.28/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp (265737 => 265738)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.28/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp     2020-08-15 20:26:09 UTC (rev 265737)
+++ releases/WebKitGTK/webkit-2.28/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp        2020-08-15 20:26:15 UTC (rev 265738)
</span><span class="lines">@@ -22,6 +22,7 @@
</span><span class="cx"> #if USE(EGL)
</span><span class="cx"> 
</span><span class="cx"> #include "GraphicsContextGLOpenGL.h"
</span><ins>+#include "Logging.h"
</ins><span class="cx"> #include "PlatformDisplay.h"
</span><span class="cx"> 
</span><span class="cx"> #if USE(LIBEPOXY)
</span><span class="lines">@@ -57,8 +58,10 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> #if USE(OPENGL_ES)
</span><ins>+static const char* gEGLAPIName = "OpenGL ES";
</ins><span class="cx"> static const EGLenum gEGLAPIVersion = EGL_OPENGL_ES_API;
</span><span class="cx"> #else
</span><ins>+static const char* gEGLAPIName = "OpenGL";
</ins><span class="cx"> static const EGLenum gEGLAPIVersion = EGL_OPENGL_API;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -132,13 +135,17 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     EGLint count;
</span><del>-    if (!eglChooseConfig(display, attributeList, nullptr, 0, &count))
</del><ins>+    if (!eglChooseConfig(display, attributeList, nullptr, 0, &count)) {
+        RELEASE_LOG_INFO(Compositing, "Cannot get count of available EGL configurations: %s.", lastErrorString());
</ins><span class="cx">         return false;
</span><ins>+    }
</ins><span class="cx"> 
</span><span class="cx">     EGLint numberConfigsReturned;
</span><span class="cx">     Vector<EGLConfig> configs(count);
</span><del>-    if (!eglChooseConfig(display, attributeList, reinterpret_cast<EGLConfig*>(configs.data()), count, &numberConfigsReturned) || !numberConfigsReturned)
</del><ins>+    if (!eglChooseConfig(display, attributeList, reinterpret_cast<EGLConfig*>(configs.data()), count, &numberConfigsReturned) || !numberConfigsReturned) {
+        RELEASE_LOG_INFO(Compositing, "Cannot get available EGL configurations: %s.", lastErrorString());
</ins><span class="cx">         return false;
</span><ins>+    }
</ins><span class="cx"> 
</span><span class="cx">     auto index = configs.findMatching([&](EGLConfig value) {
</span><span class="cx">         EGLint redSize, greenSize, blueSize, alphaSize;
</span><span class="lines">@@ -154,6 +161,8 @@
</span><span class="cx">         *config = configs[index];
</span><span class="cx">         return true;
</span><span class="cx">     }
</span><ins>+
+    RELEASE_LOG_INFO(Compositing, "Could not find suitable EGL configuration out of %zu checked.", configs.size());
</ins><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -162,37 +171,42 @@
</span><span class="cx">     EGLDisplay display = platformDisplay.eglDisplay();
</span><span class="cx">     EGLConfig config;
</span><span class="cx">     if (!getEGLConfig(display, &config, WindowSurface)) {
</span><del>-        WTFLogAlways("Cannot obtain EGL window context configuration: %s\n", lastErrorString());
</del><ins>+        RELEASE_LOG_INFO(Compositing, "Cannot obtain EGL window context configuration: %s\n", lastErrorString());
</ins><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     EGLContext context = createContextForEGLVersion(platformDisplay, config, sharingContext);
</span><span class="cx">     if (context == EGL_NO_CONTEXT) {
</span><del>-        WTFLogAlways("Cannot create EGL window context: %s\n", lastErrorString());
</del><ins>+        RELEASE_LOG_INFO(Compositing, "Cannot create EGL window context: %s\n", lastErrorString());
</ins><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    EGLSurface surface = EGL_NO_SURFACE;
-#if PLATFORM(GTK)
</del><ins>+    EGLSurface surface;
+    switch (platformDisplay.type()) {
</ins><span class="cx"> #if PLATFORM(X11)
</span><del>-    if (platformDisplay.type() == PlatformDisplay::Type::X11)
</del><ins>+    case PlatformDisplay::Type::X11:
</ins><span class="cx">         surface = createWindowSurfaceX11(display, config, window);
</span><ins>+        break;
</ins><span class="cx"> #endif
</span><span class="cx"> #if PLATFORM(WAYLAND)
</span><del>-    if (platformDisplay.type() == PlatformDisplay::Type::Wayland)
</del><ins>+    case PlatformDisplay::Type::Wayland:
</ins><span class="cx">         surface = createWindowSurfaceWayland(display, config, window);
</span><ins>+        break;
</ins><span class="cx"> #endif
</span><del>-#endif
-
</del><span class="cx"> #if USE(WPE_RENDERER)
</span><del>-    if (platformDisplay.type() == PlatformDisplay::Type::WPE)
</del><ins>+    case PlatformDisplay::Type::WPE:
</ins><span class="cx">         surface = createWindowSurfaceWPE(display, config, window);
</span><del>-#else
-    if (surface == EGL_NO_SURFACE)
</del><ins>+        break;
+#endif // USE(WPE_RENDERER)
+    }
+
+    if (surface == EGL_NO_SURFACE) {
+        RELEASE_LOG_INFO(Compositing, "Cannot create EGL window surface: %s. Retrying with fallback.", lastErrorString());
</ins><span class="cx">         surface = eglCreateWindowSurface(display, config, static_cast<EGLNativeWindowType>(window), nullptr);
</span><del>-#endif
</del><ins>+    }
+
</ins><span class="cx">     if (surface == EGL_NO_SURFACE) {
</span><del>-        WTFLogAlways("Cannot create EGL window surface: %s\n", lastErrorString());
</del><ins>+        RELEASE_LOG_INFO(Compositing, "Cannot create EGL window surface: %s\n", lastErrorString());
</ins><span class="cx">         eglDestroyContext(display, context);
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="lines">@@ -205,13 +219,13 @@
</span><span class="cx">     EGLDisplay display = platformDisplay.eglDisplay();
</span><span class="cx">     EGLConfig config;
</span><span class="cx">     if (!getEGLConfig(display, &config, PbufferSurface)) {
</span><del>-        WTFLogAlways("Cannot obtain EGL Pbuffer configuration: %s\n", lastErrorString());
</del><ins>+        RELEASE_LOG_INFO(Compositing, "Cannot obtain EGL Pbuffer configuration: %s\n", lastErrorString());
</ins><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     EGLContext context = createContextForEGLVersion(platformDisplay, config, sharingContext);
</span><span class="cx">     if (context == EGL_NO_CONTEXT) {
</span><del>-        WTFLogAlways("Cannot create EGL Pbuffer context: %s\n", lastErrorString());
</del><ins>+        RELEASE_LOG_INFO(Compositing, "Cannot create EGL Pbuffer context: %s\n", lastErrorString());
</ins><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -218,7 +232,7 @@
</span><span class="cx">     static const int pbufferAttributes[] = { EGL_WIDTH, 1, EGL_HEIGHT, 1, EGL_NONE };
</span><span class="cx">     EGLSurface surface = eglCreatePbufferSurface(display, config, pbufferAttributes);
</span><span class="cx">     if (surface == EGL_NO_SURFACE) {
</span><del>-        WTFLogAlways("Cannot create EGL Pbuffer surface: %s\n", lastErrorString());
</del><ins>+        RELEASE_LOG_INFO(Compositing, "Cannot create EGL Pbuffer surface: %s\n", lastErrorString());
</ins><span class="cx">         eglDestroyContext(display, context);
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="lines">@@ -230,23 +244,25 @@
</span><span class="cx"> {
</span><span class="cx">     EGLDisplay display = platformDisplay.eglDisplay();
</span><span class="cx">     if (display == EGL_NO_DISPLAY) {
</span><del>-        WTFLogAlways("Cannot create surfaceless EGL context: invalid display (last error: %s)\n", lastErrorString());
</del><ins>+        RELEASE_LOG_INFO(Compositing, "Cannot create surfaceless EGL context: invalid display (last error: %s)\n", lastErrorString());
</ins><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     const char* extensions = eglQueryString(display, EGL_EXTENSIONS);
</span><del>-    if (!GLContext::isExtensionSupported(extensions, "EGL_KHR_surfaceless_context") && !GLContext::isExtensionSupported(extensions, "EGL_KHR_surfaceless_opengl"))
</del><ins>+    if (!GLContext::isExtensionSupported(extensions, "EGL_KHR_surfaceless_context") && !GLContext::isExtensionSupported(extensions, "EGL_KHR_surfaceless_opengl")) {
+        RELEASE_LOG_INFO(Compositing, "Cannot create surfaceless EGL context: required extensions missing.");
</ins><span class="cx">         return nullptr;
</span><ins>+    }
</ins><span class="cx"> 
</span><span class="cx">     EGLConfig config;
</span><span class="cx">     if (!getEGLConfig(display, &config, Surfaceless)) {
</span><del>-        WTFLogAlways("Cannot obtain EGL surfaceless configuration: %s\n", lastErrorString());
</del><ins>+        RELEASE_LOG_INFO(Compositing, "Cannot obtain EGL surfaceless configuration: %s\n", lastErrorString());
</ins><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     EGLContext context = createContextForEGLVersion(platformDisplay, config, sharingContext);
</span><span class="cx">     if (context == EGL_NO_CONTEXT) {
</span><del>-        WTFLogAlways("Cannot create EGL surfaceless context: %s\n", lastErrorString());
</del><ins>+        RELEASE_LOG_INFO(Compositing, "Cannot create EGL surfaceless context: %s\n", lastErrorString());
</ins><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -261,11 +277,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (eglBindAPI(gEGLAPIVersion) == EGL_FALSE) {
</span><del>-#if USE(OPENGL_ES)
-        WTFLogAlways("Cannot create EGL context: error binding OpenGL ES API (%s)\n", lastErrorString());
-#else
-        WTFLogAlways("Cannot create EGL context: error binding OpenGL API (%s)\n", lastErrorString());
-#endif
</del><ins>+        WTFLogAlways("Cannot create EGL context: error binding %s API (%s)\n", gEGLAPIName, lastErrorString());
</ins><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -274,22 +286,33 @@
</span><span class="cx">     if (!context)
</span><span class="cx">         context = createSurfacelessContext(platformDisplay, eglSharingContext);
</span><span class="cx">     if (!context) {
</span><ins>+        switch (platformDisplay.type()) {
</ins><span class="cx"> #if PLATFORM(X11)
</span><del>-        if (platformDisplay.type() == PlatformDisplay::Type::X11)
</del><ins>+        case PlatformDisplay::Type::X11:
</ins><span class="cx">             context = createPixmapContext(platformDisplay, eglSharingContext);
</span><ins>+            break;
</ins><span class="cx"> #endif
</span><span class="cx"> #if PLATFORM(WAYLAND)
</span><del>-        if (platformDisplay.type() == PlatformDisplay::Type::Wayland)
</del><ins>+        case PlatformDisplay::Type::Wayland:
</ins><span class="cx">             context = createWaylandContext(platformDisplay, eglSharingContext);
</span><ins>+            break;
</ins><span class="cx"> #endif
</span><span class="cx"> #if USE(WPE_RENDERER)
</span><del>-        if (platformDisplay.type() == PlatformDisplay::Type::WPE)
</del><ins>+        case PlatformDisplay::Type::WPE:
</ins><span class="cx">             context = createWPEContext(platformDisplay, eglSharingContext);
</span><ins>+            break;
</ins><span class="cx"> #endif
</span><ins>+        }
</ins><span class="cx">     }
</span><del>-    if (!context)
</del><ins>+    if (!context) {
+        RELEASE_LOG_INFO(Compositing, "Could not create platform context: %s. Using Pbuffer as fallback.", lastErrorString());
</ins><span class="cx">         context = createPbufferContext(platformDisplay, eglSharingContext);
</span><ins>+        if (!context)
+            RELEASE_LOG_INFO(Compositing, "Could not create Pbuffer context: %s.", lastErrorString());
+    }
</ins><span class="cx"> 
</span><ins>+    if (!context)
+        WTFLogAlways("Could not create EGL context.");
</ins><span class="cx">     return context;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -301,32 +324,39 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (eglBindAPI(gEGLAPIVersion) == EGL_FALSE) {
</span><del>-#if USE(OPENGL_ES)
-        WTFLogAlways("Cannot create EGL sharing context: error binding OpenGL ES API (%s)\n", lastErrorString());
-#else
-        WTFLogAlways("Cannot create EGL sharing context: error binding OpenGL API (%s)\n", lastErrorString());
-#endif
</del><ins>+        WTFLogAlways("Cannot create EGL sharing context: error binding %s API (%s)\n", gEGLAPIName, lastErrorString());
</ins><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     auto context = createSurfacelessContext(platformDisplay);
</span><span class="cx">     if (!context) {
</span><ins>+        switch (platformDisplay.type()) {
</ins><span class="cx"> #if PLATFORM(X11)
</span><del>-        if (platformDisplay.type() == PlatformDisplay::Type::X11)
</del><ins>+        case PlatformDisplay::Type::X11:
</ins><span class="cx">             context = createPixmapContext(platformDisplay);
</span><ins>+            break;
</ins><span class="cx"> #endif
</span><span class="cx"> #if PLATFORM(WAYLAND)
</span><del>-        if (platformDisplay.type() == PlatformDisplay::Type::Wayland)
</del><ins>+        case PlatformDisplay::Type::Wayland:
</ins><span class="cx">             context = createWaylandContext(platformDisplay);
</span><ins>+            break;
</ins><span class="cx"> #endif
</span><span class="cx"> #if USE(WPE_RENDERER)
</span><del>-        if (platformDisplay.type() == PlatformDisplay::Type::WPE)
</del><ins>+        case PlatformDisplay::Type::WPE:
</ins><span class="cx">             context = createWPEContext(platformDisplay);
</span><ins>+            break;
</ins><span class="cx"> #endif
</span><ins>+        }
</ins><span class="cx">     }
</span><del>-    if (!context)
</del><ins>+    if (!context) {
+        RELEASE_LOG_INFO(Compositing, "Could not create platform context: %s. Using Pbuffer as fallback.", lastErrorString());
</ins><span class="cx">         context = createPbufferContext(platformDisplay);
</span><ins>+        if (!context)
+            RELEASE_LOG_INFO(Compositing, "Could not create Pbuffer context: %s.", lastErrorString());
+    }
</ins><span class="cx"> 
</span><ins>+    if (!context)
+        WTFLogAlways("Could not create EGL sharing context.");
</ins><span class="cx">     return context;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>