зеркало из https://github.com/mozilla/gecko-dev.git
Bug 930516 - Add a gfxPlatform::ScreenReferenceDrawTarget() static method. r=Bas
This commit is contained in:
Родитель
8e688f1a8f
Коммит
0ea41b656f
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче