summaryrefslogtreecommitdiff
path: root/src/drivers/Quartz
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/Quartz')
-rw-r--r--src/drivers/Quartz/Fl_Quartz_Graphics_Driver.H1
-rw-r--r--src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx19
2 files changed, 3 insertions, 17 deletions
diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.H b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.H
index 51316360d..94bbf000c 100644
--- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.H
+++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.H
@@ -59,7 +59,6 @@ public:
void draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0);
void draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1);
fl_uintptr_t cache(Fl_Pixmap *img, int w, int h, const char *const*array);
- void uncache(Fl_Pixmap *img);
fl_uintptr_t cache(Fl_Bitmap *img, int w, int h, const uchar *array);
void uncache(Fl_RGB_Image *img, fl_uintptr_t &id_, fl_uintptr_t &mask_);
void copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy);
diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx
index 668bb434f..0e1f777f1 100644
--- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx
+++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx
@@ -25,7 +25,6 @@
#include <FL/fl_draw.H>
#include <FL/Fl_Printer.H>
#include <FL/x.H>
-#include <FL/Fl_Image_Surface.H>
#define MAXBUFFER 0x40000 // 256k
@@ -273,25 +272,13 @@ fl_uintptr_t Fl_Quartz_Graphics_Driver::cache(Fl_Bitmap*, int w, int h, const uc
}
fl_uintptr_t Fl_Quartz_Graphics_Driver::cache(Fl_Pixmap *img, int w, int h, const char *const*data) {
- Fl_Image_Surface *surface = new Fl_Image_Surface(w,h);
- surface->set_current();
+ Fl_Offscreen id = fl_create_offscreen(w, h);
+ fl_begin_offscreen(id);
fl_draw_pixmap(data, 0, 0, FL_BLACK);
- surface->end_current();
- Fl_Offscreen id = surface->get_offscreen_before_delete();
- delete surface;
+ fl_end_offscreen();
return (fl_uintptr_t)id;
}
-void Fl_Quartz_Graphics_Driver::uncache(Fl_Pixmap *img)
-{
- if (img->id_) {
- void *data = CGBitmapContextGetData((CGContextRef)img->id_);
- free(data);
- CGContextRelease((CGContextRef)img->id_);
- img->id_ = NULL;
- }
-}
-
void Fl_Quartz_Graphics_Driver::draw_CGImage(CGImageRef cgimg, int x, int y, int w, int h, int srcx, int srcy, int sw, int sh)
{
CGRect rect = CGRectMake(x, y, w, h);