]> Cypherpunks repositories - gostls13.git/commit
exp/draw: fast paths for drawing a YCbCr or an NRGBA onto an RGBA.
authorNigel Tao <nigeltao@golang.org>
Wed, 4 May 2011 17:17:53 +0000 (10:17 -0700)
committerNigel Tao <nigeltao@golang.org>
Wed, 4 May 2011 17:17:53 +0000 (10:17 -0700)
commit13f08cd807732f3ec2733e485476e509cc6e3fd2
tree3a447baeb18d2d82643a1d355984c3e1fc19fe7a
parente31272aa054517c84751f4ed50b1238e1761464c
exp/draw: fast paths for drawing a YCbCr or an NRGBA onto an RGBA.

On my laptop, I had an 800x600 jpeg and an 800x600 png (with
transparency). I timed how long it took to draw each image onto an
equivalently sized, zeroed RGBA image.

Previously, the jpeg took 75ms and the png took 70ms, going through
the medium-fast path, i.e. func drawRGBA in draw.go.

After this CL, the jpeg took 14ms, and the png took 21ms with the
Over operator and 12ms with the Src operator.

It's only a rough estimate basd on one image file, but it should
give an idea of the order of magnitude of improvement.

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