From d29cabca434be523dbaa8d9bb6a4bfff33bd3710 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 15 Dec 2018 03:46:32 +0900 Subject: [PATCH] graphicsdriver: Remove MaxImageSize --- internal/graphicscommand/image.go | 11 ----------- internal/graphicsdriver/graphicsdriver.go | 1 - internal/graphicsdriver/opengl/driver.go | 4 ---- 3 files changed, 16 deletions(-) diff --git a/internal/graphicscommand/image.go b/internal/graphicscommand/image.go index e5a699981..164e57e05 100644 --- a/internal/graphicscommand/image.go +++ b/internal/graphicscommand/image.go @@ -27,17 +27,6 @@ var ( maxImageSize = 0 ) -// MaxImageSize returns the maximum of width/height of an image. -func MaxImageSize() int { - if maxImageSize == 0 { - maxImageSize = driver().MaxImageSize() - if maxImageSize == 0 { - panic("graphics: failed to get the max texture size") - } - } - return maxImageSize -} - // imageState is a state of an image. type imageState int diff --git a/internal/graphicsdriver/graphicsdriver.go b/internal/graphicsdriver/graphicsdriver.go index 08de6619e..69b8b53c9 100644 --- a/internal/graphicsdriver/graphicsdriver.go +++ b/internal/graphicsdriver/graphicsdriver.go @@ -22,7 +22,6 @@ import ( type GraphicsDriver interface { SetVertices(vertices []float32, indices []uint16) Flush() - MaxImageSize() int NewImage(width, height int) (Image, error) NewScreenFramebufferImage(width, height int) (Image, error) Reset() error diff --git a/internal/graphicsdriver/opengl/driver.go b/internal/graphicsdriver/opengl/driver.go index 93e5a6b0e..ad15db24d 100644 --- a/internal/graphicsdriver/opengl/driver.go +++ b/internal/graphicsdriver/opengl/driver.go @@ -105,7 +105,3 @@ func (d *Driver) Draw(indexLen int, indexOffset int, mode graphics.CompositeMode func (d *Driver) Flush() { d.context.flush() } - -func (d *Driver) MaxImageSize() int { - return d.context.getMaxTextureSize() -}