b=797568 destroy GLXPixmap on Finish r=roc

--HG--
extra : transplant_source : 5%969%9A%B7%97%B2%EC%15%CA%7FPSWP%26Y%9DS%AE
This commit is contained in:
Karl Tomlinson 2012-10-31 15:54:20 +13:00
parent 9c4ac49947
commit 46e02a3103
2 changed files with 21 additions and 0 deletions

View File

@ -214,6 +214,18 @@ gfxXlibSurface::CreateSimilarSurface(gfxContentType aContent,
return gfxASurface::CreateSimilarSurface(aContent, aSize);
}
void
gfxXlibSurface::Finish()
{
#if !defined(MOZ_PLATFORM_MAEMO)
if (mGLXPixmap) {
gl::sDefGLXLib.DestroyPixmap(mGLXPixmap);
mGLXPixmap = None;
}
#endif
gfxASurface::Finish();
}
void
gfxXlibSurface::DoSizeQuery()
{
@ -511,6 +523,14 @@ GLXPixmap
gfxXlibSurface::GetGLXPixmap()
{
if (!mGLXPixmap) {
#ifdef DEBUG
// cairo_surface_has_show_text_glyphs is used solely for the
// side-effect of setting the error on surface if
// cairo_surface_finish() has been called.
cairo_surface_has_show_text_glyphs(CairoSurface());
NS_ASSERTION(CairoStatus() != CAIRO_STATUS_SURFACE_FINISHED,
"GetGLXPixmap called after surface finished");
#endif
mGLXPixmap = gl::sDefGLXLib.CreatePixmap(this);
}
return mGLXPixmap;

View File

@ -47,6 +47,7 @@ public:
virtual already_AddRefed<gfxASurface>
CreateSimilarSurface(gfxContentType aType, const gfxIntSize& aSize);
virtual void Finish() MOZ_OVERRIDE;
virtual const gfxIntSize GetSize() const { return mSize; }