2017-05-16 Zan Dobersek <zdobersek@igalia.com>
+ [WPE] GLContextEGL::createWPEContext() should fall back to pbuffer-based contexts when offscreen target provides no native window
+ https://bugs.webkit.org/show_bug.cgi?id=172162
+
+ Reviewed by Carlos Garcia Campos.
+
+ When creating an offscreen GLContext, the underlying implementation might
+ provide a mock native window that's to be used as the window target upon
+ which a window-based GLContext should be created. But we should also support
+ falling back to pbuffer-based GLContexts when the underlying implementation
+ can't provide such mock targets.
+
+ * platform/graphics/egl/GLContextEGLWPE.cpp:
+ (WebCore::GLContextEGL::createWPEContext):
+
+2017-05-16 Zan Dobersek <zdobersek@igalia.com>
+
[GLib] Name more GSource-based RunLoop::Timers
https://bugs.webkit.org/show_bug.cgi?id=172158
std::unique_ptr<GLContextEGL> GLContextEGL::createWPEContext(PlatformDisplay& platformDisplay, EGLContext sharingContext)
{
auto offscreenTarget = downcast<PlatformDisplayWPE>(platformDisplay).createEGLOffscreenTarget();
- auto context = createWindowContext(offscreenTarget->nativeWindow(), platformDisplay, sharingContext);
+
+ std::unique_ptr<GLContextEGL> context;
+ if (offscreenTarget->nativeWindow())
+ context = createWindowContext(offscreenTarget->nativeWindow(), platformDisplay, sharingContext);
+ if (!context)
+ context = createPbufferContext(platformDisplay, sharingContext);
+
+ // FIXME: if available, we could also fallback to the surfaceless-based GLContext
+ // before falling back to the pbuffer-based one.
+
if (context)
context->m_wpeTarget = WTFMove(offscreenTarget);
return context;