1
0
mirror of https://github.com/golang/go synced 2024-11-20 03:54:40 -07:00

drawGlyphOver optimization.

Timings (as for change 1122043) go from 49ms to 48ms ish. It's
mostly lost in the noise, but it probably doesn't hurt.

R=r
CC=golang-dev
https://golang.org/cl/1179041
This commit is contained in:
Nigel Tao 2010-05-11 13:35:16 +10:00
parent d7a6d22852
commit 916426ea76

View File

@ -167,10 +167,11 @@ func drawGlyphOver(dst *image.RGBA, r Rectangle, src image.ColorImage, mask *ima
continue
}
ma |= ma << 8
dr := uint32(dst.Pixel[y][x].R)
dg := uint32(dst.Pixel[y][x].G)
db := uint32(dst.Pixel[y][x].B)
da := uint32(dst.Pixel[y][x].A)
rgba := dst.Pixel[y][x]
dr := uint32(rgba.R)
dg := uint32(rgba.G)
db := uint32(rgba.B)
da := uint32(rgba.A)
// dr, dg, db and da are all 8-bit color at the moment, ranging in [0,255].
// We work in 16-bit color, and so would normally do:
// dr |= dr << 8