Project: skia Issues People Development process History Sign in
New issue
Advanced search Search tips
Issue 2715 path bounds round inconsistently
Starred by 5 users Project Member Reported by caryclark@google.com, Jul 2 2014 Back to list
Status: Accepted
Owner:
Area: Geometry
Priority: Medium
Type: Defect



Sign in to add a comment
in the debugger, open "http___www_encros_fr_.skp" (attached)

in SkAAClip::Builder::addRun
 SkASSERT(fBounds.contains(x, y));
(lldb) p fBounds
(SkIRect) $2 = (fLeft = 16366, fTop = 1383, fRight = 16471, fBottom = 1399)
(lldb) p x
(int) $3 = 16365
(lldb) p y
(int) $4 = 1387

note that the path has large values plus 1/2

(lldb) up 3
frame #3: 0x00000001001397bb pathops_skpclip`sk_fill_path(path=0x0000000100f91690, clipRect=0x0000000000000000, blitter=0x0000000100f913e0, start_y=1383, stop_y=1399, shiftEdgesUp=0, clipRgn=0x00000001fc96fa08) + 1243 at SkScan_Path.cpp:504
(lldb) p path.dump()
path: forceClose=false
path.moveTo(16365.5f, 1394);
path.lineTo(16365.5f, 1387.5f);
path.quadTo(16365.5f, 1385.43f, 16367, 1383.96f);
path.quadTo(16368.4f, 1382.5f, 16370.5f, 1382.5f);
path.lineTo(16465.5f, 1382.5f);
path.quadTo(16467.6f, 1382.5f, 16469, 1383.96f);
path.quadTo(16470.5f, 1385.43f, 16470.5f, 1387.5f);
path.lineTo(16470.5f, 1394);
path.quadTo(16470.5f, 1396.07f, 16469, 1397.54f);
path.quadTo(16467.6f, 1399, 16465.5f, 1399);
path.lineTo(16370.5f, 1399);
path.quadTo(16368.4f, 1399, 16367, 1397.54f);
path.quadTo(16365.5f, 1396.07f, 16365.5f, 1394);
path.close();
 
http___www_encros_fr_.skp
207 KB Download
Project Member Comment 1 by hcm@google.com, Oct 14 2014
Labels: Area-Geometry
Project Member Comment 2 by hcm@google.com, Dec 7 2015
Labels: Hotlist-Fixit
Project Member Comment 3 by caryclark@google.com, Dec 22 2015
This repros the assert:

DEF_SIMPLE_GM(halfpathfill, canvas, 100, 100) {
    SkPaint paint;
    SkPath path;
    path.moveTo(16365.5f, 1394);
    path.lineTo(16365.5f, 1387.5f);
    path.quadTo(16365.5f, 1385.43f, 16367, 1383.96f);
    path.quadTo(16368.4f, 1382.5f, 16370.5f, 1382.5f);
    path.lineTo(16465.5f, 1382.5f);
    path.quadTo(16467.6f, 1382.5f, 16469, 1383.96f);
    path.quadTo(16470.5f, 1385.43f, 16470.5f, 1387.5f);
    path.lineTo(16470.5f, 1394);
    path.quadTo(16470.5f, 1396.07f, 16469, 1397.54f);
    path.quadTo(16467.6f, 1399, 16465.5f, 1399);
    path.lineTo(16370.5f, 1399);
    path.quadTo(16368.4f, 1399, 16367, 1397.54f);
    path.quadTo(16365.5f, 1396.07f, 16365.5f, 1394);
    path.close();
    canvas->translate(-16366, -1383);
    canvas->drawPath(path, paint);
}

The following revision refers to this bug:
  https://skia.googlesource.com/skia.git/+/6df611574a3cf8abf2617af0d03a5553bb17360d

commit 6df611574a3cf8abf2617af0d03a5553bb17360d
Author: caryclark <caryclark@google.com>
Date: Mon Jan 04 22:17:47 2016

handle halfway case in scan converter

Scan edges that start at exactly -0.5 aren't trimmed by
clipping or by rounding, triggering a debug assert.

One way to fix this is to round the top and left
down instead of up.

Also, move the path initialization of gm/composeshader.cpp
to make debugging other path problems easier.

R=reed@google.com
BUG=skia:2715
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1544873002

Review URL: https://codereview.chromium.org/1544873002

[modify] http://crrev.com/6df611574a3cf8abf2617af0d03a5553bb17360d/gm/composeshader.cpp
[modify] http://crrev.com/6df611574a3cf8abf2617af0d03a5553bb17360d/include/core/SkRect.h
[modify] http://crrev.com/6df611574a3cf8abf2617af0d03a5553bb17360d/src/core/SkScan_Path.cpp
[modify] http://crrev.com/6df611574a3cf8abf2617af0d03a5553bb17360d/tests/DrawPathTest.cpp

Sign in to add a comment