Bug 1440717 - Use RefPtr for CompositingRenderTargetOGL::mGL. r=Bas, a=ritu draft FIREFOX_52_7_3esr_BUILD2 FIREFOX_52_7_3esr_RELEASE
authorNicolas Silva <nsilva@mozilla.com>
Mon, 12 Mar 2018 13:36:00 +0100
changeset 776268 c3e447e07077412b9cfaacb2ea91974655ed753b
parent 776267 bb8ae7990f45dd295b80a347b779bcc4690205fa
child 776269 2ed6e0ee11230b5053b8e04ff7bbe6e42353df29
push id104831
push userbmo:jgilbert@mozilla.com
push dateMon, 02 Apr 2018 19:53:20 +0000
reviewersBas, ritu
bugs1440717
milestone52.7.3
Bug 1440717 - Use RefPtr for CompositingRenderTargetOGL::mGL. r=Bas, a=ritu
gfx/layers/opengl/CompositingRenderTargetOGL.cpp
gfx/layers/opengl/CompositingRenderTargetOGL.h
--- a/gfx/layers/opengl/CompositingRenderTargetOGL.cpp
+++ b/gfx/layers/opengl/CompositingRenderTargetOGL.cpp
@@ -55,17 +55,17 @@ CompositingRenderTargetOGL::BindRenderTa
         mGL->RenewSurface(mCompositor->GetWidget()->RealWidget());
         result = mGL->fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER);
       }
       if (result != LOCAL_GL_FRAMEBUFFER_COMPLETE) {
         nsAutoCString msg;
         msg.AppendPrintf("Framebuffer not complete -- CheckFramebufferStatus returned 0x%x, "
                          "GLContext=%p, IsOffscreen()=%d, mFBO=%d, aFBOTextureTarget=0x%x, "
                          "aRect.width=%d, aRect.height=%d",
-                         result, mGL, mGL->IsOffscreen(), mFBO, mInitParams.mFBOTextureTarget,
+                         result, mGL.get(), mGL->IsOffscreen(), mFBO, mInitParams.mFBOTextureTarget,
                          mInitParams.mSize.width, mInitParams.mSize.height);
         NS_WARNING(msg.get());
       }
     }
 
     needsClear = mClearOnBind;
   }
 
--- a/gfx/layers/opengl/CompositingRenderTargetOGL.h
+++ b/gfx/layers/opengl/CompositingRenderTargetOGL.h
@@ -179,17 +179,17 @@ private:
 
   InitParams mInitParams;
   /**
    * There is temporary a cycle between the compositor and the render target,
    * each having a strong ref to the other. The compositor's reference to
    * the target is always cleared at the end of a frame.
    */
   RefPtr<CompositorOGL> mCompositor;
-  GLContext* mGL;
+  RefPtr<GLContext> mGL;
   GLuint mTextureHandle;
   GLuint mFBO;
 };
 
 } // namespace layers
 } // namespace mozilla
 
 #endif /* MOZILLA_GFX_SURFACEOGL_H */