Bug 1396521 - Check that we have ANGLE exts for blitting from d3d. - r=daoshengmu
MozReview-Commit-ID: 3eto0R2Cjwa
--- 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,