Bug 1536002 - Add SharedGL check in RenderCompositorANGLE::Create() r=nical
authorsotaro <sotaro.ikeda.g@gmail.com>
Wed, 20 Mar 2019 11:52:26 +0000
changeset 465206 427ee196a86599aac675165d9a6f4c80ee046267
parent 465205 8918328d3461a3935fa78c381d643906b7256e12
child 465207 ae39470fc2168a2bdc0992601cc21b499224ebbb
push id112496
push usershindli@mozilla.com
push dateThu, 21 Mar 2019 04:37:39 +0000
treeherdermozilla-inbound@29476d3ca61d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1536002
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1536002 - Add SharedGL check in RenderCompositorANGLE::Create() r=nical Differential Revision: https://phabricator.services.mozilla.com/D23824
gfx/webrender_bindings/RenderCompositorANGLE.cpp
--- a/gfx/webrender_bindings/RenderCompositorANGLE.cpp
+++ b/gfx/webrender_bindings/RenderCompositorANGLE.cpp
@@ -27,16 +27,21 @@
 #include <dxgi1_2.h>
 
 namespace mozilla {
 namespace wr {
 
 /* static */
 UniquePtr<RenderCompositor> RenderCompositorANGLE::Create(
     RefPtr<widget::CompositorWidget>&& aWidget) {
+  if (!RenderThread::Get()->SharedGL()) {
+    gfxCriticalNote << "Failed to get shared GL context";
+    return nullptr;
+  }
+
   UniquePtr<RenderCompositorANGLE> compositor =
       MakeUnique<RenderCompositorANGLE>(std::move(aWidget));
   if (!compositor->Initialize()) {
     return nullptr;
   }
   return compositor;
 }