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

View File

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