internal/graphicscommand: rename pixelCommand -> readPixelCommand

Updates #1995
This commit is contained in:
Hajime Hoshi 2022-08-08 01:46:45 +09:00
parent c382cb2b05
commit 869147eda0
2 changed files with 6 additions and 6 deletions

View File

@ -533,21 +533,21 @@ func (c *replacePixelsCommand) Exec(graphicsDriver graphicsdriver.Graphics, inde
return nil
}
type pixelsCommand struct {
type readPixelsCommand struct {
result []byte
img *Image
}
// Exec executes a pixelsCommand.
func (c *pixelsCommand) Exec(graphicsDriver graphicsdriver.Graphics, indexOffset int) error {
// Exec executes a readPixelsCommand.
func (c *readPixelsCommand) Exec(graphicsDriver graphicsdriver.Graphics, indexOffset int) error {
if err := c.img.image.ReadPixels(c.result); err != nil {
return err
}
return nil
}
func (c *pixelsCommand) String() string {
return fmt.Sprintf("pixels: image: %d", c.img.id)
func (c *readPixelsCommand) String() string {
return fmt.Sprintf("read-pixels: image: %d", c.img.id)
}
// disposeImageCommand represents a command to dispose an image.

View File

@ -155,7 +155,7 @@ func (i *Image) DrawTriangles(srcs [graphics.ShaderImageCount]*Image, offsets [g
// ReadPixels returns an error when an error happens in the graphics driver.
func (i *Image) ReadPixels(graphicsDriver graphicsdriver.Graphics, buf []byte) error {
i.resolveBufferedReplacePixels()
c := &pixelsCommand{
c := &readPixelsCommand{
img: i,
result: buf,
}