Open ciderwolf opened 4 years ago
I can't think of an easy way to fix this. Probably the best solution is to not rely on OS native code for rendering at all, and use cairo everywhere (#62).
This is somewhat sketchy, but it does replicate the AND_INVERT
functionality manually.
if(interior) {
wxImage sourceImg = interior->GetAsBitmap().ConvertToImage();
wxImage destImg = dc.GetAsBitmap().ConvertToImage();
Byte* src = sourceImg.GetData();
Byte* dest = destImg.GetData();
size_t size = sourceImg.GetWidth() * sourceImg.GetHeight() * 3;
Byte* combined = (Byte*) malloc(size);
for(size_t i = 0; i < size; i++) {
// AND_INVERT == (NOT src) AND dst
combined[i] = (~src[i]) & dest[i];
}
wxImage img = wxImage(sourceImg.GetWidth(), sourceImg.GetHeight());
img.SetData(combined);
wxBitmap x = wxBitmap(img);
dc.DrawBitmap(x, 0, 0);
}
Mac only supports a limited subset of the usual raster operation modes (see here), which causes MSE to crash when rendering symbols here.