MCPcopy Create free account
hub / github.com/Snapchat/Valdi / createBitmap

Method createBitmap

valdi/src/valdi/android/AndroidBitmapFactory.cpp:9–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7AndroidBitmapFactory::~AndroidBitmapFactory() {}
8
9Valdi::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
20const Valdi::Ref<AndroidBitmapFactory>& AndroidBitmapFactory::getSharedInstance() {
21 static auto kInstance = Valdi::makeShared<AndroidBitmapFactory>();

Callers 3

getMethod · 0.45
snapshotMethod · 0.45

Calls 1

BitmapInfoClass · 0.50

Tested by

no test coverage detected