mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
internal/atlas: clarify the logic when to update usedAsDestination
As the name is `usedAsDestination`, this should be updated whenever the image is used as a rendering destination. Confirmed that this change didn't cause a performance regression like #2586. Updates #2586 Updates #2676
This commit is contained in:
parent
a50d9e6291
commit
2c9f5d9dad
@ -230,6 +230,7 @@ func (i *Image) paddingSize() int {
|
||||
|
||||
func (i *Image) ensureIsolatedFromSource(backends []*backend) {
|
||||
i.resetUsedAsSourceCount()
|
||||
imagesUsedAsDestination[i] = struct{}{}
|
||||
|
||||
if i.backend == nil {
|
||||
// `theSourceBackendsForOneFrame` already includes `backends`.
|
||||
@ -245,8 +246,6 @@ func (i *Image) ensureIsolatedFromSource(backends []*backend) {
|
||||
return
|
||||
}
|
||||
|
||||
imagesUsedAsDestination[i] = struct{}{}
|
||||
|
||||
// Check if i has the same backend as the given backends.
|
||||
var needsIsolation bool
|
||||
for _, b := range backends {
|
||||
|
Loading…
Reference in New Issue
Block a user