mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 19:28:57 +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 {
|
if err := c.initializeIfNeeded(context); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := theImagesForRestoring.ensurePixels(context); err != nil {
|
if err := theImagesForRestoring.resolveStalePixels(context); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
for i := 0; i < updateCount; i++ {
|
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)
|
runtime.SetFinalizer(img, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *images) ensurePixels(context *opengl.Context) error {
|
func (i *images) resolveStalePixels(context *opengl.Context) error {
|
||||||
i.m.Lock()
|
i.m.Lock()
|
||||||
defer i.m.Unlock()
|
defer i.m.Unlock()
|
||||||
for img := range i.images {
|
for img := range i.images {
|
||||||
if err := img.ensurePixels(context); err != nil {
|
if err := img.resolveStalePixels(context); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -185,7 +185,7 @@ func (i *imageImpl) At(x, y int, context *opengl.Context) color.Color {
|
|||||||
return clr
|
return clr
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *imageImpl) ensurePixels(context *opengl.Context) error {
|
func (i *imageImpl) resolveStalePixels(context *opengl.Context) error {
|
||||||
i.m.Lock()
|
i.m.Lock()
|
||||||
defer i.m.Unlock()
|
defer i.m.Unlock()
|
||||||
if i.disposed {
|
if i.disposed {
|
||||||
|
Loading…
Reference in New Issue
Block a user