mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
internal/restorable: do not reset basePixels at makeStale
This information is still available even after context-lost happens, so this doesn't have to be reset.
This commit is contained in:
parent
ff1621885d
commit
a0a80bbc1f
@ -261,13 +261,11 @@ func (i *Image) BasePixelsForTesting() *Pixels {
|
||||
func (i *Image) makeStale(rect image.Rectangle) {
|
||||
i.stale = true
|
||||
|
||||
i.staleRegions = i.basePixels.AppendRegion(i.staleRegions)
|
||||
i.staleRegions = i.appendRegionsForDrawTriangles(i.staleRegions)
|
||||
if !rect.Empty() {
|
||||
i.staleRegions = append(i.staleRegions, rect)
|
||||
}
|
||||
|
||||
i.basePixels = Pixels{}
|
||||
i.clearDrawTrianglesHistory()
|
||||
|
||||
// Don't have to call makeStale recursively here.
|
||||
@ -484,7 +482,6 @@ func (i *Image) makeStaleIfDependingOnShader(shader *Shader) {
|
||||
func (i *Image) readPixelsFromGPU(graphicsDriver graphicsdriver.Graphics) error {
|
||||
var rs []image.Rectangle
|
||||
if i.stale {
|
||||
i.basePixels = Pixels{}
|
||||
rs = append(rs, i.staleRegions...)
|
||||
} else {
|
||||
rs = i.appendRegionsForDrawTriangles(rs)
|
||||
|
Loading…
Reference in New Issue
Block a user