X11 platform: Fl_RGB_Image::mask_ is always 0, so remove code to process mask_ in Fl_Xlib_Graphics_Driver.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12119 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy
2016-11-18 15:02:34 +00:00
parent d2378be968
commit 5cf12d94cb
@@ -715,29 +715,10 @@ void Fl_Xlib_Graphics_Driver::draw(Fl_RGB_Image *img, int XP, int YP, int WP, in
}
}
if (*Fl_Graphics_Driver::id(img)) {
if (*Fl_Graphics_Driver::mask(img)) {
// I can't figure out how to combine a mask with existing region,
// so cut the image down to a clipped rectangle:
int nx, ny; fl_clip_box(X,Y,W,H,nx,ny,W,H);
cx += nx-X; X = nx;
cy += ny-Y; Y = ny;
// make X use the bitmap as a mask:
XSetClipMask(fl_display, gc_, *Fl_Graphics_Driver::mask(img));
int ox = X-cx; if (ox < 0) ox += img->w();
int oy = Y-cy; if (oy < 0) oy += img->h();
XSetClipOrigin(fl_display, gc_, X-cx, Y-cy);
}
if (img->d() == 4 && fl_can_do_alpha_blending())
copy_offscreen_with_alpha(X, Y, W, H, *Fl_Graphics_Driver::id(img), cx, cy);
else
copy_offscreen(X, Y, W, H, *Fl_Graphics_Driver::id(img), cx, cy);
if (*Fl_Graphics_Driver::mask(img)) {
// put the old clip region back
XSetClipOrigin(fl_display, gc_, 0, 0);
fl_restore_clip();
}
} else {
// Composite image with alpha manually each time...
alpha_blend(img, X, Y, W, H, cx, cy);
@@ -750,11 +731,6 @@ void Fl_Xlib_Graphics_Driver::uncache(Fl_RGB_Image*, fl_uintptr_t &id_, fl_uintp
XFreePixmap(fl_display, (Fl_Offscreen)id_);
id_ = 0;
}
if (mask_) {
fl_delete_bitmask((Fl_Bitmask)mask_);
mask_ = 0;
}
}
fl_uintptr_t Fl_Xlib_Graphics_Driver::cache(Fl_Bitmap*, int w, int h, const uchar *array) {