Bug 1224199 - Remove DestroyScreenBuffer. r?jrmuizel draft
authorJeff Gilbert <jdashg@gmail.com>
Tue, 12 Apr 2016 18:19:43 -0700
changeset 350561 cbcc23bbb542d33705c7bc5603f536c8085238a9
parent 349384 e847cfcb315f511f4928b03fd47dcf57aad05e1e
child 350562 e34378559078c228439d7f5f4fc0756513ce5cae
push id15372
push userjgilbert@mozilla.com
push dateThu, 14 Apr 2016 00:15:20 +0000
reviewersjrmuizel
bugs1224199
milestone48.0a1
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
gfx/gl/GLContext.cpp
gfx/gl/GLContext.h
--- 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;
     }