mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
internal/graphicscommand: rename pixelCommand -> readPixelCommand
Updates #1995
This commit is contained in:
parent
c382cb2b05
commit
869147eda0
@ -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.
|
||||
|
@ -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,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user