mirror of
https://github.com/golang/go
synced 2024-11-02 13:42:29 +00:00
3a0cda43a4
This reverts a behavior change introduced in Go 1.18 (commit 9f69a443; CL 340049). In Go 1.17 and earlier, draw.Draw(etc, draw.Src) with image.NRGBA dst and src images would pass through a (heap allocated) color.Color interface value holding a color.NRGBA concrete value. Threading that color.NRGBA value all the way through preserves non-premultiplied alpha transparency information (distinguishing e.g. transparent blue from transparent red). CL 340049 optimized out that heap allocation (per pixel), calling new SetRGBA64At and RGBA64At methods instead. However, these methods (like the existing image/color Color.RGBA method) work in premultiplied alpha, so any distinction between transparent colors is lost. This commit re-introduces the preservation of distinct transparencies, when dst and src are both *image.NRGBA (or both *image.NRGBA64) and the op is draw.Src. Fixes #51893 Change-Id: Id9c64bfeeaecc458586f169f50b99d6c8aa52a7f Reviewed-on: https://go-review.googlesource.com/c/go/+/396795 Trust: Nigel Tao <nigeltao@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> |
||
---|---|---|
.. | ||
asm.html | ||
go1.17_spec.html | ||
go1.19.html | ||
go_mem.html | ||
go_spec.html |