skia2/gm
schenney@chromium.org 4da06ab335 Modifying SkPath to store all verbs provided by the user, and to give
correct results for all stroke and fill modes even on the various types
of degenerate paths.

The goals of this patch include:
1. Have Skia store all of the verbs implied by path construction methods, even
if those define degenerate paths. The SVG implementation in WebKit, which is
backed by Skia, needs to know about all elements of the path, even degenerate
ones, for the correct drawing of markers and line caps. For example, in SVG you
should be able to draw a scatter plot by specifying a marker for vertices and
then giving a sequence of moveTo commands. Skia will not store the moveTos,
requiring a different storage mechanism.

2. Assuming 1, maintain the current Skia behavior. That is, make Skia robust to
degenerate paths.

3. Fix an existing bug in Skia where a degenerate moveTo-lineTo pair spits out
warnings from rasterization and produces incorrect results in inverse-fill
renderings.

4. Adds extensive testing for degenerate paths and path rendering in general.

To meet these goals, the patch I am proposing will result in minor additional
storage for degenerate paths (a few bytes per degenerate path, only if the user
defines such paths). There is also some additional overhead in the iteration
code, with the path now cleaned to remove degenerate segments as part of the
iteration process. I suspect this will also fix issues with computing normal
vectors to degenerate segments. Benchmarking suggests that this change may
result in slightly (< 1%) slower path drawing due to the checks for
degeneracy. This overhead could be removed (in fact, a significant speedup
could occur) if the results of iterating to clean up the path were cached.
This would cost memory, of course, and quite a bit of it.

BUG=398
TEST=tests/PathTest.cpp
     gm/cubicpaths.cpp
     gm/degeneratesegments.cpp
     gm/movepaths.cpp
     gm/linepaths.cpp
     gm/quadpaths.cpp
Review URL: http://codereview.appspot.com/5482051

git-svn-id: http://skia.googlecode.com/svn/trunk@2901 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-12-20 15:14:18 +00:00
..
aarectmodes.cpp Fix warnings 2011-11-23 15:01:08 +00:00
arithmode.cpp fix positioning for scalar=fixed, still need to fix actual mode 2011-12-12 22:15:18 +00:00
bitmapcopy.cpp When a bitmap is texture-backed, change SkBitmap::copyTo() to do a deep 2011-12-02 19:11:17 +00:00
bitmapfilters.cpp Import all GMs as Samples. 2011-10-31 14:18:20 +00:00
bitmapscroll.cpp Import all GMs as Samples. 2011-10-31 14:18:20 +00:00
blurs.cpp Import all GMs as Samples. 2011-10-31 14:18:20 +00:00
complexclip2.cpp Import all GMs as Samples. 2011-10-31 14:18:20 +00:00
complexclip.cpp change to complexclip_bw and complexclip_aa, adding more combinations as well 2011-12-08 16:18:29 +00:00
cubicpaths.cpp Modifying SkPath to store all verbs provided by the user, and to give 2011-12-20 15:14:18 +00:00
degeneratesegments.cpp Modifying SkPath to store all verbs provided by the user, and to give 2011-12-20 15:14:18 +00:00
drawbitmaprect.cpp [GPU] tile when large bitmap pased drawBitmap and only a small fraction is used 2011-11-30 14:13:48 +00:00
emptypath.cpp Import all GMs as Samples. 2011-10-31 14:18:20 +00:00
filltypes.cpp Import all GMs as Samples. 2011-10-31 14:18:20 +00:00
filltypespersp.cpp Setting perspective in fixed point. 2011-10-07 21:55:56 +00:00
fontscaler.cpp Add font scaler gm. 2011-11-07 16:33:40 +00:00
gm.cpp Import all GMs as Samples. 2011-10-31 14:18:20 +00:00
gm.h add getBGColor() getter 2011-12-06 16:15:42 +00:00
gmmain.cpp Fix issue where bumping the max gm width/height affects gpu images 2011-11-30 16:57:21 +00:00
gradients.cpp Import all GMs as Samples. 2011-10-31 14:18:20 +00:00
gradtext.cpp enable shadermask optimization all the time 2011-11-30 14:29:55 +00:00
hairmodes.cpp Import all GMs as Samples. 2011-10-31 14:18:20 +00:00
imageblur.cpp This change makes SkImageFilter and SkBlurImageFilter flattenable/unflattenable. 2011-11-16 18:20:47 +00:00
lcdtext.cpp Import all GMs as Samples. 2011-10-31 14:18:20 +00:00
linepaths.cpp Modifying SkPath to store all verbs provided by the user, and to give 2011-12-20 15:14:18 +00:00
movepaths.cpp Modifying SkPath to store all verbs provided by the user, and to give 2011-12-20 15:14:18 +00:00
ninepatchstretch.cpp Import all GMs as Samples. 2011-10-31 14:18:20 +00:00
nocolorbleed.cpp Import all GMs as Samples. 2011-10-31 14:18:20 +00:00
pathfill.cpp Import all GMs as Samples. 2011-10-31 14:18:20 +00:00
points.cpp Import all GMs as Samples. 2011-10-31 14:18:20 +00:00
poly2poly.cpp Import all GMs as Samples. 2011-10-31 14:18:20 +00:00
quadpaths.cpp Modifying SkPath to store all verbs provided by the user, and to give 2011-12-20 15:14:18 +00:00
shadertext.cpp Import all GMs as Samples. 2011-10-31 14:18:20 +00:00
shadows.cpp Import all GMs as Samples. 2011-10-31 14:18:20 +00:00
shapes.cpp Import all GMs as Samples. 2011-10-31 14:18:20 +00:00
strokerects.cpp Import all GMs as Samples. 2011-10-31 14:18:20 +00:00
strokes.cpp Import all GMs as Samples. 2011-10-31 14:18:20 +00:00
texdata.cpp Access sampler matrices directly, cleanup GrSamplerState::reset()s 2011-12-12 18:45:07 +00:00
tilemodes.cpp Import all GMs as Samples. 2011-10-31 14:18:20 +00:00
tinybitmap.cpp Import all GMs as Samples. 2011-10-31 14:18:20 +00:00
verttext.cpp update verttext to remove leading space from image name 2011-11-30 14:58:16 +00:00
xfermodes.cpp can't pass const to setPixels :( 2011-12-20 14:35:32 +00:00