graphics: Remove imageImpl.screen

This commit is contained in:
Hajime Hoshi 2016-07-05 01:23:29 +09:00
parent 7903fe2108
commit eac816ca47
2 changed files with 2 additions and 14 deletions

View File

@ -67,9 +67,6 @@ func (i *images) restorePixels(context *opengl.Context) error {
// If framebuffers/textures are not disposed here, a newly created framebuffer/texture
// number can be a same number as existing one.
for img := range i.images {
if img.screen {
continue
}
if img.isDisposed() {
continue
}
@ -206,7 +203,7 @@ func NewImage(width, height int, filter Filter) (*Image, error) {
if err != nil {
return nil, err
}
if err := img.image.Fill(color.Transparent); err != nil {
if err := img.Fill(color.Transparent); err != nil {
return nil, err
}
eimg, err := theImages.add(img)
@ -260,10 +257,5 @@ func newImageWithScreenFramebuffer(width, height int) (*Image, error) {
if err != nil {
return nil, err
}
img.screen = true
eimg, err := theImages.add(img)
if err != nil {
return nil, err
}
return eimg, nil
return &Image{img}, nil
}

View File

@ -30,7 +30,6 @@ import (
type imageImpl struct {
image *graphics.Image
screen bool
disposed bool
width int
height int
@ -147,9 +146,6 @@ func (i *imageImpl) savePixels(context *opengl.Context) error {
func (i *imageImpl) restorePixels() error {
i.m.Lock()
defer i.m.Unlock()
if i.screen {
return nil
}
if i.disposed {
return nil
}