mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-27 03:02:49 +01:00
restorable: Don't call (*graphicscommand.Image).Pixels twice
This commit is contained in:
parent
3952474690
commit
3faa674e32
@ -416,9 +416,10 @@ func (i *Image) makeStaleIfDependingOn(target *Image) {
|
|||||||
|
|
||||||
// readPixelsFromGPU reads the pixels from GPU and resolves the image's 'stale' state.
|
// readPixelsFromGPU reads the pixels from GPU and resolves the image's 'stale' state.
|
||||||
func (i *Image) readPixelsFromGPU() {
|
func (i *Image) readPixelsFromGPU() {
|
||||||
|
pix := i.image.Pixels()
|
||||||
i.basePixels = &Pixels{
|
i.basePixels = &Pixels{
|
||||||
pixels: i.image.Pixels(),
|
pixels: pix,
|
||||||
length: len(i.image.Pixels()),
|
length: len(pix),
|
||||||
}
|
}
|
||||||
i.drawImageHistory = nil
|
i.drawImageHistory = nil
|
||||||
i.stale = false
|
i.stale = false
|
||||||
|
Loading…
Reference in New Issue
Block a user