Bug 1185636 - Remove hard stop workaround for Cairo due to regressions. r=jrmuizel

This commit is contained in:
Lee Salzman 2015-07-20 14:51:50 -04:00
parent 5699028cd0
commit 8f1d3691ab

View File

@ -525,23 +525,6 @@ GfxPatternToCairoPattern(const Pattern& aPattern,
matrix = &pattern.mMatrix;
const std::vector<GradientStop>& stops = cairoStops->GetStops();
if (stops.size() >= 2 && stops.front().offset == stops.back().offset) {
// Certain Cairo backends that use pixman to implement gradients can have jagged
// edges occur with hard stops. Such hard stops are used for implementing certain
// types of CSS borders. Work around this by turning these hard-stops into half-pixel
// gradients to anti-alias them. See bug 1033375
Matrix patternToDevice = aTransform * pattern.mMatrix;
Float gradLength = (patternToDevice * pattern.mEnd - patternToDevice * pattern.mBegin).Length();
if (gradLength > 0) {
Float aaOffset = 0.25 / gradLength;
CairoPatternAddGradientStop(pat, stops.front(), -aaOffset);
for (size_t i = 1; i < stops.size()-1; ++i) {
CairoPatternAddGradientStop(pat, stops[i]);
}
CairoPatternAddGradientStop(pat, stops.back(), aaOffset);
break;
}
}
for (size_t i = 0; i < stops.size(); ++i) {
CairoPatternAddGradientStop(pat, stops[i]);
}