代码拉取完成,页面将自动刷新
package flutter
import (
"github.com/pkg/errors"
)
// Texture is an identifier for texture declaration
type Texture struct {
ID int64
registry *TextureRegistry
}
// Register registers a textureID with his associated handler
func (t *Texture) Register(handler ExternalTextureHanlderFunc) error {
t.registry.setTextureHandler(t.ID, handler)
err := t.registry.engine.RegisterExternalTexture(t.ID)
if err != nil {
t.registry.setTextureHandler(t.ID, nil)
return errors.Errorf("'go-flutter' couldn't register texture with id: '%v': %v", t.ID, err)
}
return nil
}
// FrameAvailable mark a texture buffer is ready to be draw in the flutter scene
func (t *Texture) FrameAvailable() error {
err := t.registry.engine.MarkExternalTextureFrameAvailable(t.ID)
if err != nil {
return errors.Errorf("'go-flutter' couldn't mark frame available of texture with id: '%v': %v", t.ID, err)
}
return nil
}
// UnRegister unregisters a textureID with his associated handler
func (t *Texture) UnRegister() error {
err := t.registry.engine.UnregisterExternalTexture(t.ID)
if err != nil {
return errors.Errorf("'go-flutter' couldn't unregisters texture with id: '%v': %v", t.ID, err)
}
t.registry.setTextureHandler(t.ID, nil)
return nil
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。