зеркало из https://github.com/mozilla/gecko-dev.git
Bug 579276. Part 6: Add gfxASurface::GetTextQualityInTransparentSurfaces API. r=jrmuizel,sr=vlad
This commit is contained in:
Родитель
396aec34d8
Коммит
359694e234
|
@ -153,7 +153,40 @@ public:
|
|||
*/
|
||||
virtual PRBool AreSimilarSurfacesSensitiveToContentType()
|
||||
{
|
||||
return PR_TRUE;
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
enum TextQuality {
|
||||
/**
|
||||
* TEXT_QUALITY_OK means that text is always rendered to a
|
||||
* transparent surface just as well as it would be rendered to an
|
||||
* opaque surface. This would normally only be true if
|
||||
* subpixel antialiasing is disabled or if the platform's
|
||||
* transparent surfaces support component alpha.
|
||||
*/
|
||||
TEXT_QUALITY_OK,
|
||||
/**
|
||||
* TEXT_QUALITY_OK_OVER_OPAQUE_PIXELS means that text is rendered
|
||||
* to a transparent surface just as well as it would be rendered to an
|
||||
* opaque surface, but only if all the pixels the text is drawn
|
||||
* over already have opaque alpha values.
|
||||
*/
|
||||
TEXT_QUALITY_OK_OVER_OPAQUE_PIXELS,
|
||||
/**
|
||||
* TEXT_QUALITY_BAD means that text is rendered
|
||||
* to a transparent surface worse than it would be rendered to an
|
||||
* opaque surface, even if all the pixels the text is drawn
|
||||
* over already have opaque alpha values.
|
||||
*/
|
||||
TEXT_QUALITY_BAD
|
||||
};
|
||||
/**
|
||||
* Determine how well text would be rendered in transparent surfaces that
|
||||
* are similar to this surface.
|
||||
*/
|
||||
virtual TextQuality GetTextQualityInTransparentSurfaces()
|
||||
{
|
||||
return TEXT_QUALITY_BAD;
|
||||
}
|
||||
|
||||
int CairoStatus();
|
||||
|
|
|
@ -57,6 +57,12 @@ public:
|
|||
|
||||
virtual ~gfxD2DSurface();
|
||||
|
||||
virtual TextQuality GetTextQualityInTransparentSurfaces()
|
||||
{
|
||||
// D2D always draws text in transparent surfaces with grayscale-AA,
|
||||
// even if the text is over opaque pixels.
|
||||
return TEXT_QUALITY_BAD;
|
||||
}
|
||||
|
||||
void Present();
|
||||
void Scroll(const nsIntPoint &aDelta, const nsIntRect &aClip);
|
||||
|
|
|
@ -60,6 +60,10 @@ public:
|
|||
{
|
||||
return PR_FALSE;
|
||||
}
|
||||
virtual TextQuality GetTextQualityInTransparentSurfaces()
|
||||
{
|
||||
return TEXT_QUALITY_OK_OVER_OPAQUE_PIXELS;
|
||||
}
|
||||
|
||||
const gfxSize& GetSize() const { return mSize; }
|
||||
|
||||
|
|
|
@ -81,6 +81,11 @@ public:
|
|||
const gfxIntSize& size,
|
||||
gfxImageFormat format);
|
||||
|
||||
virtual TextQuality GetTextQualityInTransparentSurfaces()
|
||||
{
|
||||
return TEXT_QUALITY_OK_OVER_OPAQUE_PIXELS;
|
||||
}
|
||||
|
||||
nsresult BeginPrinting(const nsAString& aTitle, const nsAString& aPrintToFileName);
|
||||
nsresult EndPrinting();
|
||||
nsresult AbortPrinting();
|
||||
|
|
|
@ -77,6 +77,11 @@ public:
|
|||
virtual already_AddRefed<gfxASurface>
|
||||
CreateSimilarSurface(gfxContentType aType, const gfxIntSize& aSize);
|
||||
|
||||
virtual TextQuality GetTextQualityInTransparentSurfaces()
|
||||
{
|
||||
return TEXT_QUALITY_OK_OVER_OPAQUE_PIXELS;
|
||||
}
|
||||
|
||||
const gfxIntSize& GetSize() { return mSize; }
|
||||
|
||||
Display* XDisplay() { return mDisplay; }
|
||||
|
|
Загрузка…
Ссылка в новой задаче