| 1012 | } |
| 1013 | |
| 1014 | void Bitmap::BlendBlit(int x, int y, Bitmap const& src, Rect const& src_rect, const Color& color, Opacity const& opacity) { |
| 1015 | if (opacity.IsTransparent()) { |
| 1016 | return; |
| 1017 | } |
| 1018 | |
| 1019 | if (color.alpha == 0) { |
| 1020 | if (&src != this) |
| 1021 | Blit(x, y, src, src_rect, opacity); |
| 1022 | return; |
| 1023 | } |
| 1024 | |
| 1025 | if (&src != this) |
| 1026 | pixman_image_composite32(src.GetOperator(), |
| 1027 | src.bitmap.get(), nullptr, bitmap.get(), |
| 1028 | src_rect.x, src_rect.y, |
| 1029 | 0, 0, |
| 1030 | x, y, |
| 1031 | src_rect.width, src_rect.height); |
| 1032 | |
| 1033 | pixman_color_t tcolor = PixmanColor(color); |
| 1034 | auto timage = PixmanImagePtr{ pixman_image_create_solid_fill(&tcolor) }; |
| 1035 | |
| 1036 | pixman_image_composite32(PIXMAN_OP_OVER, |
| 1037 | timage.get(), src.bitmap.get(), bitmap.get(), |
| 1038 | 0, 0, |
| 1039 | src_rect.x, src_rect.y, |
| 1040 | x, y, |
| 1041 | src_rect.width, src_rect.height); |
| 1042 | } |
| 1043 | |
| 1044 | void Bitmap::FlipBlit(int x, int y, Bitmap const& src, Rect const& src_rect, bool horizontal, bool vertical, Opacity const& opacity, Bitmap::BlendMode blend_mode) { |
| 1045 | if (opacity.IsTransparent()) { |
no test coverage detected