]> Cypherpunks repositories - gostls13.git/commit
Fast-ish path for drawing onto an image.RGBA destination.
authorNigel Tao <nigeltao@golang.org>
Thu, 20 May 2010 20:57:18 +0000 (13:57 -0700)
committerNigel Tao <nigeltao@golang.org>
Thu, 20 May 2010 20:57:18 +0000 (13:57 -0700)
commitefda3aba10305754ddbf72ba85a7b6ff05c1c9d1
treed290ad8e25e9899523dd95fa38433ae54d0f84c8
parent37a6adf1d376dc3331b01dc59eed718c9ec2316c
Fast-ish path for drawing onto an image.RGBA destination.

Time to draw.Draw a 200x200 image fell from 18.4ms (and 1 malloc) to
5.6ms (and 0 mallocs). It's still relatively slow since it assumes
nothing about the src or mask images, but it does remove the malloc.
There are existing faster, more specialized paths for copies, fills
and image glyph masks.

Also added a "compare to a slow but obviously correct implementation"
check to draw_test.go.

R=rsc, r
CC=golang-dev
https://golang.org/cl/1223044
src/pkg/exp/draw/draw.go
src/pkg/exp/draw/draw_test.go