]> Cypherpunks repositories - gostls13.git/commit
image/draw: rename and reorder some benchmarks
authorNigel Tao <nigeltao@golang.org>
Wed, 27 Oct 2021 03:24:37 +0000 (14:24 +1100)
committerNigel Tao <nigeltao@golang.org>
Sun, 31 Oct 2021 08:29:02 +0000 (08:29 +0000)
commit8e3d5f0bb324eebb92cc93264a63afa7ded9ab9a
tree3a7c961d8817154ef9af60be59e55c9c02a465e9
parent0bef30d28ac0b9654e5daef0fef731d7a9495214
image/draw: rename and reorder some benchmarks

The intention is for BenchmarkFooBar functions to map 1:1 to drawFooBar
functions. Recent draw.go changes have added more drawFooBar functions
and have further modified the mapping, as fallback drawFooBar functions
aren't invoked as often as they used to.

This commit restores the 1:1 mapping and reorganizes the BenchmarkFooBar
functions in the same order as the matching drawFooBar functions appear.

Also modify a TestDraw test case from vgradGreen(255) = {0, 136, 0, 255}
to vgradGreen(90) = {0, 48, 0, 90}. Doing so matches the existing "The
source pixel is {0, 48, 0, 90}" comment but also makes for a more
interesting test case, as the source pixel is no longer fully opaque.
Fully opaque is already covered by the vgradGray() test case on the next
line.

Also fix a "variable source" comment copy-pasto when the source image is
actually uniform, not variable.

Also add a func DrawMask type switch comment about interface types.

Change-Id: I828e71f2ee8ec617f523c8aafb118fb7ba166876
Reviewed-on: https://go-review.googlesource.com/c/go/+/358974
Trust: Nigel Tao <nigeltao@golang.org>
Trust: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Nigel Tao <nigeltao@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/image/draw/bench_test.go
src/image/draw/draw.go
src/image/draw/draw_test.go