win test commit (#2)

Signed-off-by: fufesou <shuanglongchen@yeah.net>
Co-authored-by: fufesou <shuanglongchen@yeah.net>
Co-authored-by: fufesou <fufesou@users.noreply.github.com>
This commit is contained in:
Kingtous 2023-02-18 04:39:00 -08:00 • committed by GitHub
parent 35e480aa73
commit e118e96341
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 57 additions and 20 deletions

View file

@ -80,14 +80,18 @@ void TextureRgbaRendererPlugin::HandleMethodCall(
}
}
else if (method_call.method_name().compare("getTexturePtr") == 0) {
std::cout << "REMOVE ME ==================== getTexturePtr 111" << std::endl;
auto args = std::get<flutter::EncodableMap>(*method_call.arguments());
auto key = std::get<int>(args.at(flutter::EncodableValue("key")));
std::cout << "REMOVE ME ==================== getTexturePtr 222 key " << key << std::endl;
if (textures_.find(key) == textures_.end()) {
std::cout << "REMOVE ME ==================== getTexturePtr 333" << std::endl;
result->Success(flutter::EncodableValue(-1));
}
else {
// Return an address.
size_t rgba = reinterpret_cast<size_t>((void*) textures_[key].get());
std::cout << "REMOVE ME ==================== getTexturePtr 444" << std::endl;
result->Success(flutter::EncodableValue(int64_t(rgba)));
}
}