MCPcopy Create free account
hub / github.com/EasyRPG/Player / MaskedBlit

Method MaskedBlit

src/bitmap.cpp:1096–1111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1094}
1095
1096void Bitmap::MaskedBlit(Rect const& dst_rect, Bitmap const& mask, int mx, int my, Color const& color) {
1097 pixman_color_t tcolor = {
1098 static_cast<uint16_t>(color.red << 8),
1099 static_cast<uint16_t>(color.green << 8),
1100 static_cast<uint16_t>(color.blue << 8),
1101 static_cast<uint16_t>(color.alpha << 8)};
1102
1103 auto source = PixmanImagePtr{ pixman_image_create_solid_fill(&tcolor) };
1104
1105 pixman_image_composite32(PIXMAN_OP_OVER,
1106 source.get(), mask.bitmap.get(), bitmap.get(),
1107 0, 0,
1108 mx, my,
1109 dst_rect.x, dst_rect.y,
1110 dst_rect.width, dst_rect.height);
1111}
1112
1113void Bitmap::MaskedBlit(Rect const& dst_rect, Bitmap const& mask, int mx, int my, Bitmap const& src, int sx, int sy) {
1114 pixman_image_composite32(PIXMAN_OP_OVER,

Callers 4

RenderImplMethod · 0.80
RenderMethod · 0.80
BM_MaskedBlitFunction · 0.80
BM_MaskedColorBlitFunction · 0.80

Calls 1

getMethod · 0.45

Tested by

no test coverage detected