mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
graphics: Rename s/ensure/resolveStale/
This commit is contained in:
parent
9b6b5372ef
commit
4ad5c65efe
@ -140,7 +140,7 @@ func (c *graphicsContext) UpdateAndDraw(context *opengl.Context, updateCount int
|
||||
if err := c.initializeIfNeeded(context); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := theImagesForRestoring.ensurePixels(context); err != nil {
|
||||
if err := theImagesForRestoring.resolveStalePixels(context); err != nil {
|
||||
return err
|
||||
}
|
||||
for i := 0; i < updateCount; i++ {
|
||||
|
4
image.go
4
image.go
@ -63,11 +63,11 @@ func (i *images) remove(img *Image) {
|
||||
runtime.SetFinalizer(img, nil)
|
||||
}
|
||||
|
||||
func (i *images) ensurePixels(context *opengl.Context) error {
|
||||
func (i *images) resolveStalePixels(context *opengl.Context) error {
|
||||
i.m.Lock()
|
||||
defer i.m.Unlock()
|
||||
for img := range i.images {
|
||||
if err := img.ensurePixels(context); err != nil {
|
||||
if err := img.resolveStalePixels(context); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ func (i *imageImpl) At(x, y int, context *opengl.Context) color.Color {
|
||||
return clr
|
||||
}
|
||||
|
||||
func (i *imageImpl) ensurePixels(context *opengl.Context) error {
|
||||
func (i *imageImpl) resolveStalePixels(context *opengl.Context) error {
|
||||
i.m.Lock()
|
||||
defer i.m.Unlock()
|
||||
if i.disposed {
|
||||
|
Loading…
Reference in New Issue
Block a user