| 7 | BitmapFactory::~BitmapFactory() = default; |
| 8 | |
| 9 | Valdi::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 | |
| 22 | const Ref<BitmapFactory>& BitmapFactory::getInstance(Valdi::ColorType colorType) { |
| 23 | switch (colorType) { |
no test coverage detected