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/Quartz/Fl_Quartz_Graphics_Driver_image.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx') diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx index ca3d74734..00d96ea42 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx @@ -251,12 +251,11 @@ static void pmProviderRelease (void *ctxt, const void *data, size_t size) { } fl_uintptr_t Fl_Quartz_Graphics_Driver::cache(Fl_Pixmap *img, int w, int h, const char *const*data) { - Fl_Surface_Device *old = Fl_Surface_Device::surface(); Fl_Image_Surface *surf = new Fl_Image_Surface(w, h); - surf->set_current(); + Fl_Surface_Device::push_current(surf); fl_draw_pixmap(data, 0, 0, FL_BLACK); CGContextRef src = surf->get_offscreen_before_delete(); - old->set_current(); + Fl_Surface_Device::pop_current(); delete surf; void *cgdata = CGBitmapContextGetData(src); int sw = CGBitmapContextGetWidth(src); -- cgit v1.2.3