Bug 1224199 - Remove DestroyScreenBuffer. r?jrmuizel
From 320888354ebfbedc1f0509b5baf57861c66ab7ae Mon Sep 17 00:00:00 2001
---
gfx/gl/GLContext.cpp | 12 ++----------
gfx/gl/GLContext.h | 2 --
2 files changed, 2 insertions(+), 12 deletions(-)
MozReview-Commit-ID: EbrpM3pzJMM
--- a/gfx/gl/GLContext.cpp
+++ b/gfx/gl/GLContext.cpp
@@ -2351,19 +2351,19 @@ GLContext::ClearSafely()
}
void
GLContext::MarkDestroyed()
{
if (IsDestroyed())
return;
+ mScreen = nullptr;
+
if (MakeCurrent()) {
- DestroyScreenBuffer();
-
mBlitHelper = nullptr;
mReadTexImageHelper = nullptr;
mTexGarbageBin->GLContextTeardown();
} else {
NS_WARNING("MakeCurrent() failed during MarkDestroyed! Skipping GL object teardown.");
}
@@ -2600,18 +2600,16 @@ GLContext::CreateScreenBufferImpl(const
UniquePtr<GLScreenBuffer> newScreen = GLScreenBuffer::Create(this, size, caps);
if (!newScreen)
return false;
if (!newScreen->Resize(size)) {
return false;
}
- DestroyScreenBuffer();
-
// This will rebind to 0 (Screen) if needed when
// it falls out of scope.
ScopedBindFramebuffer autoFB(this);
mScreen = Move(newScreen);
return true;
}
@@ -2621,22 +2619,16 @@ GLContext::ResizeScreenBuffer(const IntS
{
if (!IsOffscreenSizeAllowed(size))
return false;
return mScreen->Resize(size);
}
void
-GLContext::DestroyScreenBuffer()
-{
- mScreen = nullptr;
-}
-
-void
GLContext::ForceDirtyScreen()
{
ScopedBindFramebuffer autoFB(0);
BeforeGLDrawCall();
// no-op; just pretend we did something
AfterGLDrawCall();
}
--- a/gfx/gl/GLContext.h
+++ b/gfx/gl/GLContext.h
@@ -3454,18 +3454,16 @@ public:
const GLuint texture,
GLuint* drawFB,
GLuint* readFB);
protected:
friend class GLScreenBuffer;
UniquePtr<GLScreenBuffer> mScreen;
- void DestroyScreenBuffer();
-
SharedSurface* mLockedSurface;
public:
void LockSurface(SharedSurface* surf) {
MOZ_ASSERT(!mLockedSurface);
mLockedSurface = surf;
}