]> Cypherpunks repositories - gostls13.git/commit
image/draw: add a fast path for Gray src images.
authorNigel Tao <nigeltao@golang.org>
Sat, 28 Feb 2015 04:46:01 +0000 (15:46 +1100)
committerNigel Tao <nigeltao@golang.org>
Sat, 28 Feb 2015 21:43:39 +0000 (21:43 +0000)
commitc20323d2bb44146c49f71f583a1f4a089360d062
treead42eaf59c47fa42e883987f1203b39b2697e871
parent05ca0f3370ce335fc69a85a837655b821a68a706
image/draw: add a fast path for Gray src images.

Grayscale PNG and JPEG images are not uncommon. We should have a fast path.

Also add a benchmark for the recently added CMYK fast path.

benchmark                    old ns/op     new ns/op     delta
BenchmarkGray                13960348      324152        -97.68%

Change-Id: I72b5838c8c3d1f2d0a4536a848e020e80b10c0f7
Reviewed-on: https://go-review.googlesource.com/6237
Reviewed-by: Rob Pike <r@golang.org>
src/image/draw/bench_test.go
src/image/draw/draw.go
src/image/draw/draw_test.go