Commit Graph

6 Commits

Author SHA1 Message Date
John Stiles
7571f9e490 Replace 'typedef xxxxx INHERITED' with 'using INHERITED = xxxx;'.
Mechanically updated via Xcode "Replace Regular Expression":

  typedef (.*) INHERITED;
    -->
  using INHERITED = $1;

The ClangTidy approach generated an even larger CL which would have
required a significant amount of hand-tweaking to be usable.

Change-Id: I671dc9d9efdf6d60151325c8d4d13fad7e10a15b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314999
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-09-03 03:41:26 +00:00
Tyler Denniston
4ccdaf6f2d Show mirror drawn with SkStroke (toy stroker)
Improves the sample slide to draw the skeleton geometry, and a mirror
image of the current path with Skia's stroker, which makes it easier to
compare.

Change-Id: I804f4304aec6025112c8ccac3bb61139559022f5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305184
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2020-07-22 18:49:20 +00:00
Tyler Denniston
baa2a7bdd2 Add path recorder class (toy stroker)
This will be used to add undo support (removing verbs and their points),
which SkPath and SkPathBuilder don't have right now.

Also did away with an unnecessary pointer indirection.

Change-Id: Iec42af8b7a69aabe1496266aaa70ddc7b4e907bf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305181
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2020-07-22 18:15:40 +00:00
Tyler Denniston
e9ced4f3da Elide inner loop geometry sometimes (toy stroker)
Many times a pair of stroked line segments doesn't actually require the
inner "loop" geometry. I think I've classified where it's required into
two cases.

This CL checks for the two cases where it is necessary, and skips adding
the extra geometry if not necessary. Requires a few extra
multiplications.

Change-Id: I421e2365523c8f5b5c190b5493cbe0e0d3d3a6c0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305017
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2020-07-22 14:02:28 +00:00
Tyler Denniston
f219aadebc Add inner loop geometry to miter join for toy stroker
Now the miter join matches SkStroke, adding the extra inner loop
geometry always. Next will be the harder part, which is figuring out how
to get rid of it!

Also fixed a CW/CCW rotation inconsistency to match SkStroke

Change-Id: Ie3d164053fd5683f3b678bb80f8421dc6dc48cd7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304809
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Auto-Submit: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2020-07-21 20:51:48 +00:00
Tyler Denniston
324578b553 Add toy stroker sample
I figure we can use this as an area for prototyping new/different
stroker ideas.

Currently the sample does line segments with butt caps. Miter joins
aren't correct, as it's not adding the inner loop geometry that
SkPathStroker does.  On the sample slide, any red pixels are ones that
Skia filled but the toy stroker didn't.

Change-Id: Iea5eb320d88dd1dc5c60fbb2a997f56eec4f4f1f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303588
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2020-07-21 20:04:58 +00:00