some redesign
This commit is contained in:
@@ -21,11 +21,11 @@ func Render(img image.Image, rect image.Rectangle) image.Image {
|
||||
func BenchmarkScale(b *testing.B) {
|
||||
for i := 0; i < b.N; i++ {
|
||||
err := png.Encode(io.Discard,
|
||||
Scale(Render(
|
||||
Scale(64, Render(
|
||||
texture.New(color.White,
|
||||
color.Black, 2),
|
||||
image.Rect(0, 0, 64, 64),
|
||||
), 64),
|
||||
)),
|
||||
)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
@@ -51,7 +51,7 @@ func (s SinglePixel) Bounds() image.Rectangle {
|
||||
func BenchmarkSinglePixel(b *testing.B) {
|
||||
instance := SinglePixel{}
|
||||
err := png.Encode(io.Discard,
|
||||
Scale(instance, b.N),
|
||||
Scale(b.N, instance),
|
||||
)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
||||
Reference in New Issue
Block a user