summaryrefslogtreecommitdiff
path: root/src/drivers/Quartz/Fl_Quartz_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/Quartz/Fl_Quartz_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/Quartz/Fl_Quartz_Graphics_Driver_image.cxx')
-rw-r--r--src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx5
1 files changed, 2 insertions, 3 deletions
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);