New issue
Advanced search Search tips
Starred by 4 users

Issue metadata

Status: Accepted
Owner: ----
Cc:
Area: ----
Priority: Icebox
Type: Defect



Sign in to add a comment

antialiased stroke-rects that are thin draw wrong

Project Member Reported by reed@google.com, Jun 25 2013

Issue description

if the strokeSize is < 1 in antialaising, SkScan::AntiFrameRect may draw wrongly (potentially twice on the same pixels).

SkScan::AntiFrameRect wants to draw in 3 stages:
1. skim the outer rect of the frame, computing partial coverage
2. fill in the sides/top/bottom with solid depending on how thick the stroke is
3. skim the inner rect of the frame, computing partial coverage

For thin rects, #2 is correctly skipped, but we still do #1 AND #3. We need to detect when the stroke lies wholly within 1 pixel, and just skim it once, merging the coverage of the inner and outer rect.

 
Project Member

Comment 1 by hcm@google.com, Dec 7 2015

Labels: Hotlist-Fixit
Project Member

Comment 2 by caryclark@google.com, Feb 26 2016

Owner: caryclark@google.com
will investigate
Project Member

Comment 3 by caryclark@google.com, Sep 5

Project Member

Comment 4 by caryclark@google.com, Sep 5

Labels: -Priority-Medium Priority-Icebox
Owner: ----
Here's a better fiddle that shows the current result on CPU / GPU

https://fiddle.skia.org/c/0d17450ca4fb51423d09a868548e0838

(screen captures are attached in case the behavior changes)

Of note:
- raster at .3 .4 .5 .6 .7 look the same
- gpu at .3 .4 .5 .6 .7 have same geometry but different darkness
- raster at .7 flips artifacts compared to .8

Also, the original description may be no longer relevant.
Moving to icebox, since this is probably good enough for now.
gputhinframe.png
1.8 KB View Download
rasterthinframe.png
2.3 KB View Download

Sign in to add a comment