Nigel Tao
f72412cfe3
vector: fix overflow when rasterizing a 30 degree line.
...
There are some obvious TODOs, but they will be follow-up commits.
This is about correctness, not performance, but for the record:
name old time/op new time/op delta
GlyphAlpha16Over-8 3.16µs ± 0% 3.38µs ± 0% +6.96% (p=0.000 n=9+10)
GlyphAlpha16Src-8 3.06µs ± 0% 3.28µs ± 0% +7.21% (p=0.000 n=10+10)
GlyphAlpha32Over-8 4.92µs ± 1% 5.23µs ± 1% +6.24% (p=0.000 n=10+10)
GlyphAlpha32Src-8 4.53µs ± 1% 4.83µs ± 0% +6.69% (p=0.000 n=10+10)
GlyphAlpha64Over-8 9.60µs ± 1% 10.21µs ± 0% +6.36% (p=0.000 n=10+10)
GlyphAlpha64Src-8 8.04µs ± 0% 8.68µs ± 1% +7.99% (p=0.000 n=9+10)
GlyphAlpha128Over-8 23.1µs ± 0% 24.2µs ± 1% +5.08% (p=0.000 n=9+10)
GlyphAlpha128Src-8 16.8µs ± 0% 18.0µs ± 1% +6.76% (p=0.000 n=10+10)
GlyphAlpha256Over-8 68.6µs ± 1% 70.3µs ± 0% +2.50% (p=0.000 n=10+10)
GlyphAlpha256Src-8 43.6µs ± 0% 45.4µs ± 0% +4.08% (p=0.000 n=10+8)
GlyphRGBA16Over-8 4.92µs ± 0% 5.14µs ± 0% +4.48% (p=0.000 n=9+9)
GlyphRGBA16Src-8 4.39µs ± 0% 4.59µs ± 0% +4.60% (p=0.000 n=8+9)
GlyphRGBA32Over-8 11.8µs ± 0% 12.2µs ± 1% +2.89% (p=0.000 n=9+10)
GlyphRGBA32Src-8 9.79µs ± 1% 10.03µs ± 0% +2.49% (p=0.000 n=10+7)
GlyphRGBA64Over-8 36.7µs ± 1% 37.5µs ± 1% +2.23% (p=0.000 n=10+10)
GlyphRGBA64Src-8 28.5µs ± 0% 29.1µs ± 0% +2.09% (p=0.000 n=10+10)
GlyphRGBA128Over-8 133µs ± 0% 135µs ± 0% +1.51% (p=0.000 n=10+9)
GlyphRGBA128Src-8 99.1µs ± 0% 100.5µs ± 1% +1.47% (p=0.000 n=9+10)
GlyphRGBA256Over-8 505µs ± 0% 511µs ± 0% +1.18% (p=0.000 n=9+10)
GlyphRGBA256Src-8 372µs ± 0% 374µs ± 0% +0.69% (p=0.000 n=9+10)
Change-Id: Ice1d77de5bc2649f8cd88366bcae3c00e78d65c2
Reviewed-on: https://go-review.googlesource.com/31113
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-10-14 22:25:13 +00:00
Nigel Tao
beb9675609
vector: fix overflow when rasterizing wide lines.
...
Change-Id: Iea92b74ca9533de2ef17534ee3acf4f40c3d03ef
Reviewed-on: https://go-review.googlesource.com/30899
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-10-14 02:01:44 +00:00
Nigel Tao
dc590effac
vector: add some accumulate tests.
...
Change-Id: I199e1637698572e36b4a3bb83d652baf0d76717f
Reviewed-on: https://go-review.googlesource.com/30110
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-10-05 23:42:26 +00:00
Nigel Tao
8a20735b0e
vector: sort benchmarks from slowest to fastest.
...
Change-Id: Ia6047f225c7ba4407fe831a49f90d4c74d203651
Reviewed-on: https://go-review.googlesource.com/29973
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-09-30 06:02:01 +00:00
Nigel Tao
0080ac3d2c
vector: add some more tests.
...
These tests are copied from the github.com/google/font-go prototype.
Change-Id: I4523193bd3453974633cbef0576c1203eb013a7d
Reviewed-on: https://go-review.googlesource.com/29697
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-09-25 03:45:43 +00:00
Nigel Tao
7ea36498ac
vector: allow dst and mask to have different strides.
...
Change-Id: If244dba2c681b11122a7a26b352f9411135f123f
Reviewed-on: https://go-review.googlesource.com/29696
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-09-25 02:48:45 +00:00
Nigel Tao
b077ed42b3
vector: implement arbitrary dst and src image types.
...
Change-Id: Ib0d0961c69cabc3bb01d7b1d244796f0f713b819
Reviewed-on: https://go-review.googlesource.com/29691
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-09-24 05:40:50 +00:00
Nigel Tao
50ce1ebf58
vector: add benchmarks.
...
Change-Id: I4946ccc3a915c7e9365cd5fe860da673a2270fbb
Reviewed-on: https://go-review.googlesource.com/29631
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-09-23 02:06:24 +00:00
Nigel Tao
cd8486aac9
vector: implement DrawOp == draw.Over.
...
Some "TODO: the general case" lines remain.
Change-Id: If66e484a00d5ea3fce9db37d4ee493739648daa3
Reviewed-on: https://go-review.googlesource.com/29495
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-09-23 01:58:13 +00:00
Nigel Tao
bb355ba442
vector: add CubeTo.
...
Change-Id: Ia64b5b077172303981538de99cc14c5bcc99a3e4
Reviewed-on: https://go-review.googlesource.com/28489
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-09-08 11:11:11 +00:00
Nigel Tao
714f2e47f7
vector: new package for rasterizing 2-D graphics.
...
Updates golang/go#16904
Change-Id: I4e11e4e859c007c3444655a227ac935c27f3f784
Reviewed-on: https://go-review.googlesource.com/28347
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-09-04 08:48:55 +00:00