| 7 | AndroidBitmapFactory::~AndroidBitmapFactory() {} |
| 8 | |
| 9 | Valdi::Result<Valdi::Ref<Valdi::IBitmap>> AndroidBitmapFactory::createBitmap(int width, int height) { |
| 10 | auto info = Valdi::BitmapInfo( |
| 11 | width, height, Valdi::ColorType::ColorTypeBGRA8888, Valdi::AlphaType::AlphaTypePremul, width * 4); |
| 12 | auto bitmap = AndroidBitmap::make(info); |
| 13 | if (!bitmap) { |
| 14 | return bitmap.moveError(); |
| 15 | } |
| 16 | |
| 17 | return Valdi::Result<Valdi::Ref<Valdi::IBitmap>>(bitmap.moveValue()); |
| 18 | } |
| 19 | |
| 20 | const Valdi::Ref<AndroidBitmapFactory>& AndroidBitmapFactory::getSharedInstance() { |
| 21 | static auto kInstance = Valdi::makeShared<AndroidBitmapFactory>(); |
no test coverage detected