Fix Fl_Xlib_Graphics_Driver::draw(Fl_RGB_Image *,...) that was incompletely changed in earlier commit.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11280 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2016-03-04 08:20:55 +00:00
parent 750c372b29
commit d1d57d1253
1 changed files with 8 additions and 6 deletions

View File

@ -714,7 +714,7 @@ void Fl_Xlib_Graphics_Driver::draw(Fl_RGB_Image *img, int XP, int YP, int WP, in
return;
}
if (!img->id_) {
Fl_Image_Surface *surface;
Fl_Image_Surface *surface = NULL;
int depth = img->d();
if (depth == 1 || depth == 3) {
surface = new Fl_Image_Surface(img->w(), img->h());
@ -723,11 +723,13 @@ void Fl_Xlib_Graphics_Driver::draw(Fl_RGB_Image *img, int XP, int YP, int WP, in
surface = new Fl_Image_Surface(pixmap, img->w(), img->h());
depth |= FL_IMAGE_WITH_ALPHA;
}
surface->set_current();
fl_draw_image(img->array, 0, 0, img->w(), img->h(), depth, img->ld());
surface->end_current();
img->id_ = surface->get_offscreen_before_delete();
delete surface;
if (surface) {
surface->set_current();
fl_draw_image(img->array, 0, 0, img->w(), img->h(), depth, img->ld());
surface->end_current();
img->id_ = surface->get_offscreen_before_delete();
delete surface;
}
}
if (img->id_) {
if (img->mask_) {