From 5c9b9ef6cbbbb077dc8d3daf8ff1bdf1acb8786c Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Tue, 27 Dec 2016 01:57:36 +0900 Subject: [PATCH] graphics: Add BenchmarkCopyImageNRGBA --- internal/graphics/image_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/internal/graphics/image_test.go b/internal/graphics/image_test.go index c2cebad07..7ebde1b14 100644 --- a/internal/graphics/image_test.go +++ b/internal/graphics/image_test.go @@ -83,6 +83,14 @@ func BenchmarkCopyImageRGBA(b *testing.B) { } } +func BenchmarkCopyImageNRGBA(b *testing.B) { + img := image.NewNRGBA(image.Rect(0, 0, 4096, 4096)) + b.ResetTimer() + for i := 0; i < b.N; i++ { + CopyImage(img) + } +} + func BenchmarkCopyImagePaletted(b *testing.B) { img := image.NewPaletted(image.Rect(0, 0, 4096, 4096), palette.Plan9) b.ResetTimer()