Bug 1265824 - Remove the unsed member in GLTextureSource r=mattwoodrow
authorDoug Thayer <dothayer@mozilla.com>
Wed, 02 May 2018 18:19:54 -0700
changeset 427956 3b0192c401cf32dbbf25d36f2bbbec0e0b392562
parent 427955 1c945ede0071fac3f11a6cddd48cb68517a1132a
child 427957 cf95b1f62eae89e0988f750b6a56871c79067d15
push id34322
push userrgurzau@mozilla.com
push dateTue, 24 Jul 2018 15:47:07 +0000
treeherdermozilla-central@db9d47b49936 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1265824
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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,