mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
shareable: Refactoring
This commit is contained in:
parent
a3bccf5ff7
commit
34d7385e6d
@ -188,6 +188,9 @@ func (i *Image) isShared() bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *Image) ensureNotShared() {
|
func (i *Image) ensureNotShared() {
|
||||||
|
i.nonUpdatedCount = 0
|
||||||
|
delete(imagesToMakeShared, i)
|
||||||
|
|
||||||
if i.backend == nil {
|
if i.backend == nil {
|
||||||
i.allocate(false)
|
i.allocate(false)
|
||||||
return
|
return
|
||||||
@ -374,9 +377,6 @@ func (i *Image) DrawTriangles(srcs [graphics.ShaderImageNum]*Image, vertices []f
|
|||||||
|
|
||||||
i.backend.restorable.DrawTriangles(imgs, offsets, vertices, indices, colorm, mode, filter, address, sourceRegion, s, uniforms)
|
i.backend.restorable.DrawTriangles(imgs, offsets, vertices, indices, colorm, mode, filter, address, sourceRegion, s, uniforms)
|
||||||
|
|
||||||
i.nonUpdatedCount = 0
|
|
||||||
delete(imagesToMakeShared, i)
|
|
||||||
|
|
||||||
for _, src := range srcs {
|
for _, src := range srcs {
|
||||||
if src == nil {
|
if src == nil {
|
||||||
continue
|
continue
|
||||||
@ -407,9 +407,6 @@ func (i *Image) Fill(clr color.RGBA) {
|
|||||||
|
|
||||||
// As *restorable.Image is an independent image, it is fine to fill the entire image.
|
// As *restorable.Image is an independent image, it is fine to fill the entire image.
|
||||||
i.backend.restorable.Fill(clr)
|
i.backend.restorable.Fill(clr)
|
||||||
|
|
||||||
i.nonUpdatedCount = 0
|
|
||||||
delete(imagesToMakeShared, i)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *Image) ReplacePixels(pix []byte) {
|
func (i *Image) ReplacePixels(pix []byte) {
|
||||||
|
Loading…
Reference in New Issue
Block a user