summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-11-18 15:32:33 +0000
committerManolo Gouy <Manolo>2016-11-18 15:32:33 +0000
commit18d478055ecb7421309202fcecb844a641c73f16 (patch)
tree44ee536ba2d03c76d8df6114b4dd8e7694982772
parent5cf12d94cbec1b2b421d8743cb39840d9c6fa737 (diff)
Fix for STR#3353: bad depth-2 image drawing when the window is resized smaller than the image.
The problem is specific to the X11 platform. The cause is that depth-2 images were not considered in a previous change (r.10628) that introduced transparent image drawing with alpha blending. Depth-2 images can be processed just as depth-4 images with alpha-blending. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12120 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx
index 9cddae1d5..89099f25b 100644
--- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx
+++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx
@@ -701,7 +701,7 @@ void Fl_Xlib_Graphics_Driver::draw(Fl_RGB_Image *img, int XP, int YP, int WP, in
int depth = img->d();
if (depth == 1 || depth == 3) {
surface = new Fl_Image_Surface(img->w(), img->h());
- } else if (depth == 4 && fl_can_do_alpha_blending()) {
+ } else if (can_do_alpha_blending()) {
Fl_Offscreen pixmap = XCreatePixmap(fl_display, RootWindow(fl_display, fl_screen), img->w(), img->h(), 32);
surface = new Fl_Image_Surface(img->w(), img->h(), 0, pixmap);
depth |= FL_IMAGE_WITH_ALPHA;
@@ -715,7 +715,7 @@ void Fl_Xlib_Graphics_Driver::draw(Fl_RGB_Image *img, int XP, int YP, int WP, in
}
}
if (*Fl_Graphics_Driver::id(img)) {
- if (img->d() == 4 && fl_can_do_alpha_blending())
+ if (img->d() == 4 || img->d() == 2)
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);