diff --git a/internal/atlas/image.go b/internal/atlas/image.go index 6f9ab8075..16bce740d 100644 --- a/internal/atlas/image.go +++ b/internal/atlas/image.go @@ -546,8 +546,15 @@ func (i *Image) readPixels(graphicsDriver graphicsdriver.Graphics, pixels []byte return nil } - r := i.regionWithPadding() - return i.backend.restorable.ReadPixels(graphicsDriver, pixels, region.Add(r.Min)) + if err := i.backend.restorable.Image.ReadPixels(graphicsDriver, []graphicsdriver.PixelsArgs{ + { + Pixels: pixels, + Region: region.Add(i.regionWithPadding().Min), + }, + }); err != nil { + return err + } + return nil } // Deallocate deallocates the internal state. diff --git a/internal/restorable/image.go b/internal/restorable/image.go index 0e3d44ec9..d46005126 100644 --- a/internal/restorable/image.go +++ b/internal/restorable/image.go @@ -144,15 +144,3 @@ func (i *Image) DrawTriangles(srcs [graphics.ShaderImageCount]*Image, vertices [ } i.Image.DrawTriangles(imgs, vertices, indices, blend, dstRegion, srcRegions, shader.shader, uniforms, fillRule) } - -func (i *Image) ReadPixels(graphicsDriver graphicsdriver.Graphics, pixels []byte, region image.Rectangle) error { - if err := i.Image.ReadPixels(graphicsDriver, []graphicsdriver.PixelsArgs{ - { - Pixels: pixels, - Region: region, - }, - }); err != nil { - return err - } - return nil -}