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
--- 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,