From 43935dffeb7cb54a97b2a8a610c2e453743c0da9 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Wed, 7 Dec 2016 15:09:52 +0000 Subject: Add static void Fl_Surface_Device::push_current(Fl_Surface_Device *new_current) and pop_current() to set/unset the current drawing surface. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12140 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx') diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx index 7ecb5471e..96f8b0685 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx @@ -714,10 +714,9 @@ void Fl_Xlib_Graphics_Driver::draw(Fl_RGB_Image *img, int XP, int YP, int WP, in depth |= FL_IMAGE_WITH_ALPHA; } if (surface) { - Fl_Surface_Device *old_surf = Fl_Surface_Device::surface(); - surface->set_current(); + Fl_Surface_Device::push_current(surface); fl_draw_image(img->array, 0, 0, img->w(), img->h(), depth, img->ld()); - old_surf->set_current(); + Fl_Surface_Device::pop_current(); *Fl_Graphics_Driver::id(img) = surface->get_offscreen_before_delete(); delete surface; } -- cgit v1.2.3