graphics: Rename noSave -> volatile

This commit is contained in:
Hajime Hoshi 2016-07-05 03:18:55 +09:00
parent 11e67d0eed
commit 17fbffb720
2 changed files with 9 additions and 9 deletions

View File

@ -47,7 +47,7 @@ func (c *graphicsContext) SetSize(screenWidth, screenHeight int, screenScale flo
if err != nil { if err != nil {
return err return err
} }
offscreen.impl.noSave = true offscreen.impl.volatile = true
intScreenScale := int(math.Ceil(screenScale)) intScreenScale := int(math.Ceil(screenScale))
w := screenWidth * intScreenScale w := screenWidth * intScreenScale
@ -56,7 +56,7 @@ func (c *graphicsContext) SetSize(screenWidth, screenHeight int, screenScale flo
if err != nil { if err != nil {
return err return err
} }
offscreen2.impl.noSave = true offscreen2.impl.volatile = true
w = int(float64(screenWidth) * screenScale) w = int(float64(screenWidth) * screenScale)
h = int(float64(screenHeight) * screenScale) h = int(float64(screenHeight) * screenScale)
@ -64,7 +64,6 @@ func (c *graphicsContext) SetSize(screenWidth, screenHeight int, screenScale flo
if err != nil { if err != nil {
return err return err
} }
c.screen.impl.noSave = true
c.screen.Clear() c.screen.Clear()
c.offscreen = offscreen c.offscreen = offscreen

View File

@ -36,7 +36,7 @@ type imageImpl struct {
height int height int
filter Filter filter Filter
pixels []uint8 pixels []uint8
noSave bool volatile bool
screen bool screen bool
m sync.Mutex m sync.Mutex
} }
@ -94,10 +94,11 @@ func newScreenImageImpl(width, height int) (*imageImpl, error) {
return nil, err return nil, err
} }
i := &imageImpl{ i := &imageImpl{
image: img, image: img,
width: width, width: width,
height: height, height: height,
screen: true, volatile: true,
screen: true,
} }
runtime.SetFinalizer(i, (*imageImpl).Dispose) runtime.SetFinalizer(i, (*imageImpl).Dispose)
return i, nil return i, nil
@ -181,7 +182,7 @@ func (i *imageImpl) savePixels(context *opengl.Context) error {
if i.screen { if i.screen {
return nil return nil
} }
if i.noSave { if i.volatile {
return nil return nil
} }
if i.disposed { if i.disposed {