| 779 | } |
| 780 | |
| 781 | void Bitmap::ClearRect(Rect const& dst_rect) { |
| 782 | pixman_color_t pcolor = {}; |
| 783 | pixman_box32_t box = { |
| 784 | dst_rect.x, |
| 785 | dst_rect.y, |
| 786 | dst_rect.x + dst_rect.width, |
| 787 | dst_rect.y + dst_rect.height |
| 788 | }; |
| 789 | |
| 790 | box.x2 = Utils::Clamp<int32_t>(box.x2, 0, width()); |
| 791 | box.y2 = Utils::Clamp<int32_t>(box.y2, 0, height()); |
| 792 | |
| 793 | pixman_image_fill_boxes(PIXMAN_OP_CLEAR, bitmap.get(), &pcolor, 1, &box); |
| 794 | } |
| 795 | |
| 796 | // Hard light lookup table mapping source color to destination color |
| 797 | // FIXME: Replace this with std::array<std::array<uint8_t,256>,256> when we have C++17 |
no test coverage detected