--- a/gfx/gl/GLContext.cpp
+++ b/gfx/gl/GLContext.cpp
@@ -395,19 +395,18 @@ ParseGLVersion(GLContext* gl, uint32_t*
MOZ_ASSERT(false, "Invalid minor version.");
return false;
}
*out_version = (uint32_t)majorVersion * 100 + (uint32_t)minorVersion * 10;
return true;
}
-GLContext::GLContext(const SurfaceCaps& caps,
- GLContext* sharedContext,
- bool isOffscreen)
+GLContext::GLContext(CreateContextFlags flags, const SurfaceCaps& caps,
+ GLContext* sharedContext, bool isOffscreen)
: mIsOffscreen(isOffscreen),
mContextLost(false),
mVersion(0),
mProfile(ContextProfile::Unknown),
mShadingLanguageVersion(0),
mVendor(GLVendor::Other),
mRenderer(GLRenderer::Other),
mTopError(LOCAL_GL_NO_ERROR),
--- a/gfx/gl/GLContext.h
+++ b/gfx/gl/GLContext.h
@@ -3170,17 +3170,17 @@ public:
ASSERT_SYMBOL_PRESENT(fResolveMultisampleFramebufferAPPLE);
mSymbols.fResolveMultisampleFramebufferAPPLE();
AFTER_GL_CALL;
}
// -----------------------------------------------------------------------------
// Constructor
protected:
- explicit GLContext(const SurfaceCaps& caps,
+ explicit GLContext(CreateContextFlags flags, const SurfaceCaps& caps,
GLContext* sharedContext = nullptr,
bool isOffscreen = false);
// -----------------------------------------------------------------------------
// Destructor
public:
virtual ~GLContext();
--- a/gfx/gl/GLContextCGL.h
+++ b/gfx/gl/GLContextCGL.h
@@ -23,18 +23,18 @@ namespace gl {
class GLContextCGL : public GLContext
{
friend class GLContextProviderCGL;
NSOpenGLContext *mContext;
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(GLContextCGL, override)
- GLContextCGL(const SurfaceCaps& caps, NSOpenGLContext* context,
- bool isOffscreen, ContextProfile profile);
+ GLContextCGL(CreateContextFlags flags, const SurfaceCaps& caps,
+ NSOpenGLContext* context, bool isOffscreen, ContextProfile profile);
~GLContextCGL();
virtual GLContextType GetContextType() const override { return GLContextType::CGL; }
static GLContextCGL* Cast(GLContext* gl) {
MOZ_ASSERT(gl->GetContextType() == GLContextType::CGL);
return static_cast<GLContextCGL*>(gl);
--- a/gfx/gl/GLContextEAGL.h
+++ b/gfx/gl/GLContextEAGL.h
@@ -18,19 +18,18 @@ namespace gl {
class GLContextEAGL : public GLContext
{
friend class GLContextProviderEAGL;
EAGLContext* const mContext;
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(GLContextEAGL, override)
- GLContextEAGL(const SurfaceCaps& caps, EAGLContext* context,
- GLContext* sharedContext,
- bool isOffscreen, ContextProfile profile);
+ GLContextEAGL(CreateContextFlags flags, const SurfaceCaps& caps, EAGLContext* context,
+ GLContext* sharedContext, bool isOffscreen, ContextProfile profile);
~GLContextEAGL();
virtual GLContextType GetContextType() const override {
return GLContextType::EAGL;
}
static GLContextEAGL* Cast(GLContext* gl) {
--- a/gfx/gl/GLContextEGL.h
+++ b/gfx/gl/GLContextEGL.h
@@ -23,17 +23,18 @@ class GLContextEGL : public GLContext
GLContextEGL *shareContext,
bool isOffscreen,
EGLConfig config,
EGLSurface surface,
nsACString& aFailureId);
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(GLContextEGL, override)
- GLContextEGL(const SurfaceCaps& caps,
+ GLContextEGL(CreateContextFlags flags,
+ const SurfaceCaps& caps,
GLContext* shareContext,
bool isOffscreen,
EGLConfig config,
EGLSurface surface,
EGLContext context);
~GLContextEGL();
--- a/gfx/gl/GLContextGLX.h
+++ b/gfx/gl/GLContextGLX.h
@@ -14,17 +14,18 @@
namespace mozilla {
namespace gl {
class GLContextGLX : public GLContext
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(GLContextGLX, override)
static already_AddRefed<GLContextGLX>
- CreateGLContext(const SurfaceCaps& caps,
+ CreateGLContext(CreateContextFlags flags,
+ const SurfaceCaps& caps,
GLContextGLX* shareContext,
bool isOffscreen,
Display* display,
GLXDrawable drawable,
GLXFBConfig cfg,
bool deleteDrawable,
gfxXlibSurface* pixmap = nullptr,
ContextProfile profile = ContextProfile::OpenGLCompatibility);
@@ -65,17 +66,18 @@ public:
// Undoes the effect of a drawable override.
bool RestoreDrawable();
virtual Maybe<gfx::IntSize> GetTargetSize() override;
private:
friend class GLContextProviderGLX;
- GLContextGLX(const SurfaceCaps& caps,
+ GLContextGLX(CreateContextFlags flags,
+ const SurfaceCaps& caps,
GLContext* shareContext,
bool isOffscreen,
Display *aDisplay,
GLXDrawable aDrawable,
GLXContext aContext,
bool aDeleteDrawable,
bool aDoubleBuffered,
gfxXlibSurface *aPixmap,
--- a/gfx/gl/GLContextProviderCGL.mm
+++ b/gfx/gl/GLContextProviderCGL.mm
@@ -65,19 +65,20 @@ public:
private:
bool mInitialized;
bool mUseDoubleBufferedWindows;
PRLibrary *mOGLLibrary;
};
CGLLibrary sCGLLibrary;
-GLContextCGL::GLContextCGL(const SurfaceCaps& caps, NSOpenGLContext* context,
- bool isOffscreen, ContextProfile profile)
- : GLContext(caps, nullptr, isOffscreen)
+GLContextCGL::GLContextCGL(CreateContextFlags flags, const SurfaceCaps& caps,
+ NSOpenGLContext* context, bool isOffscreen,
+ ContextProfile profile)
+ : GLContext(flags, caps, nullptr, isOffscreen)
, mContext(context)
{
SetProfileVersion(profile, 210);
}
GLContextCGL::~GLContextCGL()
{
MarkDestroyed();
@@ -258,18 +259,18 @@ GLContextProviderCGL::CreateForWindow(ns
}
// make the context transparent
GLint opaque = 0;
[context setValues:&opaque forParameter:NSOpenGLCPSurfaceOpacity];
SurfaceCaps caps = SurfaceCaps::ForRGBA();
ContextProfile profile = ContextProfile::OpenGLCompatibility;
- RefPtr<GLContextCGL> glContext = new GLContextCGL(caps, context, false,
- profile);
+ RefPtr<GLContextCGL> glContext = new GLContextCGL(CreateContextFlags::NONE, caps,
+ context, false, profile);
if (!glContext->Init()) {
glContext = nullptr;
[context release];
return nullptr;
}
return glContext.forget();
@@ -306,18 +307,18 @@ CreateOffscreenFBOContext(CreateContextF
}
}
if (!context) {
NS_WARNING("Failed to create NSOpenGLContext.");
return nullptr;
}
SurfaceCaps dummyCaps = SurfaceCaps::Any();
- RefPtr<GLContextCGL> glContext = new GLContextCGL(dummyCaps, context,
- true, profile);
+ RefPtr<GLContextCGL> glContext = new GLContextCGL(flags, dummyCaps, context, true,
+ profile);
if (gfxPrefs::GLMultithreaded()) {
CGLEnable(glContext->GetCGLContext(), kCGLCEMPEngine);
}
return glContext.forget();
}
already_AddRefed<GLContext>
--- a/gfx/gl/GLContextProviderEAGL.mm
+++ b/gfx/gl/GLContextProviderEAGL.mm
@@ -13,20 +13,20 @@
#include "mozilla/Preferences.h"
#include "GeckoProfiler.h"
#import <UIKit/UIKit.h>
namespace mozilla {
namespace gl {
-GLContextEAGL::GLContextEAGL(const SurfaceCaps& caps, EAGLContext* context,
- GLContext* sharedContext,
+GLContextEAGL::GLContextEAGL(CreateContextFlags flags, const SurfaceCaps& caps,
+ EAGLContext* context, GLContext* sharedContext,
bool isOffscreen, ContextProfile profile)
- : GLContext(caps, sharedContext, isOffscreen)
+ : GLContext(flags, caps, sharedContext, isOffscreen)
, mContext(context)
, mBackbufferRB(0)
, mBackbufferFB(0)
, mLayer(nil)
{
SetProfileVersion(ContextProfile::OpenGLES,
[context API] == kEAGLRenderingAPIOpenGLES3 ? 300 : 200);
}
@@ -161,17 +161,17 @@ GLContextProviderEAGL::CreateWrappingExi
static GLContextEAGL*
GetGlobalContextEAGL()
{
return static_cast<GLContextEAGL*>(GLContextProviderEAGL::GetGlobalContext());
}
static already_AddRefed<GLContext>
-CreateEAGLContext(bool aOffscreen, GLContextEAGL* sharedContext)
+CreateEAGLContext(CreateContextFlags flags, bool aOffscreen, GLContextEAGL* sharedContext)
{
EAGLRenderingAPI apis[] = { kEAGLRenderingAPIOpenGLES3, kEAGLRenderingAPIOpenGLES2 };
// Try to create a GLES3 context if we can, otherwise fall back to GLES2
EAGLContext* context = nullptr;
for (EAGLRenderingAPI api : apis) {
if (sharedContext) {
context = [[EAGLContext alloc] initWithAPI:api
@@ -186,48 +186,49 @@ CreateEAGLContext(bool aOffscreen, GLCon
}
if (!context) {
return nullptr;
}
SurfaceCaps caps = SurfaceCaps::ForRGBA();
ContextProfile profile = ContextProfile::OpenGLES;
- RefPtr<GLContextEAGL> glContext = new GLContextEAGL(caps, context,
+ RefPtr<GLContextEAGL> glContext = new GLContextEAGL(flags, caps, context,
sharedContext,
aOffscreen,
profile);
if (!glContext->Init()) {
glContext = nullptr;
return nullptr;
}
return glContext.forget();
}
already_AddRefed<GLContext>
GLContextProviderEAGL::CreateForWindow(nsIWidget* aWidget, bool aForceAccelerated)
{
- RefPtr<GLContext> glContext = CreateEAGLContext(false, GetGlobalContextEAGL());
+ RefPtr<GLContext> glContext = CreateEAGLContext(CreateContextFlags::NONE, false,
+ GetGlobalContextEAGL());
if (!glContext) {
return nullptr;
}
if (!GLContextEAGL::Cast(glContext)->AttachToWindow(aWidget)) {
return nullptr;
}
return glContext.forget();
}
already_AddRefed<GLContext>
GLContextProviderEAGL::CreateHeadless(CreateContextFlags flags)
{
- return CreateEAGLContext(true, GetGlobalContextEAGL());
+ return CreateEAGLContext(flags, true, GetGlobalContextEAGL());
}
already_AddRefed<GLContext>
GLContextProviderEAGL::CreateOffscreen(const mozilla::gfx::IntSize& size,
const SurfaceCaps& caps,
CreateContextFlags flags)
{
RefPtr<GLContext> glContext = CreateHeadless(flags);
--- a/gfx/gl/GLContextProviderEGL.cpp
+++ b/gfx/gl/GLContextProviderEGL.cpp
@@ -189,23 +189,24 @@ CreateSurfaceForWindow(nsIWidget* widget
#else
newSurface = sEGLLibrary.fCreateWindowSurface(EGL_DISPLAY(), config,
GET_NATIVE_WINDOW(widget), 0);
#endif
return newSurface;
}
GLContextEGL::GLContextEGL(
+ CreateContextFlags flags,
const SurfaceCaps& caps,
GLContext* shareContext,
bool isOffscreen,
EGLConfig config,
EGLSurface surface,
EGLContext context)
- : GLContext(caps, shareContext, isOffscreen)
+ : GLContext(flags, caps, shareContext, isOffscreen)
, mConfig(config)
, mSurface(surface)
, mContext(context)
, mSurfaceOverride(EGL_NO_SURFACE)
, mThebesSurface(nullptr)
, mBound(false)
, mIsPBuffer(false)
, mIsDoubleBuffered(false)
@@ -534,17 +535,17 @@ GLContextEGL::CreateGLContext(CreateCont
contextAttribs.Elements());
}
if (!context) {
aFailureId = NS_LITERAL_CSTRING("FEATURE_FAILURE_EGL_CREATE");
NS_WARNING("Failed to create EGLContext!");
return nullptr;
}
- RefPtr<GLContextEGL> glContext = new GLContextEGL(caps,
+ RefPtr<GLContextEGL> glContext = new GLContextEGL(flags, caps,
shareContext,
isOffscreen,
config,
surface,
context);
if (!glContext->Init()) {
aFailureId = NS_LITERAL_CSTRING("FEATURE_FAILURE_EGL_INIT");
@@ -753,17 +754,17 @@ GLContextProviderEGL::CreateWrappingExis
MOZ_CRASH("GFX: Failed to load EGL library 2!\n");
return nullptr;
}
if (aContext && aSurface) {
SurfaceCaps caps = SurfaceCaps::Any();
EGLConfig config = EGL_NO_CONFIG;
RefPtr<GLContextEGL> glContext =
- new GLContextEGL(caps,
+ new GLContextEGL(CreateContextFlags::NONE, caps,
nullptr, false,
config, (EGLSurface)aSurface, (EGLContext)aContext);
glContext->SetIsDoubleBuffered(true);
glContext->mOwnsContext = false;
return glContext.forget();
}
--- a/gfx/gl/GLContextProviderGLX.cpp
+++ b/gfx/gl/GLContextProviderGLX.cpp
@@ -774,17 +774,17 @@ GLXLibrary::xWaitVideoSync(int divisor,
{
BEFORE_GLX_CALL;
int result = xWaitVideoSyncInternal(divisor, remainder, count);
AFTER_GLX_CALL;
return result;
}
already_AddRefed<GLContextGLX>
-GLContextGLX::CreateGLContext(
+GLContextGLX::CreateGLContext(CreateContextFlags flags,
const SurfaceCaps& caps,
GLContextGLX* shareContext,
bool isOffscreen,
Display* display,
GLXDrawable drawable,
GLXFBConfig cfg,
bool deleteDrawable,
gfxXlibSurface* pixmap,
@@ -844,17 +844,17 @@ TRY_AGAIN_NO_SHARING:
display,
cfg,
LOCAL_GLX_RGBA_TYPE,
glxContext,
True);
}
if (context) {
- glContext = new GLContextGLX(caps,
+ glContext = new GLContextGLX(flags, caps,
shareContext,
isOffscreen,
display,
drawable,
context,
deleteDrawable,
db,
pixmap,
@@ -1001,27 +1001,28 @@ GLContextGLX::OverrideDrawable(GLXDrawab
bool
GLContextGLX::RestoreDrawable()
{
return mGLX->xMakeCurrent(mDisplay, mDrawable, mContext);
}
GLContextGLX::GLContextGLX(
+ CreateContextFlags flags,
const SurfaceCaps& caps,
GLContext* shareContext,
bool isOffscreen,
Display *aDisplay,
GLXDrawable aDrawable,
GLXContext aContext,
bool aDeleteDrawable,
bool aDoubleBuffered,
gfxXlibSurface *aPixmap,
ContextProfile profile)
- : GLContext(caps, shareContext, isOffscreen),//aDeleteDrawable ? true : false, aShareContext, ),
+ : GLContext(flags, caps, shareContext, isOffscreen),
mContext(aContext),
mDisplay(aDisplay),
mDrawable(aDrawable),
mDeleteDrawable(aDeleteDrawable),
mDoubleBuffered(aDoubleBuffered),
mGLX(&sGLXLibrary),
mPixmap(aPixmap),
mOwnsContext(true)
@@ -1065,17 +1066,17 @@ GLContextProviderGLX::CreateWrappingExis
{
if (!sGLXLibrary.EnsureInitialized()) {
return nullptr;
}
if (aContext && aSurface) {
SurfaceCaps caps = SurfaceCaps::Any();
RefPtr<GLContextGLX> glContext =
- new GLContextGLX(caps,
+ new GLContextGLX(CreateContextFlags::NONE, caps,
nullptr, // SharedContext
false, // Offscreen
(Display*)DefaultXDisplay(), // Display
(GLXDrawable)aSurface, (GLXContext)aContext,
false, // aDeleteDrawable,
true,
(gfxXlibSurface*)nullptr,
ContextProfile::OpenGLCompatibility);
@@ -1119,17 +1120,18 @@ GLContextProviderGLX::CreateForWindow(ns
&config, &visid))
{
return nullptr;
}
GLContextGLX *shareContext = GetGlobalContextGLX();
SurfaceCaps caps = SurfaceCaps::Any();
- RefPtr<GLContextGLX> glContext = GLContextGLX::CreateGLContext(caps,
+ RefPtr<GLContextGLX> glContext = GLContextGLX::CreateGLContext(CreateContextFlags::NONE,
+ caps,
shareContext,
false,
display,
window,
config,
false);
return glContext.forget();
@@ -1259,17 +1261,18 @@ GLContextGLX::FindFBConfigForWindow(Disp
}
}
NS_WARNING("[GLX] Couldn't find a FBConfig matching window visual");
return false;
}
static already_AddRefed<GLContextGLX>
-CreateOffscreenPixmapContext(const IntSize& size, const SurfaceCaps& minCaps, nsACString& aFailureId,
+CreateOffscreenPixmapContext(CreateContextFlags flags, const IntSize& size,
+ const SurfaceCaps& minCaps, nsACString& aFailureId,
ContextProfile profile = ContextProfile::OpenGLCompatibility)
{
GLXLibrary* glx = &sGLXLibrary;
if (!glx->EnsureInitialized())
return nullptr;
Display* display = DefaultXDisplay();
int screen = DefaultScreen(display);
@@ -1317,26 +1320,26 @@ CreateOffscreenPixmapContext(const IntSi
DONE_CREATING_PIXMAP:
bool serverError = xErrorHandler.SyncAndGetError(display);
if (error || serverError)
return nullptr;
GLContextGLX* shareContext = GetGlobalContextGLX();
- return GLContextGLX::CreateGLContext(minCaps, shareContext, true, display, pixmap,
- config, true, surface, profile);
+ return GLContextGLX::CreateGLContext(flags, minCaps, shareContext, true, display,
+ pixmap, config, true, surface, profile);
}
/*static*/ already_AddRefed<GLContext>
-GLContextProviderGLX::CreateHeadless(CreateContextFlags, nsACString& aFailureId)
+GLContextProviderGLX::CreateHeadless(CreateContextFlags flags, nsACString& aFailureId)
{
IntSize dummySize = IntSize(16, 16);
SurfaceCaps dummyCaps = SurfaceCaps::Any();
- return CreateOffscreenPixmapContext(dummySize, dummyCaps, aFailureId);
+ return CreateOffscreenPixmapContext(flags, dummySize, dummyCaps, aFailureId);
}
/*static*/ already_AddRefed<GLContext>
GLContextProviderGLX::CreateOffscreen(const IntSize& size,
const SurfaceCaps& minCaps,
CreateContextFlags flags,
nsACString& aFailureId)
{
@@ -1348,17 +1351,18 @@ GLContextProviderGLX::CreateOffscreen(co
}
ContextProfile profile = ContextProfile::OpenGLCore;
if (flags & CreateContextFlags::REQUIRE_COMPAT_PROFILE) {
profile = ContextProfile::OpenGLCompatibility;
}
RefPtr<GLContext> gl;
- gl = CreateOffscreenPixmapContext(size, minBackbufferCaps, aFailureId, profile);
+ gl = CreateOffscreenPixmapContext(flags, size, minBackbufferCaps, aFailureId,
+ profile);
if (!gl)
return nullptr;
if (!gl->InitOffscreen(size, minCaps)) {
aFailureId = NS_LITERAL_CSTRING("FEATURE_FAILURE_GLX_INIT");
return nullptr;
}
--- a/gfx/gl/GLContextProviderWGL.cpp
+++ b/gfx/gl/GLContextProviderWGL.cpp
@@ -261,44 +261,44 @@ WGLLibrary::EnsureInitialized()
mInitialized = false;
return false;
}
reporter.SetSuccessful();
return true;
}
-GLContextWGL::GLContextWGL(
+GLContextWGL::GLContextWGL(CreateContextFlags flags,
const SurfaceCaps& caps,
GLContext* sharedContext,
bool isOffscreen,
HDC aDC,
HGLRC aContext,
HWND aWindow)
- : GLContext(caps, sharedContext, isOffscreen),
+ : GLContext(flags, caps, sharedContext, isOffscreen),
mDC(aDC),
mContext(aContext),
mWnd(aWindow),
mPBuffer(nullptr),
mPixelFormat(0),
mIsDoubleBuffered(false)
{
// See 899855
SetProfileVersion(ContextProfile::OpenGLCompatibility, 200);
}
-GLContextWGL::GLContextWGL(
+GLContextWGL::GLContextWGL(CreateContextFlags flags,
const SurfaceCaps& caps,
GLContext* sharedContext,
bool isOffscreen,
HANDLE aPbuffer,
HDC aDC,
HGLRC aContext,
int aPixelFormat)
- : GLContext(caps, sharedContext, isOffscreen),
+ : GLContext(flags, caps, sharedContext, isOffscreen),
mDC(aDC),
mContext(aContext),
mWnd(nullptr),
mPBuffer(aPbuffer),
mPixelFormat(aPixelFormat),
mIsDoubleBuffered(false)
{
// See 899855
@@ -480,32 +480,33 @@ GLContextProviderWGL::CreateForWindow(ns
}
}
if (!context) {
return nullptr;
}
SurfaceCaps caps = SurfaceCaps::ForRGBA();
- RefPtr<GLContextWGL> glContext = new GLContextWGL(caps,
+ RefPtr<GLContextWGL> glContext = new GLContextWGL(CreateContextFlags::NONE,
+ caps,
shareContext,
false,
dc,
context);
if (!glContext->Init()) {
return nullptr;
}
glContext->SetIsDoubleBuffered(true);
return glContext.forget();
}
static already_AddRefed<GLContextWGL>
-CreatePBufferOffscreenContext(const IntSize& aSize,
+CreatePBufferOffscreenContext(CreateContextFlags flags, const IntSize& aSize,
GLContextWGL *aShareContext)
{
WGLLibrary& wgl = sWGLLib;
#define A1(_a,_x) do { _a.AppendElement(_x); } while(0)
#define A2(_a,_x,_y) do { _a.AppendElement(_x); _a.AppendElement(_y); } while(0)
nsTArray<int> attrs;
@@ -575,17 +576,17 @@ CreatePBufferOffscreenContext(const IntS
}
if (!context) {
wgl.fDestroyPbuffer(pbuffer);
return nullptr;
}
SurfaceCaps dummyCaps = SurfaceCaps::Any();
- RefPtr<GLContextWGL> glContext = new GLContextWGL(dummyCaps,
+ RefPtr<GLContextWGL> glContext = new GLContextWGL(flags, dummyCaps,
aShareContext,
true,
pbuffer,
pbdc,
context,
chosenFormat);
return glContext.forget();
@@ -628,39 +629,40 @@ CreateWindowOffscreenContext()
}
}
if (!context) {
return nullptr;
}
SurfaceCaps caps = SurfaceCaps::ForRGBA();
- RefPtr<GLContextWGL> glContext = new GLContextWGL(caps,
+ RefPtr<GLContextWGL> glContext = new GLContextWGL(CreateContextFlags::NONE, caps,
shareContext, true,
dc, context, win);
return glContext.forget();
}
/*static*/ already_AddRefed<GLContext>
-GLContextProviderWGL::CreateHeadless(CreateContextFlags, nsACString& aFailureId)
+GLContextProviderWGL::CreateHeadless(CreateContextFlags flags, nsACString& aFailureId)
{
if (!sWGLLib.EnsureInitialized()) {
return nullptr;
}
RefPtr<GLContextWGL> glContext;
// Always try to create a pbuffer context first, because we
// want the context isolation.
if (sWGLLib.fCreatePbuffer &&
sWGLLib.fChoosePixelFormat)
{
IntSize dummySize = IntSize(16, 16);
- glContext = CreatePBufferOffscreenContext(dummySize, GetGlobalContextWGL());
+ glContext = CreatePBufferOffscreenContext(flags, dummySize,
+ GetGlobalContextWGL());
}
// If it failed, then create a window context and use a FBO.
if (!glContext) {
glContext = CreateWindowOffscreenContext();
}
if (!glContext ||
--- a/gfx/gl/GLContextTypes.h
+++ b/gfx/gl/GLContextTypes.h
@@ -49,15 +49,17 @@ enum class CreateContextFlags : int8_t {
NONE = 0,
REQUIRE_COMPAT_PROFILE = 1 << 0,
// Force the use of hardware backed GL, don't allow software implementations.
FORCE_ENABLE_HARDWARE = 1 << 1,
/* Don't force discrete GPU to be used (if applicable) */
ALLOW_OFFLINE_RENDERER = 1 << 2,
// Ask for ES3 if possible
PREFER_ES3 = 1 << 3,
+
+ NO_VALIDATION = 1 << 4,
};
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(CreateContextFlags)
} /* namespace gl */
} /* namespace mozilla */
#endif /* GLCONTEXT_TYPES_H_ */
--- a/gfx/gl/GLContextWGL.h
+++ b/gfx/gl/GLContextWGL.h
@@ -13,25 +13,27 @@
namespace mozilla {
namespace gl {
class GLContextWGL : public GLContext
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(GLContextWGL, override)
// From Window: (possibly for offscreen!)
- GLContextWGL(const SurfaceCaps& caps,
+ GLContextWGL(CreateContextFlags flags,
+ const SurfaceCaps& caps,
GLContext* sharedContext,
bool isOffscreen,
HDC aDC,
HGLRC aContext,
HWND aWindow = nullptr);
// From PBuffer
- GLContextWGL(const SurfaceCaps& caps,
+ GLContextWGL(CreateContextFlags flags,
+ const SurfaceCaps& caps,
GLContext* sharedContext,
bool isOffscreen,
HANDLE aPbuffer,
HDC aDC,
HGLRC aContext,
int aPixelFormat);
~GLContextWGL();
--- a/gfx/thebes/gfxPlatformGtk.cpp
+++ b/gfx/thebes/gfxPlatformGtk.cpp
@@ -85,17 +85,17 @@ gfxPlatformGtk::gfxPlatformGtk()
sUseFcFontList = mozilla::Preferences::GetBool("gfx.font_rendering.fontconfig.fontlist.enabled");
if (!sUseFcFontList && !sFontconfigUtils) {
sFontconfigUtils = gfxFontconfigUtils::GetFontconfigUtils();
}
mMaxGenericSubstitutions = UNINITIALIZED_VALUE;
#ifdef MOZ_X11
- sUseXRender = (GDK_IS_X11_DISPLAY(gdk_display_get_default())) ?
+ sUseXRender = (GDK_IS_X11_DISPLAY(gdk_display_get_default())) ?
mozilla::Preferences::GetBool("gfx.xrender.enabled") : false;
#endif
uint32_t canvasMask = BackendTypeBit(BackendType::CAIRO) | BackendTypeBit(BackendType::SKIA);
uint32_t contentMask = BackendTypeBit(BackendType::CAIRO) | BackendTypeBit(BackendType::SKIA);
InitBackendPrefs(canvasMask, BackendType::CAIRO,
contentMask, BackendType::CAIRO);
}
@@ -283,17 +283,17 @@ gfxPlatformGtk::LookupLocalFont(const ns
return pfl->LookupLocalFont(aFontName, aWeight, aStretch,
aStyle);
}
return gfxPangoFontGroup::NewFontEntry(aFontName, aWeight,
aStretch, aStyle);
}
-gfxFontEntry*
+gfxFontEntry*
gfxPlatformGtk::MakePlatformFont(const nsAString& aFontName,
uint16_t aWeight,
int16_t aStretch,
uint8_t aStyle,
const uint8_t* aFontData,
uint32_t aLength)
{
if (sUseFcFontList) {
@@ -432,17 +432,17 @@ gfxPlatformGtk::GetPlatformCMSOutputProf
Atom edidAtom, iccAtom;
Display *dpy = GDK_DISPLAY_XDISPLAY(display);
// In xpcshell tests, we never initialize X and hence don't have a Display.
// In this case, there's no output colour management to be done, so we just
// return with nullptr.
if (!dpy)
return;
-
+
Window root = gdk_x11_get_default_root_xwindow();
Atom retAtom;
int retFormat;
unsigned long retLength, retAfter;
unsigned char *retProperty ;
iccAtom = XInternAtom(dpy, ICC_PROFILE_ATOM_NAME, TRUE);
@@ -673,16 +673,17 @@ public:
int visid;
if (!gl::GLContextGLX::FindFBConfigForWindow(mXDisplay, screen, root,
&cfgs, &config, &visid)) {
lock.NotifyAll();
return;
}
mGLContext = gl::GLContextGLX::CreateGLContext(
+ gl::CreateContextFlags::NONE,
gl::SurfaceCaps::Any(),
nullptr,
false,
mXDisplay,
root,
config,
false);