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
Родитель 4620356d60
Коммит 841c20e037
7 изменённых файлов: 14 добавлений и 16 удалений

Просмотреть файл

@ -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.

Просмотреть файл

@ -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);

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

@ -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()) {

Просмотреть файл

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

Просмотреть файл

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