pixels: Remove IsStale

This commit is contained in:
Hajime Hoshi 2016-07-27 02:20:42 +09:00
parent 56732d9a23
commit e0894879f1
2 changed files with 8 additions and 8 deletions

View File

@ -194,10 +194,7 @@ func (i *imageImpl) ensurePixels(context *opengl.Context) error {
if i.disposed {
return nil
}
if !i.pixels.IsStale() {
return nil
}
if err := i.pixels.Reset(context); err != nil {
if err := i.pixels.ResetIfStale(context); err != nil {
return err
}
return nil

View File

@ -47,10 +47,6 @@ func NewPixels(image *graphics.Image) *Pixels {
}
}
func (p *Pixels) IsStale() bool {
return p.stale
}
func (p *Pixels) MakeStale() {
p.basePixels = nil
p.baseColor = nil
@ -134,6 +130,13 @@ func (p *Pixels) Reset(context *opengl.Context) error {
return nil
}
func (p *Pixels) ResetIfStale(context *opengl.Context) error {
if !p.stale {
return nil
}
return p.Reset(context)
}
func (p *Pixels) HasDependency() bool {
if p.stale {
return false