From 277cee73b0a888894b5a68c239f4d26780830e8e Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Wed, 22 May 2019 13:37:12 +0200 Subject: Improve drawing of Fl_RGB_Image's to Fl_Copy_Surface on macOS --- src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.cxx | 2 +- src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.cxx b/src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.cxx index 5546a5136..4fe51c513 100644 --- a/src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.cxx @@ -41,7 +41,7 @@ Fl_Copy_Surface_Driver *Fl_Copy_Surface_Driver::newCopySurfaceDriver(int w, int */ Fl_Quartz_Copy_Surface_Driver::Fl_Quartz_Copy_Surface_Driver(int w, int h) : Fl_Copy_Surface_Driver(w, h) { - driver(new Fl_Quartz_Graphics_Driver); + driver(new Fl_Quartz_Printer_Graphics_Driver); prepare_copy_pdf_and_tiff(w, h); } diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx index 71fc08637..5060c2009 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx @@ -152,13 +152,13 @@ void Fl_Quartz_Graphics_Driver::cache(Fl_RGB_Image *rgb) { if (!ld) ld = rgb->data_w() * rgb->d(); CGDataProviderRef src; if ( has_feature(PRINTER) ) { - // When printing, the data at rgb->array are used when the printed page is completed, - // that is, after return from this function. + // When printing or copying to clipboard, the data at rgb->array are used when + // the PDF page is completed, that is, after return from this function. // At that stage, the rgb object has possibly been deleted. It is therefore necessary - // to use a copy of rgb->array for printing. The mask_ member of rgb - // is used to avoid repeating the copy operation if rgb is printed again. + // to use a copy of rgb->array. The mask_ member of rgb + // is used to avoid repeating the copy operation if rgb is drawn again. // The CGImage data provider deletes the copy at the latest of these two events: - // deletion of rgb, and completion of the page where rgb was printed. + // deletion of rgb, and completion of the PDF page where rgb was drawn. size_t total = ld * rgb->data_h(); uchar *copy = new uchar[total]; memcpy(copy, rgb->array, total); -- cgit v1.2.3