aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkStroke.h
Commit message (Collapse)AuthorAge
* Revert "Revert "SkTypes: extract SkTo""Gravatar Hal Canary2018-06-14
| | | | | | | | | | | | | | | | This reverts commit fdcfb8b7c23fbf18f872d2c31d27978235033876. > Original change's description: > > SkTypes: extract SkTo > > > > Change-Id: I8de790d5013db2105ad885fa2683303d7c250b09 > > Reviewed-on: https://skia-review.googlesource.com/133620 > > Reviewed-by: Mike Klein <mtklein@google.com> Change-Id: Ida74fbc5c21248a724a5edbf9fae18a33bcb23aa Reviewed-on: https://skia-review.googlesource.com/134506 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* Revert "SkTypes: extract SkTo"Gravatar Hal Canary2018-06-13
| | | | | | | | | | | | | | | | | | | | | | | This reverts commit 2a2f67592602b18527bc3fd449132d420cd5b62e. Reason for revert: this appears to be what is holding up the Chrome roll. Original change's description: > SkTypes: extract SkTo > > Change-Id: I8de790d5013db2105ad885fa2683303d7c250b09 > Reviewed-on: https://skia-review.googlesource.com/133620 > Reviewed-by: Mike Klein <mtklein@google.com> TBR=mtklein@google.com,halcanary@google.com No-Presubmit: true No-Tree-Checks: true No-Try: true Change-Id: Iafd738aedfb679a23c061a51afe4b98a8d4cdfae Reviewed-on: https://skia-review.googlesource.com/134504 Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* Remove SkBool8.Gravatar Ben Wagner2018-06-12
| | | | | | | | | | | | This typedef was created at a time when compilers often used sizeof(int) storage for a bool. This is no longer the case and in all compilers currently supported 'sizeof(bool) == 1'. Removing this also revealed one field which was actually not a bool but a tri-state enum. Change-Id: I9240ba457335ee3eff094d6d3f2520c1adf16960 Reviewed-on: https://skia-review.googlesource.com/134420 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* SkTypes: extract SkToGravatar Hal Canary2018-06-12
| | | | | | Change-Id: I8de790d5013db2105ad885fa2683303d7c250b09 Reviewed-on: https://skia-review.googlesource.com/133620 Reviewed-by: Mike Klein <mtklein@google.com>
* remove SK_LEGACY_STROKE_CURVESGravatar caryclark2015-05-22
| | | | | | | | | The change in Chrome has been landed so this guard is no longer needed. R=reed@google.com,fmalita@chromium.org BUG=102411 Review URL: https://codereview.chromium.org/1157623003
* flip stroke to chrome compatible defineGravatar caryclark2015-02-24
| | | | Review URL: https://codereview.chromium.org/932723003
* This uses quad approximations of the outer and inner paths describing a ↵Gravatar caryclark2015-02-20
| | | | | | | | | | stroke. Cubics and conics' thick strokes are approximated with quads as well. The approximation uses a similar error term as the fill scan converter to determine the number of quads to use. This also updates SampleApp QuadStroker test with conics, ovals, and stroked text. Review URL: https://codereview.chromium.org/932113002
* optional res-scale parameter to getFillPathGravatar reed2015-02-12
| | | | | | | | BUG=skia: NOTREECHECKS=True TBR= Review URL: https://codereview.chromium.org/911053005
* Draw more accurate thick-stroked Beziers (disabled)Gravatar caryclark2014-10-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2013-01-26
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@7406 2bbb7eff-a529-9590-31e7-b0007b416f81
* Follow up on the previous patch :Gravatar sugoi@google.com2012-12-17
| | | | | | | | | | | | | | | - Moved the SkStrokeRec class in its own file - Replaced SkStroke by SkStrokeRec in Ganesh - Moved path stroking to the Ganesh level in some cases (everytime it isn't required to do it directly in SkGpuDevice). PathEffect and MaskFilter still require path stroking at the SkGpuDevice for now. - Renamed static functions in SkPath with proper names * No functionality shold have changed with this patch. This is a step towards enabling Ganesh Path Renderers to decide whether or not to stroke the path rather than always receiving the stroked path as an input argument. BUG=chromium:135111 TEST=Try path rendering tests from the gm Review URL: https://codereview.appspot.com/6946072 git-svn-id: http://skia.googlecode.com/svn/trunk@6861 2bbb7eff-a529-9590-31e7-b0007b416f81
* As part of preliminary groundwork for a chromium fix, this changelist is ↵Gravatar sugoi@google.com2012-12-06
| | | | | | | | | | deprecating GrPathFill so that SkPath::FillType is used everywhere in order to remove some code duplication between Skia and Ganesh. BUG=chromium:135111 TEST=Try path rendering tests from the gm Review URL: https://codereview.appspot.com/6875058 git-svn-id: http://skia.googlecode.com/svn/trunk@6693 2bbb7eff-a529-9590-31e7-b0007b416f81
* use direction from isRect in strokeRect, and only stroke if it is closedGravatar reed@google.com2012-11-21
| | | | | | Review URL: https://codereview.appspot.com/6846086 git-svn-id: http://skia.googlecode.com/svn/trunk@6528 2bbb7eff-a529-9590-31e7-b0007b416f81
* add specialty strokeRect() to SkStroke, which can return much cleaner resultsGravatar reed@google.com2012-11-20
| | | | | | Review URL: https://codereview.appspot.com/6843093 git-svn-id: http://skia.googlecode.com/svn/trunk@6510 2bbb7eff-a529-9590-31e7-b0007b416f81
* recreate http://codereview.appspot.com/6131051/ in svn instead of gitGravatar epoger@google.com2012-05-03
Review URL: https://codereview.appspot.com/6181044 git-svn-id: http://skia.googlecode.com/svn/trunk@3829 2bbb7eff-a529-9590-31e7-b0007b416f81