From 4bf9172a8e4f76842a2e011671cf5c057e8fe1d1 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Sun, 23 Apr 2023 10:03:02 +0200 Subject: Replace internal fl_create_offscreen() calls by new Fl_Image_Surface --- src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'src/drivers/Quartz') diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx index d3f3d343a..fcd9e89c7 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx @@ -111,17 +111,8 @@ void Fl_Quartz_Graphics_Driver::copy_offscreen(int x, int y, int w, int h, Fl_Of CGDataProviderRelease(src_bytes); CGColorSpaceRelease(lut); } - float s = scale(); - Fl_Surface_Device *current = Fl_Surface_Device::surface(); - // test whether osrc was created by fl_create_offscreen() - fl_begin_offscreen(osrc); // does nothing if osrc was not created by fl_create_offscreen() - if (current != Fl_Surface_Device::surface()) { // osrc was created by fl_create_offscreen() - Fl_Image_Surface *imgs = (Fl_Image_Surface*)Fl_Surface_Device::surface(); - int pw, ph; - imgs->printable_rect(&pw, &ph); - s = sw / float(pw); - fl_end_offscreen(); - } + CGAffineTransform at = CGContextGetCTM(src); + float s = at.a; draw_CGImage(img, x, y, w, h, srcx, srcy, sw/s, sh/s); CGImageRelease(img); } -- cgit v1.2.3