fix bug in alpha blit and bugs in blit caching
svn: r1429
This commit is contained in:
parent
3ca2e32bb1
commit
37d51461bf
|
@ -2500,8 +2500,12 @@ Bool wxDC::Blit(double xdest, double ydest, double width, double height,
|
|||
invented_memdc = source->mask_cache;
|
||||
invented_dc = invented_memdc->ThisDC();
|
||||
if (mask->GetDepth() > 1) {
|
||||
if (wxAlphaBlend)
|
||||
if (wxAlphaBlend) {
|
||||
invented = invented_memdc->selected_bitmap;
|
||||
if (invented->IsDIB())
|
||||
use_alpha = 1;
|
||||
invented = NULL;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
wxBitmap *orig_mask = mask;
|
||||
|
@ -2567,25 +2571,7 @@ Bool wxDC::Blit(double xdest, double ydest, double width, double height,
|
|||
}
|
||||
}
|
||||
} else {
|
||||
/* Want white where mask was white,
|
||||
src otherwise: */
|
||||
BitBlt(invented_dc, 0, 0,
|
||||
iw, ih,
|
||||
mdc, xsrc1, ysrc1,
|
||||
SRCPAINT /* DSo */);
|
||||
|
||||
/* Ignore the mask and... */
|
||||
mask = NULL;
|
||||
if (mono_src) {
|
||||
/* Mono source: Now use invented_dc instead of src_dc,
|
||||
and it all works out. */
|
||||
xsrc1 = 0;
|
||||
xsrc1 = 0;
|
||||
} else {
|
||||
/* Paint on dest using mask, then "and" invented image
|
||||
with dest. */
|
||||
invented_col = 1;
|
||||
}
|
||||
/* Continues below */
|
||||
}
|
||||
} else {
|
||||
/* Failed (Rest of failure handling below since !invented_memdc) */
|
||||
|
@ -2629,6 +2615,28 @@ Bool wxDC::Blit(double xdest, double ydest, double width, double height,
|
|||
}
|
||||
}
|
||||
|
||||
if (invented_dc && !use_alpha) {
|
||||
/* Want white where mask was white,
|
||||
src otherwise: */
|
||||
BitBlt(invented_dc, 0, 0,
|
||||
iw, ih,
|
||||
mdc, xsrc1, ysrc1,
|
||||
SRCPAINT /* DSo */);
|
||||
|
||||
/* Ignore the mask and... */
|
||||
mask = NULL;
|
||||
if (source->GetDepth() == 1) {
|
||||
/* Mono source: Now use invented_dc instead of src_dc,
|
||||
and it all works out. */
|
||||
xsrc1 = 0;
|
||||
xsrc1 = 0;
|
||||
} else {
|
||||
/* Paint on dest using mask, then "and" invented image
|
||||
with dest. */
|
||||
invented_col = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (use_alpha) {
|
||||
BLENDFUNCTION bf;
|
||||
|
||||
|
|
|
@ -1746,6 +1746,7 @@ void *wxBitmap::ChangeToDIBSection(Bool copy_old)
|
|||
HBITMAP bm;
|
||||
void *pBits;
|
||||
|
||||
memset(&bmp, 0, sizeof(bmp));
|
||||
bmp.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
|
||||
bmp.bmiHeader.biWidth = width;
|
||||
bmp.bmiHeader.biHeight = height;
|
||||
|
|
Loading…
Reference in New Issue
Block a user