From b84736e9b6401df0c6eeab9950bef09458a6aefd Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Fri, 29 Sep 2017 12:46:30 -0700 Subject: Updating server dependancies. (#7538) --- vendor/golang.org/x/image/README | 3 - vendor/golang.org/x/image/README.md | 17 ++++ .../golang.org/x/image/vector/raster_floating.go | 42 ++++++---- vendor/golang.org/x/image/vector/vector_test.go | 97 ++++++++++++---------- 4 files changed, 98 insertions(+), 61 deletions(-) delete mode 100644 vendor/golang.org/x/image/README create mode 100644 vendor/golang.org/x/image/README.md (limited to 'vendor/golang.org/x/image') diff --git a/vendor/golang.org/x/image/README b/vendor/golang.org/x/image/README deleted file mode 100644 index 462038079..000000000 --- a/vendor/golang.org/x/image/README +++ /dev/null @@ -1,3 +0,0 @@ -This repository holds supplementary Go image libraries. - -To submit changes to this repository, see http://golang.org/doc/contribute.html. diff --git a/vendor/golang.org/x/image/README.md b/vendor/golang.org/x/image/README.md new file mode 100644 index 000000000..0a312b4c1 --- /dev/null +++ b/vendor/golang.org/x/image/README.md @@ -0,0 +1,17 @@ +# Go Images + +This repository holds supplementary Go image libraries. + +## Download/Install + +The easiest way to install is to run `go get -u golang.org/x/image`. You can +also manually git clone the repository to `$GOPATH/src/golang.org/x/image`. + +## Report Issues / Send Patches + +This repository uses Gerrit for code changes. To learn how to submit changes to +this repository, see https://golang.org/doc/contribute.html. + +The main issue tracker for the image repository is located at +https://github.com/golang/go/issues. Prefix your issue with "x/image:" in the +subject line, so it is easy to find. diff --git a/vendor/golang.org/x/image/vector/raster_floating.go b/vendor/golang.org/x/image/vector/raster_floating.go index 143b376b5..fd11db1b4 100644 --- a/vendor/golang.org/x/image/vector/raster_floating.go +++ b/vendor/golang.org/x/image/vector/raster_floating.go @@ -54,13 +54,25 @@ func (z *Rasterizer) floatingLineTo(bx, by float32) { for ; y < yMax; y++ { dy := floatingMin(float32(y+1), by) - floatingMax(float32(y), ay) - xNext := x + dy*dxdy + + // The "float32" in expressions like "float32(foo*bar)" here and below + // look redundant, since foo and bar already have type float32, but are + // explicit in order to disable the compiler's Fused Multiply Add (FMA) + // instruction selection, which can improve performance but can result + // in different rounding errors in floating point computations. + // + // This package aims to have bit-exact identical results across all + // GOARCHes, and across pure Go code and assembly, so it disables FMA. + // + // See the discussion at + // https://groups.google.com/d/topic/golang-dev/Sti0bl2xUXQ/discussion + xNext := x + float32(dy*dxdy) if y < 0 { x = xNext continue } buf := z.bufF32[y*width:] - d := dy * dir + d := float32(dy * dir) x0, x1 := x, xNext if x > xNext { x0, x1 = x1, x0 @@ -71,48 +83,48 @@ func (z *Rasterizer) floatingLineTo(bx, by float32) { x1Ceil := float32(x1i) if x1i <= x0i+1 { - xmf := 0.5*(x+xNext) - x0Floor + xmf := float32(0.5*(x+xNext)) - x0Floor if i := clamp(x0i+0, width); i < uint(len(buf)) { - buf[i] += d - d*xmf + buf[i] += d - float32(d*xmf) } if i := clamp(x0i+1, width); i < uint(len(buf)) { - buf[i] += d * xmf + buf[i] += float32(d * xmf) } } else { s := 1 / (x1 - x0) x0f := x0 - x0Floor oneMinusX0f := 1 - x0f - a0 := 0.5 * s * oneMinusX0f * oneMinusX0f + a0 := float32(0.5 * s * oneMinusX0f * oneMinusX0f) x1f := x1 - x1Ceil + 1 - am := 0.5 * s * x1f * x1f + am := float32(0.5 * s * x1f * x1f) if i := clamp(x0i, width); i < uint(len(buf)) { - buf[i] += d * a0 + buf[i] += float32(d * a0) } if x1i == x0i+2 { if i := clamp(x0i+1, width); i < uint(len(buf)) { - buf[i] += d * (1 - a0 - am) + buf[i] += float32(d * (1 - a0 - am)) } } else { - a1 := s * (1.5 - x0f) + a1 := float32(s * (1.5 - x0f)) if i := clamp(x0i+1, width); i < uint(len(buf)) { - buf[i] += d * (a1 - a0) + buf[i] += float32(d * (a1 - a0)) } - dTimesS := d * s + dTimesS := float32(d * s) for xi := x0i + 2; xi < x1i-1; xi++ { if i := clamp(xi, width); i < uint(len(buf)) { buf[i] += dTimesS } } - a2 := a1 + s*float32(x1i-x0i-3) + a2 := a1 + float32(s*float32(x1i-x0i-3)) if i := clamp(x1i-1, width); i < uint(len(buf)) { - buf[i] += d * (1 - a2 - am) + buf[i] += float32(d * (1 - a2 - am)) } } if i := clamp(x1i, width); i < uint(len(buf)) { - buf[i] += d * am + buf[i] += float32(d * am) } } diff --git a/vendor/golang.org/x/image/vector/vector_test.go b/vendor/golang.org/x/image/vector/vector_test.go index f32b992f8..012968e02 100644 --- a/vendor/golang.org/x/image/vector/vector_test.go +++ b/vendor/golang.org/x/image/vector/vector_test.go @@ -463,46 +463,57 @@ func benchGlyph(b *testing.B, colorModel byte, loose bool, height int, op draw.O } } -func BenchmarkGlyphAlpha16Over(b *testing.B) { benchGlyph(b, 'A', false, 16, draw.Over) } -func BenchmarkGlyphAlpha16Src(b *testing.B) { benchGlyph(b, 'A', false, 16, draw.Src) } -func BenchmarkGlyphAlpha32Over(b *testing.B) { benchGlyph(b, 'A', false, 32, draw.Over) } -func BenchmarkGlyphAlpha32Src(b *testing.B) { benchGlyph(b, 'A', false, 32, draw.Src) } -func BenchmarkGlyphAlpha64Over(b *testing.B) { benchGlyph(b, 'A', false, 64, draw.Over) } -func BenchmarkGlyphAlpha64Src(b *testing.B) { benchGlyph(b, 'A', false, 64, draw.Src) } -func BenchmarkGlyphAlpha128Over(b *testing.B) { benchGlyph(b, 'A', false, 128, draw.Over) } -func BenchmarkGlyphAlpha128Src(b *testing.B) { benchGlyph(b, 'A', false, 128, draw.Src) } -func BenchmarkGlyphAlpha256Over(b *testing.B) { benchGlyph(b, 'A', false, 256, draw.Over) } -func BenchmarkGlyphAlpha256Src(b *testing.B) { benchGlyph(b, 'A', false, 256, draw.Src) } - -func BenchmarkGlyphAlphaLoose16Over(b *testing.B) { benchGlyph(b, 'A', true, 16, draw.Over) } -func BenchmarkGlyphAlphaLoose16Src(b *testing.B) { benchGlyph(b, 'A', true, 16, draw.Src) } -func BenchmarkGlyphAlphaLoose32Over(b *testing.B) { benchGlyph(b, 'A', true, 32, draw.Over) } -func BenchmarkGlyphAlphaLoose32Src(b *testing.B) { benchGlyph(b, 'A', true, 32, draw.Src) } -func BenchmarkGlyphAlphaLoose64Over(b *testing.B) { benchGlyph(b, 'A', true, 64, draw.Over) } -func BenchmarkGlyphAlphaLoose64Src(b *testing.B) { benchGlyph(b, 'A', true, 64, draw.Src) } -func BenchmarkGlyphAlphaLoose128Over(b *testing.B) { benchGlyph(b, 'A', true, 128, draw.Over) } -func BenchmarkGlyphAlphaLoose128Src(b *testing.B) { benchGlyph(b, 'A', true, 128, draw.Src) } -func BenchmarkGlyphAlphaLoose256Over(b *testing.B) { benchGlyph(b, 'A', true, 256, draw.Over) } -func BenchmarkGlyphAlphaLoose256Src(b *testing.B) { benchGlyph(b, 'A', true, 256, draw.Src) } - -func BenchmarkGlyphRGBA16Over(b *testing.B) { benchGlyph(b, 'R', false, 16, draw.Over) } -func BenchmarkGlyphRGBA16Src(b *testing.B) { benchGlyph(b, 'R', false, 16, draw.Src) } -func BenchmarkGlyphRGBA32Over(b *testing.B) { benchGlyph(b, 'R', false, 32, draw.Over) } -func BenchmarkGlyphRGBA32Src(b *testing.B) { benchGlyph(b, 'R', false, 32, draw.Src) } -func BenchmarkGlyphRGBA64Over(b *testing.B) { benchGlyph(b, 'R', false, 64, draw.Over) } -func BenchmarkGlyphRGBA64Src(b *testing.B) { benchGlyph(b, 'R', false, 64, draw.Src) } -func BenchmarkGlyphRGBA128Over(b *testing.B) { benchGlyph(b, 'R', false, 128, draw.Over) } -func BenchmarkGlyphRGBA128Src(b *testing.B) { benchGlyph(b, 'R', false, 128, draw.Src) } -func BenchmarkGlyphRGBA256Over(b *testing.B) { benchGlyph(b, 'R', false, 256, draw.Over) } -func BenchmarkGlyphRGBA256Src(b *testing.B) { benchGlyph(b, 'R', false, 256, draw.Src) } - -func BenchmarkGlyphNRGBA16Over(b *testing.B) { benchGlyph(b, 'N', false, 16, draw.Over) } -func BenchmarkGlyphNRGBA16Src(b *testing.B) { benchGlyph(b, 'N', false, 16, draw.Src) } -func BenchmarkGlyphNRGBA32Over(b *testing.B) { benchGlyph(b, 'N', false, 32, draw.Over) } -func BenchmarkGlyphNRGBA32Src(b *testing.B) { benchGlyph(b, 'N', false, 32, draw.Src) } -func BenchmarkGlyphNRGBA64Over(b *testing.B) { benchGlyph(b, 'N', false, 64, draw.Over) } -func BenchmarkGlyphNRGBA64Src(b *testing.B) { benchGlyph(b, 'N', false, 64, draw.Src) } -func BenchmarkGlyphNRGBA128Over(b *testing.B) { benchGlyph(b, 'N', false, 128, draw.Over) } -func BenchmarkGlyphNRGBA128Src(b *testing.B) { benchGlyph(b, 'N', false, 128, draw.Src) } -func BenchmarkGlyphNRGBA256Over(b *testing.B) { benchGlyph(b, 'N', false, 256, draw.Over) } -func BenchmarkGlyphNRGBA256Src(b *testing.B) { benchGlyph(b, 'N', false, 256, draw.Src) } +// The heights 16, 32, 64, 128, 256, 1024 include numbers both above and below +// the floatingPointMathThreshold constant (512). + +func BenchmarkGlyphAlpha16Over(b *testing.B) { benchGlyph(b, 'A', false, 16, draw.Over) } +func BenchmarkGlyphAlpha16Src(b *testing.B) { benchGlyph(b, 'A', false, 16, draw.Src) } +func BenchmarkGlyphAlpha32Over(b *testing.B) { benchGlyph(b, 'A', false, 32, draw.Over) } +func BenchmarkGlyphAlpha32Src(b *testing.B) { benchGlyph(b, 'A', false, 32, draw.Src) } +func BenchmarkGlyphAlpha64Over(b *testing.B) { benchGlyph(b, 'A', false, 64, draw.Over) } +func BenchmarkGlyphAlpha64Src(b *testing.B) { benchGlyph(b, 'A', false, 64, draw.Src) } +func BenchmarkGlyphAlpha128Over(b *testing.B) { benchGlyph(b, 'A', false, 128, draw.Over) } +func BenchmarkGlyphAlpha128Src(b *testing.B) { benchGlyph(b, 'A', false, 128, draw.Src) } +func BenchmarkGlyphAlpha256Over(b *testing.B) { benchGlyph(b, 'A', false, 256, draw.Over) } +func BenchmarkGlyphAlpha256Src(b *testing.B) { benchGlyph(b, 'A', false, 256, draw.Src) } +func BenchmarkGlyphAlpha1024Over(b *testing.B) { benchGlyph(b, 'A', false, 1024, draw.Over) } +func BenchmarkGlyphAlpha1024Src(b *testing.B) { benchGlyph(b, 'A', false, 1024, draw.Src) } + +func BenchmarkGlyphAlphaLoose16Over(b *testing.B) { benchGlyph(b, 'A', true, 16, draw.Over) } +func BenchmarkGlyphAlphaLoose16Src(b *testing.B) { benchGlyph(b, 'A', true, 16, draw.Src) } +func BenchmarkGlyphAlphaLoose32Over(b *testing.B) { benchGlyph(b, 'A', true, 32, draw.Over) } +func BenchmarkGlyphAlphaLoose32Src(b *testing.B) { benchGlyph(b, 'A', true, 32, draw.Src) } +func BenchmarkGlyphAlphaLoose64Over(b *testing.B) { benchGlyph(b, 'A', true, 64, draw.Over) } +func BenchmarkGlyphAlphaLoose64Src(b *testing.B) { benchGlyph(b, 'A', true, 64, draw.Src) } +func BenchmarkGlyphAlphaLoose128Over(b *testing.B) { benchGlyph(b, 'A', true, 128, draw.Over) } +func BenchmarkGlyphAlphaLoose128Src(b *testing.B) { benchGlyph(b, 'A', true, 128, draw.Src) } +func BenchmarkGlyphAlphaLoose256Over(b *testing.B) { benchGlyph(b, 'A', true, 256, draw.Over) } +func BenchmarkGlyphAlphaLoose256Src(b *testing.B) { benchGlyph(b, 'A', true, 256, draw.Src) } +func BenchmarkGlyphAlphaLoose1024Over(b *testing.B) { benchGlyph(b, 'A', true, 1024, draw.Over) } +func BenchmarkGlyphAlphaLoose1024Src(b *testing.B) { benchGlyph(b, 'A', true, 1024, draw.Src) } + +func BenchmarkGlyphRGBA16Over(b *testing.B) { benchGlyph(b, 'R', false, 16, draw.Over) } +func BenchmarkGlyphRGBA16Src(b *testing.B) { benchGlyph(b, 'R', false, 16, draw.Src) } +func BenchmarkGlyphRGBA32Over(b *testing.B) { benchGlyph(b, 'R', false, 32, draw.Over) } +func BenchmarkGlyphRGBA32Src(b *testing.B) { benchGlyph(b, 'R', false, 32, draw.Src) } +func BenchmarkGlyphRGBA64Over(b *testing.B) { benchGlyph(b, 'R', false, 64, draw.Over) } +func BenchmarkGlyphRGBA64Src(b *testing.B) { benchGlyph(b, 'R', false, 64, draw.Src) } +func BenchmarkGlyphRGBA128Over(b *testing.B) { benchGlyph(b, 'R', false, 128, draw.Over) } +func BenchmarkGlyphRGBA128Src(b *testing.B) { benchGlyph(b, 'R', false, 128, draw.Src) } +func BenchmarkGlyphRGBA256Over(b *testing.B) { benchGlyph(b, 'R', false, 256, draw.Over) } +func BenchmarkGlyphRGBA256Src(b *testing.B) { benchGlyph(b, 'R', false, 256, draw.Src) } +func BenchmarkGlyphRGBA1024Over(b *testing.B) { benchGlyph(b, 'R', false, 1024, draw.Over) } +func BenchmarkGlyphRGBA1024Src(b *testing.B) { benchGlyph(b, 'R', false, 1024, draw.Src) } + +func BenchmarkGlyphNRGBA16Over(b *testing.B) { benchGlyph(b, 'N', false, 16, draw.Over) } +func BenchmarkGlyphNRGBA16Src(b *testing.B) { benchGlyph(b, 'N', false, 16, draw.Src) } +func BenchmarkGlyphNRGBA32Over(b *testing.B) { benchGlyph(b, 'N', false, 32, draw.Over) } +func BenchmarkGlyphNRGBA32Src(b *testing.B) { benchGlyph(b, 'N', false, 32, draw.Src) } +func BenchmarkGlyphNRGBA64Over(b *testing.B) { benchGlyph(b, 'N', false, 64, draw.Over) } +func BenchmarkGlyphNRGBA64Src(b *testing.B) { benchGlyph(b, 'N', false, 64, draw.Src) } +func BenchmarkGlyphNRGBA128Over(b *testing.B) { benchGlyph(b, 'N', false, 128, draw.Over) } +func BenchmarkGlyphNRGBA128Src(b *testing.B) { benchGlyph(b, 'N', false, 128, draw.Src) } +func BenchmarkGlyphNRGBA256Over(b *testing.B) { benchGlyph(b, 'N', false, 256, draw.Over) } +func BenchmarkGlyphNRGBA256Src(b *testing.B) { benchGlyph(b, 'N', false, 256, draw.Src) } +func BenchmarkGlyphNRGBA1024Over(b *testing.B) { benchGlyph(b, 'N', false, 1024, draw.Over) } +func BenchmarkGlyphNRGBA1024Src(b *testing.B) { benchGlyph(b, 'N', false, 1024, draw.Src) } -- cgit v1.2.3-1-g7c22