diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_Image_Surface.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/Fl_Image_Surface.cxx b/src/Fl_Image_Surface.cxx index b64004a61..11ea267dc 100644 --- a/src/Fl_Image_Surface.cxx +++ b/src/Fl_Image_Surface.cxx @@ -41,6 +41,7 @@ Fl_Image_Surface::Fl_Image_Surface(int w, int h) : Fl_Surface_Device(NULL) { #ifdef __APPLE__ helper = new Fl_Quartz_Flipped_Surface_(width, height); driver(helper->driver()); + CGContextSaveGState(offscreen); #elif defined(WIN32) helper = new Fl_GDI_Surface_(); driver(helper->driver()); @@ -73,7 +74,7 @@ Fl_RGB_Image* Fl_Image_Surface::image() #ifdef __APPLE__ CGContextFlush(offscreen); data = fl_read_image(NULL, 0, 0, width, height, 0); - fl_end_offscreen(); + fl_gc = 0; #elif defined(WIN32) fl_pop_clip(); data = fl_read_image(NULL, 0, 0, width, height, 0); @@ -108,10 +109,8 @@ void Fl_Image_Surface::draw(Fl_Widget *widget, int delta_x, int delta_y) void Fl_Image_Surface::set_current() { #if defined(__APPLE__) - fl_begin_offscreen(offscreen); - fl_pop_clip(); - Fl_Surface_Device::set_current(); - fl_push_no_clip(); + fl_gc = offscreen; fl_window = 0; + Fl_Surface_Device::set_current(); #elif defined(WIN32) _sgc=fl_gc; _sw=fl_window; |
