mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-12 22:17:26 +01:00
buffered: Skip filling operation if possible
This commit is contained in:
parent
e180598ce0
commit
cf3436da21
@ -201,14 +201,14 @@ func (i *Image) ReplacePixels(pix []byte, x, y, width, height int) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
i.resolvePendingFill()
|
|
||||||
|
|
||||||
if x == 0 && y == 0 && width == i.width && height == i.height {
|
if x == 0 && y == 0 && width == i.width && height == i.height {
|
||||||
i.invalidatePendingPixels()
|
i.invalidatePendingPixels()
|
||||||
i.img.ReplacePixels(pix)
|
i.img.ReplacePixels(pix)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
i.resolvePendingFill()
|
||||||
|
|
||||||
// TODO: Can we use (*restorable.Image).ReplacePixels?
|
// TODO: Can we use (*restorable.Image).ReplacePixels?
|
||||||
if i.pixels == nil {
|
if i.pixels == nil {
|
||||||
pix, err := i.img.Pixels(0, 0, i.width, i.height)
|
pix, err := i.img.Pixels(0, 0, i.width, i.height)
|
||||||
|
Loading…
Reference in New Issue
Block a user