зеркало из https://github.com/mozilla/gecko-dev.git
Bug 585817. Part 1: Create a single static 1x1 surface in gfxPlatform that can be used to create contexts for text measurement etc. r=vlad
This commit is contained in:
Родитель
efa1655e68
Коммит
3f83dd98b9
|
@ -238,6 +238,15 @@ gfxPlatform::Init()
|
||||||
if (!gPlatform)
|
if (!gPlatform)
|
||||||
return NS_ERROR_OUT_OF_MEMORY;
|
return NS_ERROR_OUT_OF_MEMORY;
|
||||||
|
|
||||||
|
gPlatform->mScreenReferenceSurface =
|
||||||
|
gPlatform->CreateOffscreenSurface(gfxIntSize(1,1),
|
||||||
|
gfxASurface::ImageFormatARGB32);
|
||||||
|
if (!gPlatform->mScreenReferenceSurface) {
|
||||||
|
NS_ERROR("Could not initialize mScreenReferenceSurface");
|
||||||
|
Shutdown();
|
||||||
|
return NS_ERROR_OUT_OF_MEMORY;
|
||||||
|
}
|
||||||
|
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
|
|
||||||
#if defined(XP_MACOSX) || defined(XP_WIN) || defined(ANDROID) // temporary, until this is implemented on others
|
#if defined(XP_MACOSX) || defined(XP_WIN) || defined(ANDROID) // temporary, until this is implemented on others
|
||||||
|
|
|
@ -339,6 +339,12 @@ public:
|
||||||
|
|
||||||
virtual void FontsPrefsChanged(nsIPrefBranch *aPrefBranch, const char *aPref);
|
virtual void FontsPrefsChanged(nsIPrefBranch *aPrefBranch, const char *aPref);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a 1x1 surface that can be used to create graphics contexts
|
||||||
|
* for measuring text etc as if they will be rendered to the screen
|
||||||
|
*/
|
||||||
|
gfxASurface* ScreenReferenceSurface() { return mScreenReferenceSurface; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
gfxPlatform();
|
gfxPlatform();
|
||||||
virtual ~gfxPlatform();
|
virtual ~gfxPlatform();
|
||||||
|
@ -356,8 +362,8 @@ protected:
|
||||||
private:
|
private:
|
||||||
virtual qcms_profile* GetPlatformCMSOutputProfile();
|
virtual qcms_profile* GetPlatformCMSOutputProfile();
|
||||||
|
|
||||||
|
nsRefPtr<gfxASurface> mScreenReferenceSurface;
|
||||||
nsTArray<PRUint32> mCJKPrefLangs;
|
nsTArray<PRUint32> mCJKPrefLangs;
|
||||||
|
|
||||||
nsCOMPtr<nsIObserver> overrideObserver;
|
nsCOMPtr<nsIObserver> overrideObserver;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче