fl_copy_offscreen_with_alpha: always call alpha_blend if not on display

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7378 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2010-03-31 09:29:35 +00:00
parent 1d7e6edead
commit fc95afb7f4

View File

@ -153,10 +153,7 @@ void fl_copy_offscreen_with_alpha(int x,int y,int w,int h,HBITMAP bitmap,int src
BOOL alpha_ok = 0; BOOL alpha_ok = 0;
// first try to alpha blend // first try to alpha blend
int to_display = Fl_Device::current()->type() < 256; // true iff display output int to_display = Fl_Device::current()->type() < 256; // true iff display output
if ( !to_display) { // ask if non-display device can alpha-blend pixel by pixel if ( (!to_display) || fl_can_do_alpha_blending()) // if not on display, always try alpha_blend
alpha_ok = (GetDeviceCaps(fl_gc, SHADEBLENDCAPS) == SB_PIXEL_ALPHA);
}
if (alpha_ok || (to_display && fl_can_do_alpha_blending()))
alpha_ok = fl_alpha_blend(fl_gc, x, y, w, h, new_gc, srcx, srcy, w, h, blendfunc); alpha_ok = fl_alpha_blend(fl_gc, x, y, w, h, new_gc, srcx, srcy, w, h, blendfunc);
// if that failed (it shouldn't), still copy the bitmap over, but now alpha is 1 // if that failed (it shouldn't), still copy the bitmap over, but now alpha is 1
if (!alpha_ok) if (!alpha_ok)