Bug 1265824 - Remove the unsed member in GLTextureSource r?mattwoodrow draft
authorDoug Thayer <dothayer@mozilla.com>
Wed, 02 May 2018 18:19:54 -0700
changeset 821352 cd50773ef18d243d316a6f450aa18cc164300614
parent 821151 6eec814dea789707d04f42bbb01097d44532e2a9
child 821353 6eb463336f7feb6bc6d84976ba1d05aad898e9d3
push id117075
push userbmo:dothayer@mozilla.com
push dateMon, 23 Jul 2018 03:29:59 +0000
reviewersmattwoodrow
bugs1265824
milestone63.0a1
Bug 1265824 - Remove the unsed member in GLTextureSource r?mattwoodrow The "mExternallyOwned" is used for gralloc buffer. We don't use the gralloc buffer now. MozReview-Commit-ID: 7Gurpa3kdp0
gfx/layers/opengl/TextureHostOGL.cpp
gfx/layers/opengl/TextureHostOGL.h
--- a/gfx/layers/opengl/TextureHostOGL.cpp
+++ b/gfx/layers/opengl/TextureHostOGL.cpp
@@ -237,42 +237,36 @@ TextureImageTextureSourceOGL::BindTextur
 
 ////////////////////////////////////////////////////////////////////////
 // GLTextureSource
 
 GLTextureSource::GLTextureSource(TextureSourceProvider* aProvider,
                                  GLuint aTextureHandle,
                                  GLenum aTarget,
                                  gfx::IntSize aSize,
-                                 gfx::SurfaceFormat aFormat,
-                                 bool aExternallyOwned)
+                                 gfx::SurfaceFormat aFormat)
   : mGL(aProvider->GetGLContext())
   , mTextureHandle(aTextureHandle)
   , mTextureTarget(aTarget)
   , mSize(aSize)
   , mFormat(aFormat)
-  , mExternallyOwned(aExternallyOwned)
 {
   MOZ_COUNT_CTOR(GLTextureSource);
 }
 
 GLTextureSource::~GLTextureSource()
 {
   MOZ_COUNT_DTOR(GLTextureSource);
-  if (!mExternallyOwned) {
-    DeleteTextureHandle();
-  }
+  DeleteTextureHandle();
 }
 
 void
 GLTextureSource::DeallocateDeviceData()
 {
-  if (!mExternallyOwned) {
-    DeleteTextureHandle();
-  }
+  DeleteTextureHandle();
 }
 
 void
 GLTextureSource::DeleteTextureHandle()
 {
   GLContext* gl = this->gl();
   if (mTextureHandle != 0 && gl && gl->MakeCurrent()) {
     gl->fDeleteTextures(1, &mTextureHandle);
@@ -759,18 +753,17 @@ GLTextureHost::Lock()
 
   if (!mTextureSource) {
     gfx::SurfaceFormat format = mHasAlpha ? gfx::SurfaceFormat::R8G8B8A8
                                           : gfx::SurfaceFormat::R8G8B8X8;
     mTextureSource = new GLTextureSource(mProvider,
                                          mTexture,
                                          mTarget,
                                          mSize,
-                                         format,
-                                         false /* owned by the client */);
+                                         format);
   }
 
   return true;
 }
 
 void
 GLTextureHost::SetTextureSourceProvider(TextureSourceProvider* aProvider)
 {
--- a/gfx/layers/opengl/TextureHostOGL.h
+++ b/gfx/layers/opengl/TextureHostOGL.h
@@ -227,18 +227,17 @@ protected:
 class GLTextureSource : public TextureSource
                       , public TextureSourceOGL
 {
 public:
   GLTextureSource(TextureSourceProvider* aProvider,
                   GLuint aTextureHandle,
                   GLenum aTarget,
                   gfx::IntSize aSize,
-                  gfx::SurfaceFormat aFormat,
-                  bool aExternallyOwned = false);
+                  gfx::SurfaceFormat aFormat);
 
   ~GLTextureSource();
 
   virtual const char* Name() const override { return "GLTextureSource"; }
 
   virtual GLTextureSource* AsGLTextureSource() override { return this; }
 
   virtual TextureSourceOGL* AsSourceOGL() override { return this; }
@@ -274,19 +273,16 @@ protected:
   void DeleteTextureHandle();
 
   RefPtr<gl::GLContext> mGL;
   RefPtr<CompositorOGL> mCompositor;
   GLuint mTextureHandle;
   GLenum mTextureTarget;
   gfx::IntSize mSize;
   gfx::SurfaceFormat mFormat;
-  // If the texture is externally owned, the gl handle will not be deleted
-  // in the destructor.
-  bool mExternallyOwned;
 };
 
 class GLTextureHost : public TextureHost
 {
 public:
   GLTextureHost(TextureFlags aFlags,
                 GLuint aTextureHandle,
                 GLenum aTarget,