mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1185636 - Remove hard stop workaround for Cairo due to regressions. r=jrmuizel
This commit is contained in:
parent
5699028cd0
commit
8f1d3691ab
@ -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]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user