summaryrefslogtreecommitdiff
path: root/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-12-07 15:09:52 +0000
committerManolo Gouy <Manolo>2016-12-07 15:09:52 +0000
commit43935dffeb7cb54a97b2a8a610c2e453743c0da9 (patch)
tree9f132039b9cf120263bf03965c152ac17853969c /src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx
parent0a1eed150a9d9215f70f1e50db2ec555199aee7d (diff)
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
Diffstat (limited to 'src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx')
-rw-r--r--src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx5
1 files changed, 2 insertions, 3 deletions
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;
}