Bug 16182 - SVG should disable antialiasing for shape-rendering="crispEdges"
Summary: SVG should disable antialiasing for shape-rendering="crispEdges"
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL: http://www.w3.org/TR/SVG/painting.htm...
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-29 00:26 PST by Eric Seidel (no email)
Modified: 2009-01-19 18:11 PST (History)
1 user (show)

See Also:


Attachments
First attempt (31.78 KB, patch)
2007-12-09 07:10 PST, Rob Buis
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2007-11-29 00:26:45 PST
SVG should disable antialiasing for shape-rendering="crispEdges"

We don't support the shape-rendering property yet, but we really should.  crispEdges is actually really useful for the implicit "align to device pixels" behavior.
Comment 1 Rob Buis 2007-12-09 07:10:06 PST
Created attachment 17803 [details]
First attempt

The patch should do it. Not sure whether we only need the pixel result though. I only implemented it for mac and qt and tried to add empty stubs for the others.
Cheers,

Rob.
Comment 2 Darin Adler 2007-12-10 02:13:12 PST
Comment on attachment 17803 [details]
First attempt

Looks fine, r=me
Comment 3 Eric Seidel (no email) 2007-12-10 11:31:24 PST
This looks great... my question to you though is how nice does the rendered result look?  (I can check myself next time I build.)

We might end up making a more sophisticated rule in the end:

crispEdges
Indicates that the user agent shall attempt to emphasize the contrast between clean edges of artwork over rendering speed and geometric precision. To achieve crisp edges, the user agent might turn off anti-aliasing for all lines and curves or possibly just for straight lines which are close to vertical or horizontal. Also, the user agent might adjust line positions and line widths to align edges with device pixels.
Comment 4 Rob Buis 2007-12-10 12:15:11 PST
Landed in r28588.
Comment 5 Simon Fraser (smfr) 2009-01-19 16:59:32 PST
Why did this patch add GraphicsContext::setUseAntialiasing() when it already has:

        void setShouldAntialias(bool);
        bool shouldAntialias() const;
?

Filed bug 23425 to clean this up.
Comment 6 Eric Seidel (no email) 2009-01-19 18:11:54 PST
(In reply to comment #5)
> Why did this patch add GraphicsContext::setUseAntialiasing() when it already
> has:
> 
>         void setShouldAntialias(bool);
>         bool shouldAntialias() const;
> ?
> 
> Filed bug 23425 to clean this up.

Wow, this is old.  I think at the time those values only applied to text.  But maybe I'm remembering wrong.