diff options
| author | Manolo Gouy <Manolo> | 2016-12-07 15:09:52 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-12-07 15:09:52 +0000 |
| commit | 43935dffeb7cb54a97b2a8a610c2e453743c0da9 (patch) | |
| tree | 9f132039b9cf120263bf03965c152ac17853969c /src/drivers/Quartz | |
| parent | 0a1eed150a9d9215f70f1e50db2ec555199aee7d (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')
| -rw-r--r-- | src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx | 5 | ||||
| -rw-r--r-- | src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx | 3 |
2 files changed, 2 insertions, 6 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); diff --git a/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx b/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx index 1a2e3de5e..cb22904aa 100644 --- a/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx @@ -29,7 +29,6 @@ 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; Fl_Quartz_Image_Surface_Driver(int w, int h, int high_res); ~Fl_Quartz_Image_Surface_Driver(); @@ -47,7 +46,6 @@ Fl_Image_Surface_Driver *Fl_Image_Surface_Driver::newImageSurfaceDriver(int w, i Fl_Quartz_Image_Surface_Driver::Fl_Quartz_Image_Surface_Driver(int w, int h, int high_res) : Fl_Image_Surface_Driver(w, h, high_res, 0) { - previous = 0; int W = high_res ? 2*w : w; int H = high_res ? 2*h : h; CGColorSpaceRef lut = CGColorSpaceCreateDeviceRGB(); @@ -77,7 +75,6 @@ Fl_Quartz_Image_Surface_Driver::~Fl_Quartz_Image_Surface_Driver() { void Fl_Quartz_Image_Surface_Driver::set_current() { pre_window = fl_window; - if (!previous) previous = Fl_Surface_Device::surface(); driver()->gc(offscreen); fl_window = 0; Fl_Surface_Device::set_current(); |
