Bug 1344433 - Remove HasDXInterop(), but not HasDXInterop2(). - r=daoshengmu
MozReview-Commit-ID: 9OAvDSGuyca
--- a/gfx/gl/GLContextProviderWGL.cpp
+++ b/gfx/gl/GLContextProviderWGL.cpp
@@ -215,41 +215,36 @@ WGLLibrary::EnsureInitialized()
} else {
NS_ERROR("WGL supports ARB_create_context without supplying its functions.");
fCreateContextAttribs = nullptr;
}
}
////
- mHasDXInterop = HasExtension(extString, "WGL_NV_DX_interop");
- mHasDXInterop2 = HasExtension(extString, "WGL_NV_DX_interop2");
-
+ bool hasDXInterop2 = HasExtension(extString, "WGL_NV_DX_interop2");
if (gfxVars::DXInterop2Blocked() &&
!gfxPrefs::IgnoreDXInterop2Blacklist())
{
- mHasDXInterop2 = false;
+ hasDXInterop2 = false;
}
- if (mHasDXInterop || mHasDXInterop2) {
+ if (hasDXInterop2) {
if (!GLLibraryLoader::LoadSymbols(mOGLLibrary, &dxInteropSymbols[0],
lookupFunc))
{
NS_ERROR("WGL supports NV_DX_interop(2) without supplying its functions.");
fDXSetResourceShareHandle = nullptr;
fDXOpenDevice = nullptr;
fDXCloseDevice = nullptr;
fDXRegisterObject = nullptr;
fDXUnregisterObject = nullptr;
fDXObjectAccess = nullptr;
fDXLockObjects = nullptr;
fDXUnlockObjects = nullptr;
-
- mHasDXInterop = false;
- mHasDXInterop2 = false;
}
}
}
// reset back to the previous context, just in case
fMakeCurrent(curDC, curCtx);
if (mHasRobustness) {
--- a/gfx/gl/WGLLibrary.h
+++ b/gfx/gl/WGLLibrary.h
@@ -13,18 +13,16 @@ namespace gl {
class WGLLibrary
{
public:
WGLLibrary()
: mInitialized(false)
, mOGLLibrary(nullptr)
, mHasRobustness(false)
- , mHasDXInterop(false)
- , mHasDXInterop2(false)
, mWindow (0)
, mWindowDC(0)
, mWindowGLContext(0)
, mWindowPixelFormat(0)
{}
typedef HGLRC (GLAPIENTRY * PFNWGLCREATECONTEXTPROC) (HDC);
PFNWGLCREATECONTEXTPROC fCreateContext;
@@ -96,31 +94,28 @@ public:
// BOOL wglDXUnlockObjectsNV(HANDLE hDevice, GLint count, HANDLE* hObjects);
typedef BOOL (WINAPI * PFNWGLDXUNLOCKOBJECTSPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects);
PFNWGLDXUNLOCKOBJECTSPROC fDXUnlockObjects;
bool EnsureInitialized();
HWND CreateDummyWindow(HDC* aWindowDC = nullptr);
bool HasRobustness() const { return mHasRobustness; }
- bool HasDXInterop() const { return mHasDXInterop; }
- bool HasDXInterop2() const { return mHasDXInterop2; }
+ bool HasDXInterop2() const { return bool(fDXOpenDevice); }
bool IsInitialized() const { return mInitialized; }
HWND GetWindow() const { return mWindow; }
HDC GetWindowDC() const {return mWindowDC; }
HGLRC GetWindowGLContext() const {return mWindowGLContext; }
int GetWindowPixelFormat() const { return mWindowPixelFormat; }
PRLibrary* GetOGLLibrary() { return mOGLLibrary; }
private:
bool mInitialized;
PRLibrary* mOGLLibrary;
bool mHasRobustness;
- bool mHasDXInterop;
- bool mHasDXInterop2;
HWND mWindow;
HDC mWindowDC;
HGLRC mWindowGLContext;
int mWindowPixelFormat;
};