summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/golang/freetype/truetype/face_test.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2018-04-16 05:37:14 -0700
committerJoram Wilander <jwawilander@gmail.com>2018-04-16 08:37:14 -0400
commit6e2cb00008cbf09e556b00f87603797fcaa47e09 (patch)
tree3c0eb55ff4226a3f024aad373140d1fb860a6404 /vendor/github.com/golang/freetype/truetype/face_test.go
parentbf24f51c4e1cc6286885460672f7f449e8c6f5ef (diff)
downloadchat-6e2cb00008cbf09e556b00f87603797fcaa47e09.tar.gz
chat-6e2cb00008cbf09e556b00f87603797fcaa47e09.tar.bz2
chat-6e2cb00008cbf09e556b00f87603797fcaa47e09.zip
Depenancy upgrades and movign to dep. (#8630)
Diffstat (limited to 'vendor/github.com/golang/freetype/truetype/face_test.go')
-rw-r--r--vendor/github.com/golang/freetype/truetype/face_test.go48
1 files changed, 0 insertions, 48 deletions
diff --git a/vendor/github.com/golang/freetype/truetype/face_test.go b/vendor/github.com/golang/freetype/truetype/face_test.go
deleted file mode 100644
index 856581dff..000000000
--- a/vendor/github.com/golang/freetype/truetype/face_test.go
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2015 The Freetype-Go Authors. All rights reserved.
-// Use of this source code is governed by your choice of either the
-// FreeType License or the GNU General Public License version 2 (or
-// any later version), both of which can be found in the LICENSE file.
-
-package truetype
-
-import (
- "image"
- "image/draw"
- "io/ioutil"
- "strings"
- "testing"
-
- "golang.org/x/image/font"
- "golang.org/x/image/math/fixed"
-)
-
-func BenchmarkDrawString(b *testing.B) {
- data, err := ioutil.ReadFile("../licenses/gpl.txt")
- if err != nil {
- b.Fatal(err)
- }
- lines := strings.Split(string(data), "\n")
- data, err = ioutil.ReadFile("../testdata/luxisr.ttf")
- if err != nil {
- b.Fatal(err)
- }
- f, err := Parse(data)
- if err != nil {
- b.Fatal(err)
- }
- dst := image.NewRGBA(image.Rect(0, 0, 800, 600))
- draw.Draw(dst, dst.Bounds(), image.White, image.ZP, draw.Src)
- d := &font.Drawer{
- Dst: dst,
- Src: image.Black,
- Face: NewFace(f, nil),
- }
- b.ReportAllocs()
- b.ResetTimer()
- for i := 0; i < b.N; i++ {
- for j, line := range lines {
- d.Dot = fixed.P(0, (j*16)%600)
- d.DrawString(line)
- }
- }
-}