mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57: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
|
||||
}
|
||||
|
||||
i.resolvePendingFill()
|
||||
|
||||
if x == 0 && y == 0 && width == i.width && height == i.height {
|
||||
i.invalidatePendingPixels()
|
||||
i.img.ReplacePixels(pix)
|
||||
return nil
|
||||
}
|
||||
|
||||
i.resolvePendingFill()
|
||||
|
||||
// TODO: Can we use (*restorable.Image).ReplacePixels?
|
||||
if i.pixels == nil {
|
||||
pix, err := i.img.Pixels(0, 0, i.width, i.height)
|
||||
|
Loading…
Reference in New Issue
Block a user