Bug 579985. Part 3.2: Remove gfxASurface::AreSimilarSurfacesSensitiveToContentType because it's effectively always true now. r=jrmuizel,a=blocking

This commit is contained in:
Robert O'Callahan 2010-11-12 14:43:40 +13:00
Родитель 55d56898d6
Коммит 6befdb5626
4 изменённых файлов: 3 добавлений и 24 удалений

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

@ -472,11 +472,9 @@ BasicThebesLayer::Paint(gfxContext* aContext,
nsRefPtr<gfxASurface> targetSurface = aContext->CurrentSurface(); nsRefPtr<gfxASurface> targetSurface = aContext->CurrentSurface();
PRBool canUseOpaqueSurface = CanUseOpaqueSurface(); PRBool canUseOpaqueSurface = CanUseOpaqueSurface();
PRBool opaqueBuffer = canUseOpaqueSurface &&
targetSurface->AreSimilarSurfacesSensitiveToContentType();
Buffer::ContentType contentType = Buffer::ContentType contentType =
opaqueBuffer ? gfxASurface::CONTENT_COLOR : canUseOpaqueSurface ? gfxASurface::CONTENT_COLOR :
gfxASurface::CONTENT_COLOR_ALPHA; gfxASurface::CONTENT_COLOR_ALPHA;
float opacity = GetEffectiveOpacity(); float opacity = GetEffectiveOpacity();
if (!BasicManager()->IsRetained() || if (!BasicManager()->IsRetained() ||

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

@ -161,20 +161,6 @@ public:
return nsnull; return nsnull;
} }
/**
* Return trues if offscreen surfaces created from this surface
* would behave differently depending on the gfxContentType. Returns
* false if they don't (i.e. the surface returned by
* CreateOffscreenSurface is always as if you passed
* CONTENT_COLOR_ALPHA). Knowing this can be useful to avoid
* recreating a surface just because it changed from opaque to
* transparent.
*/
virtual PRBool AreSimilarSurfacesSensitiveToContentType()
{
return PR_TRUE;
}
enum TextQuality { enum TextQuality {
/** /**
* TEXT_QUALITY_OK means that text is always rendered to a * TEXT_QUALITY_OK means that text is always rendered to a

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

@ -104,8 +104,7 @@ gfxCachedTempSurface::Get(gfxASurface::gfxContentType aContentType,
if (mSurface) { if (mSurface) {
/* Verify the current buffer is valid for this purpose */ /* Verify the current buffer is valid for this purpose */
if (mSize.width < aSize.width || mSize.height < aSize.height if (mSize.width < aSize.width || mSize.height < aSize.height
|| (mSurface->GetContentType() != aContentType || mSurface->GetContentType() != aContentType) {
&& mSurface->AreSimilarSurfacesSensitiveToContentType())) {
mSurface = nsnull; mSurface = nsnull;
} else { } else {
NS_ASSERTION(mType == aSimilarTo->GetType(), NS_ASSERTION(mType == aSimilarTo->GetType(),

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

@ -56,10 +56,6 @@ public:
virtual already_AddRefed<gfxASurface> CreateSimilarSurface(gfxContentType aType, virtual already_AddRefed<gfxASurface> CreateSimilarSurface(gfxContentType aType,
const gfxIntSize& aSize); const gfxIntSize& aSize);
virtual PRBool AreSimilarSurfacesSensitiveToContentType()
{
return PR_FALSE;
}
virtual TextQuality GetTextQualityInTransparentSurfaces() virtual TextQuality GetTextQualityInTransparentSurfaces()
{ {
return TEXT_QUALITY_OK_OVER_OPAQUE_PIXELS; return TEXT_QUALITY_OK_OVER_OPAQUE_PIXELS;