Revert "internal/restorable: integrate ReadPixels into internal/atlas"

This reverts commit e804f9e58c.

Updates #3083
This commit is contained in:
Hajime Hoshi 2024-09-06 14:17:47 +09:00
parent becada4afc
commit d533461936
2 changed files with 13 additions and 6 deletions

View File

@ -564,12 +564,7 @@ func (i *Image) ReadPixels(graphicsDriver graphicsdriver.Graphics, pixels []byte
return true, nil
}
if err := i.backend.restorable.Image.ReadPixels(graphicsDriver, []graphicsdriver.PixelsArgs{
{
Pixels: pixels,
Region: region.Add(i.regionWithPadding().Min),
},
}); err != nil {
if err := i.backend.restorable.ReadPixels(graphicsDriver, pixels, region.Add(i.regionWithPadding().Min)); err != nil {
return false, err
}
return true, nil

View File

@ -136,3 +136,15 @@ func (i *Image) DrawTriangles(srcs [graphics.ShaderSrcImageCount]*Image, vertice
}
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
}