Bug 612042: Set extend mode properly for integer translations. r=joedrew a=blocking-betan

This commit is contained in:
Bas Schouten 2010-12-12 06:18:27 +01:00
parent 8214a72452
commit 355708a54f

View File

@ -155,14 +155,22 @@ gfxSurfaceDrawable::Draw(gfxContext* aContext,
if (aRepeat) {
pattern->SetExtend(gfxPattern::EXTEND_REPEAT);
pattern->SetFilter(aFilter);
} else if (aContext->CurrentMatrix().HasNonIntegerTranslation() ||
aTransform.HasNonIntegerTranslation()) {
} else {
gfxPattern::GraphicsFilter filter = aFilter;
if (aContext->CurrentMatrix().HasOnlyIntegerTranslation() &&
aTransform.HasOnlyIntegerTranslation())
{
// If we only have integer translation, no special filtering needs to
// happen and we explicitly use FILTER_FAST. This is fast for some
// backends.
filter = gfxPattern::FILTER_FAST;
}
nsRefPtr<gfxASurface> currentTarget = aContext->CurrentSurface();
gfxASurface::gfxSurfaceType surfaceType = currentTarget->GetType();
gfxMatrix deviceSpaceToImageSpace =
DeviceToImageTransform(aContext, aTransform);
PreparePatternForUntiledDrawing(pattern, deviceSpaceToImageSpace,
surfaceType, currentTarget, aFilter);
surfaceType, currentTarget, filter);
}
#ifdef MOZ_GFX_OPTIMIZE_MOBILE
pattern->SetFilter(gfxPattern::FILTER_FAST);