Changeset 246431 in webkit
- Timestamp:
- Jun 14, 2019, 1:02:54 AM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
platform/graphics/cairo/CairoOperations.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r246428 r246431 1 2019-06-14 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [cairo] Entering text into forms on github.com creates a trapezoid artifact 4 https://bugs.webkit.org/show_bug.cgi?id=126124 5 6 Reviewed by Michael Catanzaro. 7 8 Mixing antialiasing modes in the same clip is not actually supported by cairo. In the case of rectangle clips we 9 are already ignoring the current antialiasing to not do any antialiasing. We could do the opposite for clips 10 receiving a path, we want to enforce antialiasing in that case since the paths might contain curves. Doing that 11 we ensure all calls to clip with a path use the same antialiasing, which is the case of the github bug. 12 13 * platform/graphics/cairo/CairoOperations.cpp: 14 (WebCore::Cairo::doClipWithAntialias): Helper to call cairo_clip() with the given antialising mode. 15 (WebCore::Cairo::clip): Use doClipWithAntialias(). 16 (WebCore::Cairo::clipOut): Ditto. 17 (WebCore::Cairo::clipPath): Ditto. 18 1 19 2019-06-13 Myles C. Maxfield <mmaxfield@apple.com> 2 20 -
trunk/Source/WebCore/platform/graphics/cairo/CairoOperations.cpp
r244913 r246431 1252 1252 } 1253 1253 1254 static void doClipWithAntialias(cairo_t* cr, cairo_antialias_t antialias) 1255 { 1256 auto savedAntialiasRule = cairo_get_antialias(cr); 1257 cairo_set_antialias(cr, antialias); 1258 cairo_clip(cr); 1259 cairo_set_antialias(cr, savedAntialiasRule); 1260 } 1261 1254 1262 void clip(PlatformContextCairo& platformContext, const FloatRect& rect) 1255 1263 { … … 1263 1271 // when a transformation is applied to the GraphicsContext 1264 1272 // while drawing the transformed layer. 1265 cairo_antialias_t savedAntialiasRule = cairo_get_antialias(cr); 1266 cairo_set_antialias(cr, CAIRO_ANTIALIAS_NONE); 1267 cairo_clip(cr); 1273 doClipWithAntialias(cr, CAIRO_ANTIALIAS_NONE); 1268 1274 cairo_set_fill_rule(cr, savedFillRule); 1269 cairo_set_antialias(cr, savedAntialiasRule);1270 1275 1271 1276 if (auto* graphicsContextPrivate = platformContext.graphicsContextPrivate()) … … 1282 1287 cairo_fill_rule_t savedFillRule = cairo_get_fill_rule(cr); 1283 1288 cairo_set_fill_rule(cr, CAIRO_FILL_RULE_EVEN_ODD); 1284 cairo_clip(cr);1289 doClipWithAntialias(cr, CAIRO_ANTIALIAS_NONE); 1285 1290 cairo_set_fill_rule(cr, savedFillRule); 1286 1291 } … … 1296 1301 cairo_fill_rule_t savedFillRule = cairo_get_fill_rule(cr); 1297 1302 cairo_set_fill_rule(cr, CAIRO_FILL_RULE_EVEN_ODD); 1298 cairo_clip(cr); 1303 // Enforce default antialias when clipping paths, since they can contain curves. 1304 doClipWithAntialias(cr, CAIRO_ANTIALIAS_DEFAULT); 1299 1305 cairo_set_fill_rule(cr, savedFillRule); 1300 1306 } … … 1309 1315 cairo_fill_rule_t savedFillRule = cairo_get_fill_rule(cr); 1310 1316 cairo_set_fill_rule(cr, clipRule == WindRule::EvenOdd ? CAIRO_FILL_RULE_EVEN_ODD : CAIRO_FILL_RULE_WINDING); 1311 cairo_clip(cr); 1317 // Enforce default antialias when clipping paths, since they can contain curves. 1318 doClipWithAntialias(cr, CAIRO_ANTIALIAS_DEFAULT); 1312 1319 cairo_set_fill_rule(cr, savedFillRule); 1313 1320
Note:
See TracChangeset
for help on using the changeset viewer.