mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 12:08:58 +01:00
Revert "internal/restorable: integrate ReadPixels into internal/atlas"
This reverts commit e804f9e58c
.
Updates #3083
This commit is contained in:
parent
becada4afc
commit
d533461936
@ -564,12 +564,7 @@ func (i *Image) ReadPixels(graphicsDriver graphicsdriver.Graphics, pixels []byte
|
|||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := i.backend.restorable.Image.ReadPixels(graphicsDriver, []graphicsdriver.PixelsArgs{
|
if err := i.backend.restorable.ReadPixels(graphicsDriver, pixels, region.Add(i.regionWithPadding().Min)); err != nil {
|
||||||
{
|
|
||||||
Pixels: pixels,
|
|
||||||
Region: region.Add(i.regionWithPadding().Min),
|
|
||||||
},
|
|
||||||
}); err != nil {
|
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
return true, nil
|
return true, nil
|
||||||
|
@ -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)
|
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
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user