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_memdc = source->mask_cache;
|
||||||
invented_dc = invented_memdc->ThisDC();
|
invented_dc = invented_memdc->ThisDC();
|
||||||
if (mask->GetDepth() > 1) {
|
if (mask->GetDepth() > 1) {
|
||||||
if (wxAlphaBlend)
|
if (wxAlphaBlend) {
|
||||||
use_alpha = 1;
|
invented = invented_memdc->selected_bitmap;
|
||||||
|
if (invented->IsDIB())
|
||||||
|
use_alpha = 1;
|
||||||
|
invented = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
wxBitmap *orig_mask = mask;
|
wxBitmap *orig_mask = mask;
|
||||||
|
@ -2567,25 +2571,7 @@ Bool wxDC::Blit(double xdest, double ydest, double width, double height,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Want white where mask was white,
|
/* Continues below */
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Failed (Rest of failure handling below since !invented_memdc) */
|
/* 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) {
|
if (use_alpha) {
|
||||||
BLENDFUNCTION bf;
|
BLENDFUNCTION bf;
|
||||||
|
|
||||||
|
|
|
@ -1745,7 +1745,8 @@ void *wxBitmap::ChangeToDIBSection(Bool copy_old)
|
||||||
BITMAPINFO bmp;
|
BITMAPINFO bmp;
|
||||||
HBITMAP bm;
|
HBITMAP bm;
|
||||||
void *pBits;
|
void *pBits;
|
||||||
|
|
||||||
|
memset(&bmp, 0, sizeof(bmp));
|
||||||
bmp.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
|
bmp.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
|
||||||
bmp.bmiHeader.biWidth = width;
|
bmp.bmiHeader.biWidth = width;
|
||||||
bmp.bmiHeader.biHeight = height;
|
bmp.bmiHeader.biHeight = height;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user