From 3b25289a181e57585fe34484d6f698fcc135153f Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 27 May 2017 22:28:14 +0900 Subject: [PATCH] graphics: Add BenchmarkDrawImage --- image_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/image_test.go b/image_test.go index 3358bc2bf..47737532f 100644 --- a/image_test.go +++ b/image_test.go @@ -576,3 +576,12 @@ func TestImageEdge(t *testing.T) { } } } + +func BenchmarkDrawImage(b *testing.B) { + img0, _ := NewImage(16, 16, FilterNearest) + img1, _ := NewImage(16, 16, FilterNearest) + op := &DrawImageOptions{} + for i := 0; i < b.N; i++ { + img0.DrawImage(img1, op) + } +}