| 29 | } |
| 30 | |
| 31 | Valdi::Result<Ref<Bitmap>> Bitmap::make(const Valdi::BitmapInfo& info) { |
| 32 | SkBitmap skBitmap; |
| 33 | auto imageInfo = toSkiaImageInfo(info); |
| 34 | if (!skBitmap.tryAllocPixels(imageInfo, std::max(info.rowBytes, imageInfo.minRowBytes()))) { |
| 35 | return Valdi::Error("Failed to allocate pixels for bitmap"); |
| 36 | } |
| 37 | |
| 38 | return Valdi::makeShared<Bitmap>(std::move(skBitmap)); |
| 39 | } |
| 40 | |
| 41 | } // namespace snap::drawing |
nothing calls this directly
no test coverage detected