| 661 | } |
| 662 | |
| 663 | void BitmapCanvas::begin(const Colorf& color) |
| 664 | { |
| 665 | uiscale = window->GetDpiScale(); |
| 666 | |
| 667 | uint32_t r = (int32_t)clamp(color.r * 255.0f, 0.0f, 255.0f); |
| 668 | uint32_t g = (int32_t)clamp(color.g * 255.0f, 0.0f, 255.0f); |
| 669 | uint32_t b = (int32_t)clamp(color.b * 255.0f, 0.0f, 255.0f); |
| 670 | uint32_t a = (int32_t)clamp(color.a * 255.0f, 0.0f, 255.0f); |
| 671 | uint32_t bgcolor = (a << 24) | (r << 16) | (g << 8) | b; |
| 672 | width = window->GetPixelWidth(); |
| 673 | height = window->GetPixelHeight(); |
| 674 | pixels.clear(); |
| 675 | pixels.resize(width * height, bgcolor); |
| 676 | } |
| 677 | |
| 678 | void BitmapCanvas::end() |
| 679 | { |
no test coverage detected