History log of /external/skia/tests/StrokerTest.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
f9d610179d7d4198b57b12d06f8d1ca09f580df3 15-Dec-2014 scroggo <scroggo@google.com> There can be only one (SkRandom)!

Remove SkLCGRandom. We already decided the new one was better, which is
why we wrote the new SkRandom.

Convert GMs that were using SkLCGRandom to use the improved SkRandom.
Motivated by the fact that these GMs draw differently on some runs. We
believe this to be a result of using the old SkLCGRandom.

Add each of the tests that were using SkLCGRandom to ignore-tests.txt,
since we expect they'll draw differently using SkRandom.

Move a trimmed down version of SkLCGRandom into SkDiscretePathEffect.
In order to preserve the old behavior, trim down SkLCGRandom to only
the methods used by SkDiscretePathEffect, and hide it in
SkDiscretePathEffect's cpp file.

BUG=skia:3241

Review URL: https://codereview.chromium.org/805963002
/external/skia/tests/StrokerTest.cpp
99d5915a02817659a0eec9f5addfdcf0a03d1aa2 09-Oct-2014 caryclark <caryclark@google.com> rename command line flag to avoid conflict, use very verbose

TBR=
NOTRY=true
NOTREECHECKS=true

Review URL: https://codereview.chromium.org/645573003
/external/skia/tests/StrokerTest.cpp
a9c56525f32ee0075ed8dbaff3a032b7abeed4ae 09-Oct-2014 caryclark <caryclark@google.com> try again to fix ios build

TBR=
NOTRY=true
NOTREECHECKS=true

Review URL: https://codereview.chromium.org/638403002
/external/skia/tests/StrokerTest.cpp
ff9fc4e4c9f54e675a3ce1a0124debca33b46e1b 09-Oct-2014 caryclark <caryclark@google.com> fix ios build

NOTREECHECKS=true
NOTRY=true
TBR=

Review URL: https://codereview.chromium.org/641063002
/external/skia/tests/StrokerTest.cpp
feff7d2d7719f52c7ea52db156003e609002bf04 09-Oct-2014 caryclark <caryclark@google.com> Draw more accurate thick-stroked Beziers (disabled)

Draw thick-stroked Beziers by computing the outset quadratic, measuring the error, and subdividing until the error is within a predetermined limit.

To try this CL out, change src/core/SkStroke.h:18 to

#define QUAD_STROKE_APPROXIMATION 1

or from the command line: CPPFLAGS="-D QUAD_STROKE_APPROXIMATION=1" ./gyp_skia

Here's what's in this CL:

bench/BezierBench.cpp : a microbench for examining where the time is going
gm/beziers.cpp : random Beziers with various thicknesses
gm/smallarc.cpp : a distillation of bug skia:2769
samplecode/SampleRotateCircles.cpp : controls added for error, limit, width
src/core/SkStroke.cpp : the new stroke implementation (disabled)
tests/StrokerTest.cpp : a stroke torture test that checks normal and extreme values

The new stroke algorithm has a tweakable parameter:

stroker.setError(1); (SkStrokeRec.cpp:112)

The stroke error is the allowable gap between the midpoint of the stroke quadratic and the center Bezier. As the projection from the quadratic approaches the endpoints, the error is decreased proportionally so that it is always inside the quadratic curve.

An overview of how this works:
- For a given T range of a Bezier, compute the perpendiculars and find the points outset and inset for some radius.
- Construct tangents for the quadratic stroke.
- If the tangent don't intersect between them (may happen with cubics), subdivide.
- If the quadratic stroke end points are close (again, may happen with cubics), draw a line between them.
- Compute the quadratic formed by the intersecting tangents.
- If the midpoint of the quadratic is close to the midpoint of the Bezier perpendicular, return the quadratic.
- If the end of the stroke at the Bezier midpoint doesn't intersect the quad's bounds, subdivide.
- Find where the Bezier midpoint ray intersects the quadratic.
- If the intersection is too close to the quad's endpoints, subdivide.
- If the error is large proportional to the intersection's distance to the quad's endpoints, subdivide.

BUG=skia:723,skia:2769

Review URL: https://codereview.chromium.org/558163005
/external/skia/tests/StrokerTest.cpp