summaryrefslogtreecommitdiff
path: root/src/drivers/Quartz
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-11-30 07:09:48 +0000
committerManolo Gouy <Manolo>2016-11-30 07:09:48 +0000
commit5bb4e853c7c80fa16e568f47c49c2282d197a19c (patch)
treeac17b71e7b3f34e688af8aa85d355f940a8a5438 /src/drivers/Quartz
parent4755ace9e9252c7cac6e29143fd0662ae62c2bf4 (diff)
Remove Fl_Image_Surface::end_current() to be called after usage of the drawing surface.
This ensures API compatibility with FLTK 1.3 where Fl_Surface_Device->set_current() is used to change the current drawing surface. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12125 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/Quartz')
-rw-r--r--src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx3
-rw-r--r--src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx5
2 files changed, 4 insertions, 4 deletions
diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx
index 0c1e59678..ca3d74734 100644
--- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx
+++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx
@@ -251,11 +251,12 @@ 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_draw_pixmap(data, 0, 0, FL_BLACK);
CGContextRef src = surf->get_offscreen_before_delete();
- surf->end_current();
+ old->set_current();
delete surf;
void *cgdata = CGBitmapContextGetData(src);
int sw = CGBitmapContextGetWidth(src);
diff --git a/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx b/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx
index 59a3b5e93..1a2e3de5e 100644
--- a/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx
+++ b/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx
@@ -27,6 +27,7 @@
class Fl_Quartz_Image_Surface_Driver : public Fl_Image_Surface_Driver {
friend class Fl_Image_Surface;
+ virtual void end_current_();
public:
Fl_Surface_Device *previous;
Window pre_window;
@@ -36,7 +37,6 @@ public:
void translate(int x, int y);
void untranslate();
Fl_RGB_Image *image();
- void end_current();
};
@@ -108,9 +108,8 @@ Fl_RGB_Image* Fl_Quartz_Image_Surface_Driver::image()
return image;
}
-void Fl_Quartz_Image_Surface_Driver::end_current()
+void Fl_Quartz_Image_Surface_Driver::end_current_()
{
- previous->Fl_Surface_Device::set_current();
fl_window = pre_window;
}