Revert "graphicsdriver/metal: Bug fix: Release drawable correctly"

This reverts commit c44accbfb5.

Reason: This change doesn't make sense
This commit is contained in:
Hajime Hoshi 2019-04-20 00:28:09 +09:00
parent c44accbfb5
commit bfe1d2208e
4 changed files with 0 additions and 10 deletions

View File

@ -152,7 +152,3 @@ func (md MetalDrawable) Drawable() unsafe.Pointer { return md.metalDrawable }
func (md MetalDrawable) Texture() mtl.Texture { func (md MetalDrawable) Texture() mtl.Texture {
return mtl.NewTexture(C.MetalDrawable_Texture(md.metalDrawable)) return mtl.NewTexture(C.MetalDrawable_Texture(md.metalDrawable))
} }
func (md MetalDrawable) Release() {
C.MetalDrawable_Release(md.metalDrawable)
}

View File

@ -31,4 +31,3 @@ void MetalLayer_SetDrawableSize(void *metalLayer, double width, double height);
void *MetalLayer_NextDrawable(void *metalLayer); void *MetalLayer_NextDrawable(void *metalLayer);
void *MetalDrawable_Texture(void *drawable); void *MetalDrawable_Texture(void *drawable);
void MetalDrawable_Release(void *drawable);

View File

@ -89,7 +89,3 @@ void *MetalLayer_NextDrawable(void *metalLayer) {
void *MetalDrawable_Texture(void *metalDrawable) { void *MetalDrawable_Texture(void *metalDrawable) {
return ((id<CAMetalDrawable>)metalDrawable).texture; return ((id<CAMetalDrawable>)metalDrawable).texture;
} }
void MetalDrawable_Release(void *metalDrawable) {
[(id<CAMetalDrawable>)metalDrawable release];
}

View File

@ -598,7 +598,6 @@ func (d *Driver) Draw(indexLen int, indexOffset int, mode graphics.CompositeMode
} }
t = d.screenDrawable.Texture() t = d.screenDrawable.Texture()
} else { } else {
d.screenDrawable.Release()
d.screenDrawable = ca.MetalDrawable{} d.screenDrawable = ca.MetalDrawable{}
t = d.dst.texture t = d.dst.texture
} }