feat: add onRgba c api on windows

This commit is contained in:
Kingtous 2023-02-18 00:34:46 +08:00
parent 71e77ef3cf
commit 1a164ee5a0
9 changed files with 93 additions and 35 deletions

View file

@ -79,9 +79,22 @@ void TextureRgbaRendererPlugin::HandleMethodCall(
result->Success(flutter::EncodableValue(true));
}
}
else if (method_call.method_name().compare("getTexturePtr") == 0) {
auto args = std::get<flutter::EncodableMap>(*method_call.arguments());
auto key = std::get<int>(args.at(flutter::EncodableValue("key")));
if (textures_.find(key) == textures_.end()) {
result->Success(flutter::EncodableValue(-1));
}
else {
// Return an address.
void* rgba = (void*) textures_[key].get();
result->Success(flutter::EncodableValue(rgba));
}
}
else {
result->NotImplemented();
}
}
} // namespace texture_rgba_renderer