graphics: Refactoring

This commit is contained in:
Hajime Hoshi 2016-07-13 12:40:21 +09:00
parent 1627176d59
commit b733f03489

View File

@ -267,7 +267,14 @@ func (i *imageImpl) restore(context *opengl.Context) error {
}
return nil
}
if !i.volatile {
if i.volatile {
var err error
i.image, err = graphics.NewImage(i.width, i.height, glFilter(i.filter))
if err != nil {
return err
}
return nil
}
img := image.NewRGBA(image.Rect(0, 0, i.width, i.height))
if i.pixels != nil {
for j := 0; j < i.height; j++ {
@ -306,13 +313,6 @@ func (i *imageImpl) restore(context *opengl.Context) error {
i.drawImageHistory = nil
return nil
}
var err error
i.image, err = graphics.NewImage(i.width, i.height, glFilter(i.filter))
if err != nil {
return err
}
return nil
}
func (i *imageImpl) Dispose() error {
i.m.Lock()