Bug 930516 - Add a gfxPlatform::ScreenReferenceDrawTarget() static method. r=Bas

This commit is contained in:
Jonathan Watt 2013-10-24 17:50:26 +02:00
Родитель 8e688f1a8f
Коммит 0ea41b656f
2 изменённых файлов: 12 добавлений и 0 удалений

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

@ -393,6 +393,15 @@ gfxPlatform::Init()
NS_RUNTIMEABORT("Could not initialize mScreenReferenceSurface");
}
if (gPlatform->SupportsAzureContent()) {
gPlatform->mScreenReferenceDrawTarget =
gPlatform->CreateOffscreenContentDrawTarget(IntSize(1, 1),
FORMAT_B8G8R8A8);
if (!gPlatform->mScreenReferenceDrawTarget) {
NS_RUNTIMEABORT("Could not initialize mScreenReferenceDrawTarget");
}
}
rv = gfxFontCache::Init();
if (NS_FAILED(rv)) {
NS_RUNTIMEABORT("Could not initialize gfxFontCache");
@ -500,6 +509,7 @@ gfxPlatform::Shutdown()
gfxPlatform::~gfxPlatform()
{
mScreenReferenceSurface = nullptr;
mScreenReferenceDrawTarget = nullptr;
// The cairo folks think we should only clean up in debug builds,
// but we're generally in the habit of trying to shut down as

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

@ -578,6 +578,7 @@ public:
* for measuring text etc as if they will be rendered to the screen
*/
gfxASurface* ScreenReferenceSurface() { return mScreenReferenceSurface; }
mozilla::gfx::DrawTarget* ScreenReferenceDrawTarget() { return mScreenReferenceDrawTarget; }
virtual mozilla::gfx::SurfaceFormat Optimal2DFormatForContent(gfxContentType aContent);
@ -710,6 +711,7 @@ private:
virtual bool SupportsOffMainThreadCompositing() { return true; }
nsRefPtr<gfxASurface> mScreenReferenceSurface;
mozilla::RefPtr<mozilla::gfx::DrawTarget> mScreenReferenceDrawTarget;
nsTArray<uint32_t> mCJKPrefLangs;
nsCOMPtr<nsIObserver> mSRGBOverrideObserver;
nsCOMPtr<nsIObserver> mFontPrefsObserver;