Bug 637852. Part 15: Don't round mOuterRect/mInnerRect if there's a scale factor in the current transform. r=joe

This avoids losing information when we're drawing into a high-resolution ThebesLayer. It works well with the
previous patch; for identity scale, this rounding of the inner/outer rects ensures pixel alignment of the edges,
but with non-identity scale the rectangle snapping ensures pixel alignment of the edges. This fixes reftest failures.
This commit is contained in:
Robert O'Callahan 2011-06-23 00:11:28 +12:00
Родитель 0e8a6f7390
Коммит 5483e21601
1 изменённых файлов: 7 добавлений и 6 удалений

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

@ -1381,12 +1381,6 @@ nsCSSBorderRenderer::DrawBorders()
return;
}
// round mOuterRect and mInnerRect; they're already an integer
// number of pixels apart and should stay that way after
// rounding.
mOuterRect.Round();
mInnerRect.Round();
gfxMatrix mat = mContext->CurrentMatrix();
// Clamp the CTM to be pixel-aligned; we do this only
@ -1403,6 +1397,13 @@ nsCSSBorderRenderer::DrawBorders()
mat.x0 = floor(mat.x0 + 0.5);
mat.y0 = floor(mat.y0 + 0.5);
mContext->SetMatrix(mat);
// round mOuterRect and mInnerRect; they're already an integer
// number of pixels apart and should stay that way after
// rounding. We don't do this if there's a scale in the current transform
// since this loses information that might be relevant when we're scaling.
mOuterRect.Round();
mInnerRect.Round();
}
PRBool allBordersSameWidth = AllBordersSameWidth();