graphics: Make NewVolatileImage unexported

This commit is contained in:
Hajime Hoshi 2016-07-12 01:58:04 +09:00
parent 87e0948449
commit ebe7f10af1
2 changed files with 4 additions and 4 deletions

View File

@ -43,7 +43,7 @@ func (c *graphicsContext) SetSize(screenWidth, screenHeight int, screenScale flo
if c.offscreen != nil {
c.offscreen.Dispose()
}
offscreen, err := NewVolatileImage(screenWidth, screenHeight, FilterNearest)
offscreen, err := newVolatileImage(screenWidth, screenHeight, FilterNearest)
if err != nil {
return err
}
@ -51,7 +51,7 @@ func (c *graphicsContext) SetSize(screenWidth, screenHeight int, screenScale flo
intScreenScale := int(math.Ceil(screenScale))
w := screenWidth * intScreenScale
h := screenHeight * intScreenScale
offscreen2, err := NewVolatileImage(w, h, FilterLinear)
offscreen2, err := newVolatileImage(w, h, FilterLinear)
if err != nil {
return err
}

View File

@ -217,7 +217,7 @@ func NewImage(width, height int, filter Filter) (*Image, error) {
return eimg, nil
}
// NewVolatileImage returns an empty 'volatile' image.
// newVolatileImage returns an empty 'volatile' image.
// A volatile image is always cleared at the start of a frame.
//
// This is suitable for offscreen images that pixels are changed often.
@ -228,7 +228,7 @@ func NewImage(width, height int, filter Filter) (*Image, error) {
// Saving pixels is an expensive operation, and it is desirable to avoid it if possible.
//
// This function is concurrent-safe.
func NewVolatileImage(width, height int, filter Filter) (*Image, error) {
func newVolatileImage(width, height int, filter Filter) (*Image, error) {
img, err := newImageImpl(width, height, filter, true)
if err != nil {
return nil, err