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

Method createBitmap

snap_drawing/src/snap_drawing/cpp/Utils/BitmapFactory.cpp:9–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7BitmapFactory::~BitmapFactory() = default;
8
9Valdi::Result<Ref<Valdi::IBitmap>> BitmapFactory::createBitmap(int width, int height) {
10 auto info = Valdi::BitmapInfo(width,
11 height,
12 _colorType,
13 Valdi::AlphaType::AlphaTypePremul,
14 width * Valdi::BitmapInfo::bytesPerPixelForColorType(_colorType));
15 auto result = Bitmap::make(info);
16 if (!result) {
17 return result.moveError();
18 }
19 return Ref<Valdi::IBitmap>(result.moveValue());
20}
21
22const Ref<BitmapFactory>& BitmapFactory::getInstance(Valdi::ColorType colorType) {
23 switch (colorType) {

Callers 3

rasterizeSVGFunction · 0.45
allocateBitmapMethod · 0.45
rasterExternalSurfaceMethod · 0.45

Calls 1

BitmapInfoClass · 0.50

Tested by

no test coverage detected