Commit Graph

7 Commits

Author SHA1 Message Date
Nigel Tao
14bbbc8017 vector: add a fast path for RGBA dst images.
name                      old time/op  new time/op  delta
GlyphRGBA16Over-8         25.1µs ± 2%   6.0µs ± 0%  -76.09%  (p=0.000 n=10+10)
GlyphRGBA16Src-8          17.3µs ± 2%   5.4µs ± 0%  -68.68%  (p=0.000 n=10+10)
GlyphRGBA32Over-8         93.2µs ± 2%  14.5µs ± 0%  -84.41%  (p=0.000 n=10+10)
GlyphRGBA32Src-8          59.3µs ± 2%  12.4µs ± 0%  -79.04%    (p=0.000 n=9+9)
GlyphRGBA64Over-8          350µs ± 2%    45µs ± 0%  -87.21%    (p=0.000 n=9+9)
GlyphRGBA64Src-8           223µs ± 2%    37µs ± 0%  -83.58%    (p=0.000 n=9+9)
GlyphRGBA128Over-8        1.37ms ± 2%  0.16ms ± 1%  -88.19%   (p=0.000 n=9+10)
GlyphRGBA128Src-8          868µs ± 2%   128µs ± 0%  -85.21%   (p=0.000 n=10+9)
GlyphRGBA256Over-8        5.50ms ± 3%  0.59ms ± 0%  -89.31%  (p=0.000 n=10+10)
GlyphRGBA256Src-8         3.47ms ± 2%  0.45ms ± 0%  -86.91%   (p=0.000 n=9+10)

Change-Id: I3df60e6b7147872367715361c9d1ed52951b22e0
Reviewed-on: https://go-review.googlesource.com/29699
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-09-27 04:00:57 +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
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