mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-26 02:42:02 +01:00
graphics: Add pixels.makeInconsistent
This commit is contained in:
parent
b3aa567f38
commit
7649236712
11
pixels.go
11
pixels.go
@ -75,9 +75,16 @@ func (p *pixels) fill(clr color.Color) {
|
||||
p.drawImageHistory = nil
|
||||
}
|
||||
|
||||
func (p *pixels) makeInconsistent() {
|
||||
p.inconsistent = true
|
||||
p.basePixels = nil
|
||||
p.baseColor = nil
|
||||
p.drawImageHistory = nil
|
||||
}
|
||||
|
||||
func (p *pixels) appendDrawImageHistory(item *drawImageHistoryItem) {
|
||||
if item.image.impl.pixels.inconsistent {
|
||||
p.inconsistent = true
|
||||
p.makeInconsistent()
|
||||
}
|
||||
if p.inconsistent {
|
||||
return
|
||||
@ -132,7 +139,7 @@ func (p *pixels) flushIfNeeded(target *Image, context *opengl.Context) error {
|
||||
return nil
|
||||
}
|
||||
if context == nil {
|
||||
p.inconsistent = true
|
||||
p.makeInconsistent()
|
||||
return nil
|
||||
}
|
||||
p.inconsistent = false
|
||||
|
Loading…
Reference in New Issue
Block a user