Bug 1396521 - Check that we have ANGLE exts for blitting from d3d. - r=daoshengmu
authorJeff Gilbert <jgilbert@mozilla.com>
Tue, 05 Sep 2017 19:21:55 -0700
changeset 428623 e9997d3ed86127e8a6e6827e67762db5a722f3c9
parent 428622 565627232eddd8604e629087a57dc1c0298c0be9
child 428624 c105574f5739c8582a8bfdd12b2cb945bff288d6
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdaoshengmu
bugs1396521
milestone57.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 1396521 - Check that we have ANGLE exts for blitting from d3d. - r=daoshengmu MozReview-Commit-ID: 3eto0R2Cjwa
gfx/gl/GLBlitHelperD3D.cpp
--- a/gfx/gl/GLBlitHelperD3D.cpp
+++ b/gfx/gl/GLBlitHelperD3D.cpp
@@ -19,16 +19,22 @@
 namespace mozilla {
 namespace gl {
 
 static EGLStreamKHR
 StreamFromD3DTexture(ID3D11Texture2D* const texD3D,
                      const EGLAttrib* const postAttribs)
 {
     auto& egl = sEGLLibrary;
+    if (!egl.IsExtensionSupported(GLLibraryEGL::NV_stream_consumer_gltexture_yuv) ||
+        !egl.IsExtensionSupported(GLLibraryEGL::ANGLE_stream_producer_d3d_texture_nv12))
+    {
+        return 0;
+    }
+
     const auto& display = egl.Display();
     const auto stream = egl.fCreateStreamKHR(display, nullptr);
     MOZ_ASSERT(stream);
     if (!stream)
         return 0;
     bool ok = true;
     MOZ_ALWAYS_TRUE( ok &= bool(egl.fStreamConsumerGLTextureExternalAttribsNV(display,
                                                                               stream,