WebKit Bugzilla
Attachment 372057 Details for
Bug 126124
: [cairo] Entering text into forms on github.com creates a trapezoid artifact
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
wcore-clip-antialiasing.diff (text/plain), 4.12 KB, created by
Carlos Garcia Campos
on 2019-06-13 09:05:44 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Carlos Garcia Campos
Created:
2019-06-13 09:05:44 PDT
Size:
4.12 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index da8ea140b10..1b93fa64afe 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,21 @@ >+2019-06-13 Carlos Garcia Campos <cgarcia@igalia.com> >+ >+ [cairo] Entering text into forms on github.com creates a trapezoid artifact >+ https://bugs.webkit.org/show_bug.cgi?id=126124 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Mixing antialiasing modes in the same clip is not actually supported by cairo. In the case of rectangle clips we >+ are already ignoring the current antialiasing to not do any antialiasing. We could do the opposite for clips >+ receiving a path, we want to enforce antialiasing in that case since the paths might contain curves. Doing that >+ we ensure all calls to clip with a path use the same antialiasing, which is the case of the github bug. >+ >+ * platform/graphics/cairo/CairoOperations.cpp: >+ (WebCore::Cairo::doClipWithAntialias): Helper to call cairo_clip() with the given antialising mode. >+ (WebCore::Cairo::clip): Use doClipWithAntialias(). >+ (WebCore::Cairo::clipOut): Ditto. >+ (WebCore::Cairo::clipPath): Ditto. >+ > 2019-06-12 Antoine Quint <graouts@apple.com> > > [WHLSL] Hook up compute >diff --git a/Source/WebCore/platform/graphics/cairo/CairoOperations.cpp b/Source/WebCore/platform/graphics/cairo/CairoOperations.cpp >index fba54565a5a..68e46c80a06 100644 >--- a/Source/WebCore/platform/graphics/cairo/CairoOperations.cpp >+++ b/Source/WebCore/platform/graphics/cairo/CairoOperations.cpp >@@ -1251,6 +1251,14 @@ void endTransparencyLayer(PlatformContextCairo& platformContext) > cairo_paint_with_alpha(cr, platformContext.layers().takeLast()); > } > >+static void doClipWithAntialias(cairo_t* cr, cairo_antialias_t antialias) >+{ >+ auto savedAntialiasRule = cairo_get_antialias(cr); >+ cairo_set_antialias(cr, antialias); >+ cairo_clip(cr); >+ cairo_set_antialias(cr, savedAntialiasRule); >+} >+ > void clip(PlatformContextCairo& platformContext, const FloatRect& rect) > { > cairo_t* cr = platformContext.cr(); >@@ -1262,11 +1270,8 @@ void clip(PlatformContextCairo& platformContext, const FloatRect& rect) > // edge fringe artifacts may occur at the layer edges > // when a transformation is applied to the GraphicsContext > // while drawing the transformed layer. >- cairo_antialias_t savedAntialiasRule = cairo_get_antialias(cr); >- cairo_set_antialias(cr, CAIRO_ANTIALIAS_NONE); >- cairo_clip(cr); >+ doClipWithAntialias(cr, CAIRO_ANTIALIAS_NONE); > cairo_set_fill_rule(cr, savedFillRule); >- cairo_set_antialias(cr, savedAntialiasRule); > > if (auto* graphicsContextPrivate = platformContext.graphicsContextPrivate()) > graphicsContextPrivate->clip(rect); >@@ -1281,7 +1286,7 @@ void clipOut(PlatformContextCairo& platformContext, const FloatRect& rect) > cairo_rectangle(cr, rect.x(), rect.y(), rect.width(), rect.height()); > cairo_fill_rule_t savedFillRule = cairo_get_fill_rule(cr); > cairo_set_fill_rule(cr, CAIRO_FILL_RULE_EVEN_ODD); >- cairo_clip(cr); >+ doClipWithAntialias(cr, CAIRO_ANTIALIAS_NONE); > cairo_set_fill_rule(cr, savedFillRule); > } > >@@ -1295,7 +1300,8 @@ void clipOut(PlatformContextCairo& platformContext, const Path& path) > > cairo_fill_rule_t savedFillRule = cairo_get_fill_rule(cr); > cairo_set_fill_rule(cr, CAIRO_FILL_RULE_EVEN_ODD); >- cairo_clip(cr); >+ // Enforce default antialias when clipping paths, since they can contain curves. >+ doClipWithAntialias(cr, CAIRO_ANTIALIAS_DEFAULT); > cairo_set_fill_rule(cr, savedFillRule); > } > >@@ -1308,7 +1314,8 @@ void clipPath(PlatformContextCairo& platformContext, const Path& path, WindRule > > cairo_fill_rule_t savedFillRule = cairo_get_fill_rule(cr); > cairo_set_fill_rule(cr, clipRule == WindRule::EvenOdd ? CAIRO_FILL_RULE_EVEN_ODD : CAIRO_FILL_RULE_WINDING); >- cairo_clip(cr); >+ // Enforce default antialias when clipping paths, since they can contain curves. >+ doClipWithAntialias(cr, CAIRO_ANTIALIAS_DEFAULT); > cairo_set_fill_rule(cr, savedFillRule); > > if (auto* graphicsContextPrivate = platformContext.graphicsContextPrivate())
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
mcatanzaro
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 126124
:
219855
|
290312
|
306662
|
356938
|
372047
| 372057