Bug 1396521 - Check that we have ANGLE exts for blitting from d3d. - r=daoshengmu draft
authorJeff Gilbert <jgilbert@mozilla.com>
Tue, 05 Sep 2017 19:21:55 -0700
changeset 659433 5f06c0dd924883cb046642182ff2d48e50a8795d
parent 659432 34767394af0d91775da40b54e2f5a21083631c3f
child 729992 ebb45cdb413e3a875062c94fff77f049068891df
push id78131
push userbmo:jgilbert@mozilla.com
push dateWed, 06 Sep 2017 02:22:29 +0000
reviewersdaoshengmu
bugs1396521
milestone57.0a1
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(NV_stream_consumer_gltexture_yuv) ||
+        !egl.IsExtensionSupported(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,