From fac639f9b794dfd599cb3642d60f212673b451bb Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 3 Jun 2018 23:53:12 +0900 Subject: [PATCH] graphics: Refactoring: Remove drawImageCommand.quadsNum --- internal/graphics/command.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/internal/graphics/command.go b/internal/graphics/command.go index 8b153e4c3..49fc38c6c 100644 --- a/internal/graphics/command.go +++ b/internal/graphics/command.go @@ -114,10 +114,10 @@ func (q *commandQueue) doEnqueueDrawImageCommand(dst, src *Image, nvertices, nel func (q *commandQueue) EnqueueDrawImageCommand(dst, src *Image, vertices []float32, color *affine.ColorM, mode opengl.CompositeMode, filter Filter) { // Avoid defer for performance q.appendVertices(vertices) - nelements := 6 * len(vertices) * opengl.Float.SizeInBytes() / QuadVertexSizeInBytes() + nq := len(vertices) * opengl.Float.SizeInBytes() / QuadVertexSizeInBytes() nv := 0 ne := 0 - for i := 0; i < nelements/6; i++ { + for i := 0; i < nq; i++ { if q.nelements%indicesNum >= (q.nelements+6)%indicesNum { q.nextIndex = 0 // Note that even if ne == 0, that's fine. @@ -282,11 +282,6 @@ func (c *drawImageCommand) CanMerge(dst, src *Image, color *affine.ColorM, mode return true } -// quadsNum returns the number of quadrangles. -func (c *drawImageCommand) quadsNum() int { - return c.nvertices * opengl.Float.SizeInBytes() / QuadVertexSizeInBytes() -} - // replacePixelsCommand represents a command to replace pixels of an image. type replacePixelsCommand struct { dst *Image