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

Method BlendBlit

src/bitmap.cpp:1014–1042  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1012}
1013
1014void 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
1044void 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()) {

Callers 3

SpriteEffectMethod · 0.80
DrawMethod · 0.80
BM_BlendBlitFunction · 0.80

Calls 4

PixmanColorFunction · 0.85
GetOperatorMethod · 0.80
IsTransparentMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected