зеркало из https://github.com/mozilla/gecko-dev.git
Bug 916264 - Delete texture to unbound from texture. r=nical
This commit is contained in:
Родитель
c5731e7404
Коммит
848985c5e5
|
@ -172,10 +172,7 @@ CompositableQuirksGonkOGL::CompositableQuirksGonkOGL()
|
||||||
}
|
}
|
||||||
CompositableQuirksGonkOGL::~CompositableQuirksGonkOGL()
|
CompositableQuirksGonkOGL::~CompositableQuirksGonkOGL()
|
||||||
{
|
{
|
||||||
if (mTexture) {
|
DeleteTextureIfPresent();
|
||||||
gl()->MakeCurrent();
|
|
||||||
gl()->fDeleteTextures(1, &mTexture);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gl::GLContext*
|
gl::GLContext*
|
||||||
|
@ -198,6 +195,15 @@ GLuint CompositableQuirksGonkOGL::GetTexture()
|
||||||
return mTexture;
|
return mTexture;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CompositableQuirksGonkOGL::DeleteTextureIfPresent()
|
||||||
|
{
|
||||||
|
if (mTexture) {
|
||||||
|
gl()->MakeCurrent();
|
||||||
|
gl()->fDeleteTextures(1, &mTexture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
TextureImageTextureSourceOGL::Update(gfx::DataSourceSurface* aSurface,
|
TextureImageTextureSourceOGL::Update(gfx::DataSourceSurface* aSurface,
|
||||||
TextureFlags aFlags,
|
TextureFlags aFlags,
|
||||||
|
@ -500,6 +506,19 @@ TextureImageDeprecatedTextureHostOGL::UpdateImpl(const SurfaceDescriptor& aImage
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef MOZ_WIDGET_GONK
|
||||||
|
if (mQuirks) {
|
||||||
|
// on gonk, this class is used as a fallback from gralloc buffer.
|
||||||
|
// There is a case this class is used with GrallocDeprecatedTextureHostOGL
|
||||||
|
// under same CompositableHost. if it happens, a gralloc buffer of
|
||||||
|
// GrallocDeprecatedTextureHostOGL needs to be unbounded from a texture,
|
||||||
|
// when the gralloc buffer is not rendered.
|
||||||
|
// Establish the unbound by deleting the texture.
|
||||||
|
// See Bug 916264.
|
||||||
|
static_cast<CompositableQuirksGonkOGL*>(mQuirks.get())->DeleteTextureIfPresent();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
AutoOpenSurface surf(OPEN_READ_ONLY, aImage);
|
AutoOpenSurface surf(OPEN_READ_ONLY, aImage);
|
||||||
nsIntSize size = surf.Size();
|
nsIntSize size = surf.Size();
|
||||||
TextureImage::ImageFormat format = surf.ImageFormat();
|
TextureImage::ImageFormat format = surf.ImageFormat();
|
||||||
|
|
|
@ -71,6 +71,7 @@ public:
|
||||||
|
|
||||||
virtual void SetCompositor(Compositor* aCompositor) MOZ_OVERRIDE;
|
virtual void SetCompositor(Compositor* aCompositor) MOZ_OVERRIDE;
|
||||||
GLuint GetTexture();
|
GLuint GetTexture();
|
||||||
|
void DeleteTextureIfPresent();
|
||||||
gl::GLContext* gl() const;
|
gl::GLContext* gl() const;
|
||||||
protected:
|
protected:
|
||||||
RefPtr<CompositorOGL> mCompositor;
|
RefPtr<CompositorOGL> mCompositor;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче