mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 13:07:26 +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
|
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) {
|
func (p *pixels) appendDrawImageHistory(item *drawImageHistoryItem) {
|
||||||
if item.image.impl.pixels.inconsistent {
|
if item.image.impl.pixels.inconsistent {
|
||||||
p.inconsistent = true
|
p.makeInconsistent()
|
||||||
}
|
}
|
||||||
if p.inconsistent {
|
if p.inconsistent {
|
||||||
return
|
return
|
||||||
@ -132,7 +139,7 @@ func (p *pixels) flushIfNeeded(target *Image, context *opengl.Context) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if context == nil {
|
if context == nil {
|
||||||
p.inconsistent = true
|
p.makeInconsistent()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
p.inconsistent = false
|
p.inconsistent = false
|
||||||
|
Loading…
Reference in New Issue
Block a user