dont make ThermionFlutterTexture inherit from ThermionDartTexture
This commit is contained in:
@@ -2,20 +2,24 @@ import Foundation
|
||||
import GLKit
|
||||
import FlutterMacOS
|
||||
|
||||
public class ThermionFlutterTexture : ThermionDartTexture, FlutterTexture {
|
||||
public class ThermionFlutterTexture : NSObject, FlutterTexture {
|
||||
|
||||
var flutterTextureId: Int64 = -1
|
||||
var registry: FlutterTextureRegistry
|
||||
var texture: ThermionDartTexture
|
||||
|
||||
init(registry:FlutterTextureRegistry, width:Int64, height:Int64) {
|
||||
self.registry = registry
|
||||
super.init(width:width, height:height)
|
||||
self.texture = ThermionDartTexture(width:width, height: height)
|
||||
super.init()
|
||||
self.flutterTextureId = registry.register(self)
|
||||
|
||||
}
|
||||
|
||||
public func copyPixelBuffer() -> Unmanaged<CVPixelBuffer>? {
|
||||
return Unmanaged.passRetained(pixelBuffer!);
|
||||
if(self.texture.pixelBuffer == nil) {
|
||||
return nil
|
||||
}
|
||||
return Unmanaged.passRetained(self.texture.pixelBuffer!);
|
||||
}
|
||||
|
||||
public func onTextureUnregistered(_ texture:FlutterTexture) {
|
||||
@@ -24,7 +28,7 @@ public class ThermionFlutterTexture : ThermionDartTexture, FlutterTexture {
|
||||
|
||||
public func destroy() {
|
||||
self.registry.unregisterTexture(self.flutterTextureId)
|
||||
self.destroyTexture()
|
||||
self.texture.destroyTexture()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user