mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 978414 - Mark GLContext virtuals const and MOZ_OVERRIDE where appropriate. - r=bjacob
This commit is contained in:
parent
f4686ac699
commit
288e6d233c
@ -162,7 +162,7 @@ public:
|
||||
* Returns true if the context is using ANGLE. This should only be overridden
|
||||
* for an ANGLE implementation.
|
||||
*/
|
||||
virtual bool IsANGLE() {
|
||||
virtual bool IsANGLE() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -273,13 +273,11 @@ public:
|
||||
/**
|
||||
* If this context is double-buffered, returns TRUE.
|
||||
*/
|
||||
virtual bool IsDoubleBuffered() {
|
||||
virtual bool IsDoubleBuffered() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual GLContextType GetContextType() {
|
||||
return GLContextType::Unknown;
|
||||
}
|
||||
virtual GLContextType GetContextType() const = 0;
|
||||
|
||||
virtual bool IsCurrent() = 0;
|
||||
|
||||
@ -500,7 +498,7 @@ private:
|
||||
// Robustness handling
|
||||
public:
|
||||
|
||||
bool HasRobustness() {
|
||||
bool HasRobustness() const {
|
||||
return mHasRobustness;
|
||||
}
|
||||
|
||||
@ -508,7 +506,7 @@ public:
|
||||
* The derived class is expected to provide information on whether or not it
|
||||
* supports robustness.
|
||||
*/
|
||||
virtual bool SupportsRobustness() = 0;
|
||||
virtual bool SupportsRobustness() const = 0;
|
||||
|
||||
|
||||
private:
|
||||
@ -2460,15 +2458,13 @@ public:
|
||||
// -----------------------------------------------------------------------------
|
||||
// Everything that isn't standard GL APIs
|
||||
protected:
|
||||
|
||||
typedef class gfx::SharedSurface SharedSurface;
|
||||
typedef gfx::SharedSurfaceType SharedSurfaceType;
|
||||
typedef gfx::SurfaceFormat SurfaceFormat;
|
||||
|
||||
virtual bool MakeCurrentImpl(bool aForce) = 0;
|
||||
|
||||
public:
|
||||
|
||||
virtual bool MakeCurrentImpl(bool aForce = false) = 0;
|
||||
|
||||
#ifdef MOZ_ENABLE_GL_TRACKING
|
||||
static void StaticInit() {
|
||||
PR_NewThreadPrivateIndex(&sCurrentGLContextTLS, nullptr);
|
||||
@ -2548,7 +2544,7 @@ public:
|
||||
*
|
||||
* Only valid if IsOffscreen() returns true.
|
||||
*/
|
||||
virtual bool ResizeOffscreen(const gfx::IntSize& size) {
|
||||
bool ResizeOffscreen(const gfx::IntSize& size) {
|
||||
return ResizeScreenBuffer(size);
|
||||
}
|
||||
|
||||
@ -2635,7 +2631,7 @@ public:
|
||||
void ForceDirtyScreen();
|
||||
void CleanDirtyScreen();
|
||||
|
||||
virtual GLenum GetPreferredARGB32Format() { return LOCAL_GL_RGBA; }
|
||||
virtual GLenum GetPreferredARGB32Format() const { return LOCAL_GL_RGBA; }
|
||||
|
||||
virtual bool RenewSurface() { return false; }
|
||||
|
||||
|
@ -34,7 +34,7 @@ public:
|
||||
|
||||
~GLContextCGL();
|
||||
|
||||
virtual GLContextType GetContextType() MOZ_OVERRIDE { return GLContextType::CGL; }
|
||||
virtual GLContextType GetContextType() const MOZ_OVERRIDE { return GLContextType::CGL; }
|
||||
|
||||
static GLContextCGL* Cast(GLContext* gl) {
|
||||
MOZ_ASSERT(gl->GetContextType() == GLContextType::CGL);
|
||||
@ -46,21 +46,19 @@ public:
|
||||
NSOpenGLContext* GetNSOpenGLContext() const { return mContext; }
|
||||
CGLContextObj GetCGLContext() const;
|
||||
|
||||
bool MakeCurrentImpl(bool aForce = false);
|
||||
virtual bool MakeCurrentImpl(bool aForce) MOZ_OVERRIDE;
|
||||
|
||||
virtual bool IsCurrent();
|
||||
virtual bool IsCurrent() MOZ_OVERRIDE;
|
||||
|
||||
virtual GLenum GetPreferredARGB32Format() MOZ_OVERRIDE;
|
||||
virtual GLenum GetPreferredARGB32Format() const MOZ_OVERRIDE;
|
||||
|
||||
bool SetupLookupFunction();
|
||||
virtual bool SetupLookupFunction() MOZ_OVERRIDE;
|
||||
|
||||
bool IsDoubleBuffered();
|
||||
virtual bool IsDoubleBuffered() const MOZ_OVERRIDE;
|
||||
|
||||
bool SupportsRobustness();
|
||||
virtual bool SupportsRobustness() const MOZ_OVERRIDE;
|
||||
|
||||
bool SwapBuffers();
|
||||
|
||||
bool ResizeOffscreen(const gfx::IntSize& aNewSize);
|
||||
virtual bool SwapBuffers() MOZ_OVERRIDE;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ public:
|
||||
|
||||
~GLContextEGL();
|
||||
|
||||
virtual GLContextType GetContextType() MOZ_OVERRIDE { return GLContextType::EGL; }
|
||||
virtual GLContextType GetContextType() const MOZ_OVERRIDE { return GLContextType::EGL; }
|
||||
|
||||
static GLContextEGL* Cast(GLContext* gl) {
|
||||
MOZ_ASSERT(gl->GetContextType() == GLContextType::EGL);
|
||||
@ -47,7 +47,7 @@ public:
|
||||
|
||||
bool Init();
|
||||
|
||||
bool IsDoubleBuffered() {
|
||||
virtual bool IsDoubleBuffered() const MOZ_OVERRIDE {
|
||||
return mIsDoubleBuffered;
|
||||
}
|
||||
|
||||
@ -55,35 +55,31 @@ public:
|
||||
mIsDoubleBuffered = aIsDB;
|
||||
}
|
||||
|
||||
bool SupportsRobustness()
|
||||
{
|
||||
virtual bool SupportsRobustness() const MOZ_OVERRIDE {
|
||||
return sEGLLibrary.HasRobustness();
|
||||
}
|
||||
|
||||
virtual bool IsANGLE()
|
||||
{
|
||||
virtual bool IsANGLE() const MOZ_OVERRIDE {
|
||||
return sEGLLibrary.IsANGLE();
|
||||
}
|
||||
|
||||
bool BindTexImage();
|
||||
virtual bool BindTexImage() MOZ_OVERRIDE;
|
||||
|
||||
bool ReleaseTexImage();
|
||||
virtual bool ReleaseTexImage() MOZ_OVERRIDE;
|
||||
|
||||
void SetEGLSurfaceOverride(EGLSurface surf);
|
||||
|
||||
bool MakeCurrentImpl(bool aForce = false);
|
||||
virtual bool MakeCurrentImpl(bool aForce) MOZ_OVERRIDE;
|
||||
|
||||
virtual bool IsCurrent();
|
||||
virtual bool IsCurrent() MOZ_OVERRIDE;
|
||||
|
||||
virtual bool
|
||||
RenewSurface();
|
||||
virtual bool RenewSurface() MOZ_OVERRIDE;
|
||||
|
||||
virtual void
|
||||
ReleaseSurface();
|
||||
virtual void ReleaseSurface() MOZ_OVERRIDE;
|
||||
|
||||
bool SetupLookupFunction();
|
||||
virtual bool SetupLookupFunction() MOZ_OVERRIDE;
|
||||
|
||||
bool SwapBuffers();
|
||||
virtual bool SwapBuffers() MOZ_OVERRIDE;
|
||||
|
||||
// hold a reference to the given surface
|
||||
// for the lifetime of this context.
|
||||
@ -95,7 +91,6 @@ public:
|
||||
|
||||
bool BindTex2DOffscreen(GLContext *aOffscreen);
|
||||
void UnbindTex2DOffscreen(GLContext *aOffscreen);
|
||||
bool ResizeOffscreen(const gfx::IntSize& aNewSize);
|
||||
void BindOffscreenFramebuffer();
|
||||
|
||||
static already_AddRefed<GLContextEGL>
|
||||
|
@ -28,7 +28,7 @@ public:
|
||||
|
||||
~GLContextGLX();
|
||||
|
||||
virtual GLContextType GetContextType() MOZ_OVERRIDE { return GLContextType::GLX; }
|
||||
virtual GLContextType GetContextType() const MOZ_OVERRIDE { return GLContextType::GLX; }
|
||||
|
||||
static GLContextGLX* Cast(GLContext* gl) {
|
||||
MOZ_ASSERT(gl->GetContextType() == GLContextType::GLX);
|
||||
@ -37,17 +37,17 @@ public:
|
||||
|
||||
bool Init();
|
||||
|
||||
bool MakeCurrentImpl(bool aForce = false);
|
||||
virtual bool MakeCurrentImpl(bool aForce) MOZ_OVERRIDE;
|
||||
|
||||
virtual bool IsCurrent();
|
||||
virtual bool IsCurrent() MOZ_OVERRIDE;
|
||||
|
||||
bool SetupLookupFunction();
|
||||
virtual bool SetupLookupFunction() MOZ_OVERRIDE;
|
||||
|
||||
bool IsDoubleBuffered();
|
||||
virtual bool IsDoubleBuffered() const MOZ_OVERRIDE;
|
||||
|
||||
bool SupportsRobustness();
|
||||
virtual bool SupportsRobustness() const MOZ_OVERRIDE;
|
||||
|
||||
bool SwapBuffers();
|
||||
virtual bool SwapBuffers() MOZ_OVERRIDE;
|
||||
|
||||
private:
|
||||
friend class GLContextProviderGLX;
|
||||
|
@ -78,7 +78,7 @@ private:
|
||||
bool mInitialized;
|
||||
PRLibrary *mOGLLibrary;
|
||||
NSOpenGLPixelFormat *mPixelFormat;
|
||||
};
|
||||
};
|
||||
|
||||
CGLLibrary sCGLLibrary;
|
||||
|
||||
@ -151,7 +151,10 @@ GLContextCGL::IsCurrent() {
|
||||
}
|
||||
|
||||
GLenum
|
||||
GLContextCGL::GetPreferredARGB32Format() { return LOCAL_GL_BGRA; }
|
||||
GLContextCGL::GetPreferredARGB32Format() const
|
||||
{
|
||||
return LOCAL_GL_BGRA;
|
||||
}
|
||||
|
||||
bool
|
||||
GLContextCGL::SetupLookupFunction()
|
||||
@ -166,7 +169,7 @@ GLContextCGL::IsDoubleBuffered()
|
||||
}
|
||||
|
||||
bool
|
||||
GLContextCGL::SupportsRobustness()
|
||||
GLContextCGL::SupportsRobustness() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -180,12 +183,6 @@ GLContextCGL::SwapBuffers()
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
GLContextCGL::ResizeOffscreen(const gfx::IntSize& aNewSize)
|
||||
{
|
||||
return ResizeScreenBuffer(aNewSize);
|
||||
}
|
||||
|
||||
static GLContextCGL *
|
||||
GetGlobalContextCGL()
|
||||
{
|
||||
@ -283,7 +280,7 @@ GLContextProviderCGL::GetGlobalContext()
|
||||
if (!gGlobalContext || !static_cast<GLContextCGL*>(gGlobalContext.get())->Init()) {
|
||||
NS_WARNING("Couldn't init gGlobalContext.");
|
||||
gGlobalContext = nullptr;
|
||||
return nullptr;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -547,12 +547,6 @@ TRY_AGAIN_POWER_OF_TWO:
|
||||
return surface;
|
||||
}
|
||||
|
||||
bool
|
||||
GLContextEGL::ResizeOffscreen(const gfx::IntSize& aNewSize)
|
||||
{
|
||||
return ResizeScreenBuffer(aNewSize);
|
||||
}
|
||||
|
||||
static const EGLint kEGLConfigAttribsOffscreenPBuffer[] = {
|
||||
LOCAL_EGL_SURFACE_TYPE, LOCAL_EGL_PBUFFER_BIT,
|
||||
LOCAL_EGL_RENDERABLE_TYPE, LOCAL_EGL_OPENGL_ES2_BIT,
|
||||
|
@ -885,13 +885,13 @@ GLContextGLX::SetupLookupFunction()
|
||||
}
|
||||
|
||||
bool
|
||||
GLContextGLX::IsDoubleBuffered()
|
||||
GLContextGLX::IsDoubleBuffered() const
|
||||
{
|
||||
return mDoubleBuffered;
|
||||
}
|
||||
|
||||
bool
|
||||
GLContextGLX::SupportsRobustness()
|
||||
GLContextGLX::SupportsRobustness() const
|
||||
{
|
||||
return mGLX->HasRobustness();
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ WGLLibrary::EnsureInitialized()
|
||||
{
|
||||
if (mInitialized)
|
||||
return true;
|
||||
|
||||
|
||||
mozilla::ScopedGfxFeatureReporter reporter("WGL");
|
||||
|
||||
std::string libGLFilename = "Opengl32.dll";
|
||||
@ -320,22 +320,25 @@ GLContextWGL::MakeCurrentImpl(bool aForce)
|
||||
}
|
||||
|
||||
bool
|
||||
GLContextWGL::IsCurrent() {
|
||||
GLContextWGL::IsCurrent()
|
||||
{
|
||||
return sWGLLib.fGetCurrentContext() == mContext;
|
||||
}
|
||||
|
||||
void
|
||||
GLContextWGL::SetIsDoubleBuffered(bool aIsDB) {
|
||||
GLContextWGL::SetIsDoubleBuffered(bool aIsDB)
|
||||
{
|
||||
mIsDoubleBuffered = aIsDB;
|
||||
}
|
||||
|
||||
bool
|
||||
GLContextWGL::IsDoubleBuffered() {
|
||||
GLContextWGL::IsDoubleBuffered() const
|
||||
{
|
||||
return mIsDoubleBuffered;
|
||||
}
|
||||
|
||||
bool
|
||||
GLContextWGL::SupportsRobustness()
|
||||
GLContextWGL::SupportsRobustness() const
|
||||
{
|
||||
return sWGLLib.HasRobustness();
|
||||
}
|
||||
@ -376,7 +379,7 @@ GetMaxSize(HDC hDC, int format, gfxIntSize& size)
|
||||
}
|
||||
|
||||
static bool
|
||||
IsValidSizeForFormat(HDC hDC, int format,
|
||||
IsValidSizeForFormat(HDC hDC, int format,
|
||||
const gfxIntSize& requested)
|
||||
{
|
||||
gfxIntSize max;
|
||||
@ -391,12 +394,6 @@ IsValidSizeForFormat(HDC hDC, int format,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
GLContextWGL::ResizeOffscreen(const gfx::IntSize& aNewSize)
|
||||
{
|
||||
return ResizeScreenBuffer(aNewSize);
|
||||
}
|
||||
|
||||
static GLContextWGL *
|
||||
GetGlobalContextWGL()
|
||||
{
|
||||
@ -411,8 +408,8 @@ GLContextProviderWGL::CreateForWindow(nsIWidget *aWidget)
|
||||
}
|
||||
|
||||
/**
|
||||
* We need to make sure we call SetPixelFormat -after- calling
|
||||
* EnsureInitialized, otherwise it can load/unload the dll and
|
||||
* We need to make sure we call SetPixelFormat -after- calling
|
||||
* EnsureInitialized, otherwise it can load/unload the dll and
|
||||
* wglCreateContext will fail.
|
||||
*/
|
||||
|
||||
@ -564,13 +561,13 @@ CreateWindowOffscreenContext()
|
||||
if (!shareContext) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
HDC dc;
|
||||
HWND win = sWGLLib.CreateDummyWindow(&dc);
|
||||
if (!win) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
HGLRC context = sWGLLib.fCreateContext(dc);
|
||||
if (sWGLLib.HasRobustness()) {
|
||||
int attribs[] = {
|
||||
|
@ -35,7 +35,7 @@ public:
|
||||
|
||||
~GLContextWGL();
|
||||
|
||||
virtual GLContextType GetContextType() MOZ_OVERRIDE { return GLContextType::WGL; }
|
||||
virtual GLContextType GetContextType() const MOZ_OVERRIDE { return GLContextType::WGL; }
|
||||
|
||||
static GLContextWGL* Cast(GLContext* gl) {
|
||||
MOZ_ASSERT(gl->GetContextType() == GLContextType::WGL);
|
||||
@ -44,21 +44,19 @@ public:
|
||||
|
||||
bool Init();
|
||||
|
||||
bool MakeCurrentImpl(bool aForce = false);
|
||||
virtual bool MakeCurrentImpl(bool aForce) MOZ_OVERRIDE;
|
||||
|
||||
virtual bool IsCurrent();
|
||||
virtual bool IsCurrent() MOZ_OVERRIDE;
|
||||
|
||||
void SetIsDoubleBuffered(bool aIsDB);
|
||||
|
||||
virtual bool IsDoubleBuffered();
|
||||
virtual bool IsDoubleBuffered() const MOZ_OVERRIDE;
|
||||
|
||||
bool SupportsRobustness();
|
||||
virtual bool SupportsRobustness() const MOZ_OVERRIDE;
|
||||
|
||||
virtual bool SwapBuffers();
|
||||
virtual bool SwapBuffers() MOZ_OVERRIDE;
|
||||
|
||||
bool SetupLookupFunction();
|
||||
|
||||
bool ResizeOffscreen(const gfx::IntSize& aNewSize);
|
||||
virtual bool SetupLookupFunction() MOZ_OVERRIDE;
|
||||
|
||||
HGLRC Context() { return mContext; }
|
||||
|
||||
|
@ -120,7 +120,7 @@ public:
|
||||
Extensions_Max
|
||||
};
|
||||
|
||||
bool IsExtensionSupported(EGLExtensions aKnownExtension) {
|
||||
bool IsExtensionSupported(EGLExtensions aKnownExtension) const {
|
||||
return mAvailableExtensions[aKnownExtension];
|
||||
}
|
||||
|
||||
@ -411,7 +411,7 @@ public:
|
||||
return mEGLDisplay;
|
||||
}
|
||||
|
||||
bool IsANGLE() {
|
||||
bool IsANGLE() const {
|
||||
return mIsANGLE;
|
||||
}
|
||||
|
||||
@ -431,7 +431,7 @@ public:
|
||||
return IsExtensionSupported(ANGLE_surface_d3d_texture_2d_share_handle);
|
||||
}
|
||||
|
||||
bool HasRobustness() {
|
||||
bool HasRobustness() const {
|
||||
return IsExtensionSupported(EXT_create_context_robustness);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user