Bug 757347; Add a shutdown hook and remove MaskImageFormat(). r=roc

This commit is contained in:
Nicholas Cameron 2012-06-26 09:44:41 +12:00
parent abe8ccd904
commit 3cd654450f
7 changed files with 14 additions and 16 deletions

View File

@ -429,12 +429,6 @@ public:
CreateOptimalSurface(const gfxIntSize &aSize,
gfxASurface::gfxImageFormat imageFormat);
/**
* Which image format to use as an alpha mask with this layer manager.
*/
virtual gfxASurface::gfxImageFormat MaskImageFormat()
{ return gfxASurface::ImageFormatA8; }
/**
* Creates a DrawTarget which is optimized for inter-operating with this
* layermanager.

View File

@ -138,9 +138,6 @@ public:
CreateOptimalSurface(const gfxIntSize &aSize,
gfxASurface::gfxImageFormat imageFormat);
virtual gfxASurface::gfxImageFormat MaskImageFormat()
{ return gfxASurface::ImageFormatARGB32; }
virtual TemporaryRef<mozilla::gfx::DrawTarget>
CreateDrawTarget(const mozilla::gfx::IntSize &aSize,
mozilla::gfx::SurfaceFormat aFormat);

View File

@ -170,9 +170,6 @@ public:
mDefaultDeviceManager = nsnull;
}
virtual gfxASurface::gfxImageFormat MaskImageFormat()
{ return gfxASurface::ImageFormatARGB32; }
#ifdef MOZ_LAYERS_HAVE_LOG
virtual const char* Name() const { return "D3D9"; }
#endif // MOZ_LAYERS_HAVE_LOG

View File

@ -314,9 +314,6 @@ public:
GLenum aWrapMode = LOCAL_GL_REPEAT,
bool aFlipped = false);
virtual gfxASurface::gfxImageFormat MaskImageFormat()
{ return gfxASurface::ImageFormatARGB32; }
#ifdef MOZ_LAYERS_HAVE_LOG
virtual const char* Name() const { return "OGL"; }
#endif // MOZ_LAYERS_HAVE_LOG

View File

@ -562,6 +562,16 @@ ThebesDisplayItemLayerUserData* GetThebesDisplayItemLayerUserData(Layer* aLayer)
} // anonymous namespace
/* static */ void
FrameLayerBuilder::Shutdown()
{
if (gMaskLayerImageCache) {
delete gMaskLayerImageCache;
gMaskLayerImageCache = nsnull;
}
}
void
FrameLayerBuilder::Init(nsDisplayListBuilder* aBuilder)
{
@ -2897,7 +2907,7 @@ ContainerState::SetupMaskLayer(Layer *aLayer, const FrameLayerBuilder::Clip& aCl
// no existing mask image, so build a new one
nsRefPtr<gfxASurface> surface =
aLayer->Manager()->CreateOptimalSurface(surfaceSize,
aLayer->Manager()->MaskImageFormat());
gfxASurface::ImageFormatARGB32);
// fail if we can't get the right surface
if (!surface || surface->CairoStatus()) {

View File

@ -87,6 +87,8 @@ public:
mThebesLayerItems.Init();
}
static void Shutdown();
void Init(nsDisplayListBuilder* aBuilder);
/**

View File

@ -309,6 +309,7 @@ nsLayoutStatics::Shutdown()
nsXBLWindowKeyHandler::ShutDown();
nsXBLService::Shutdown();
nsAutoCopyListener::Shutdown();
FrameLayerBuilder::Shutdown();
#ifdef MOZ_MEDIA_PLUGINS
nsMediaPluginHost::Shutdown();