summaryrefslogtreecommitdiff
path: root/src/drivers/PostScript
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-04-23 10:03:02 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-04-23 10:03:02 +0200
commit4bf9172a8e4f76842a2e011671cf5c057e8fe1d1 (patch)
tree1c87724b15d5166a6c6f62204f5de2d3e4ac8dd0 /src/drivers/PostScript
parent897a6910b60ad8331ddb451d9dbc6c62da2b4657 (diff)
Replace internal fl_create_offscreen() calls by new Fl_Image_Surface
Diffstat (limited to 'src/drivers/PostScript')
-rw-r--r--src/drivers/PostScript/Fl_PostScript.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/drivers/PostScript/Fl_PostScript.cxx b/src/drivers/PostScript/Fl_PostScript.cxx
index 1db0cc68c..4ce3f67b9 100644
--- a/src/drivers/PostScript/Fl_PostScript.cxx
+++ b/src/drivers/PostScript/Fl_PostScript.cxx
@@ -22,6 +22,7 @@
#include <stdio.h>
#include "Fl_PostScript_Graphics_Driver.H"
#include <FL/Fl_PostScript.H>
+#include <FL/Fl_Image_Surface.H>
#include <FL/Fl_Native_File_Chooser.H>
#include "../../Fl_System_Driver.H"
#include <FL/fl_string_functions.h>
@@ -1128,8 +1129,8 @@ void Fl_PostScript_Graphics_Driver::transformed_draw_extra(const char* str, int
// create an offscreen image of the string
Fl_Color text_color = Fl_Graphics_Driver::color();
Fl_Color bg_color = fl_contrast(FL_WHITE, text_color);
- Fl_Offscreen off = fl_create_offscreen(w_scaled, (int)(h+3*scale) );
- fl_begin_offscreen(off);
+ Fl_Image_Surface *off = new Fl_Image_Surface(w_scaled, (int)(h+3*scale), 1);
+ Fl_Surface_Device::push_current(off);
fl_color(bg_color);
// color offscreen background with a shade contrasting with the text color
fl_rectf(0, 0, w_scaled, (int)(h+3*scale) );
@@ -1147,9 +1148,9 @@ void Fl_PostScript_Graphics_Driver::transformed_draw_extra(const char* str, int
else fl_draw(str, n, 0, (int)(h * 0.8) );
// read (most of) the offscreen image
uchar *img = fl_read_image(NULL, 0, 1, w2, h, 0);
- fl_end_offscreen();
+ Fl_Surface_Device::pop_current();
font(fontnum, old_size);
- fl_delete_offscreen(off);
+ delete off;
// compute the mask of what is not the background
uchar *img_mask = calc_mask(img, w2, h, bg_color);
delete[] img;