diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2023-04-23 10:03:02 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2023-04-23 10:03:02 +0200 |
| commit | 4bf9172a8e4f76842a2e011671cf5c057e8fe1d1 (patch) | |
| tree | 1c87724b15d5166a6c6f62204f5de2d3e4ac8dd0 /src/drivers/X11 | |
| parent | 897a6910b60ad8331ddb451d9dbc6c62da2b4657 (diff) | |
Replace internal fl_create_offscreen() calls by new Fl_Image_Surface
Diffstat (limited to 'src/drivers/X11')
| -rw-r--r-- | src/drivers/X11/Fl_X11_Window_Driver.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/drivers/X11/Fl_X11_Window_Driver.cxx b/src/drivers/X11/Fl_X11_Window_Driver.cxx index 9b4b45de9..c30f36e49 100644 --- a/src/drivers/X11/Fl_X11_Window_Driver.cxx +++ b/src/drivers/X11/Fl_X11_Window_Driver.cxx @@ -26,6 +26,7 @@ #endif // FLTK_USE_CAIRO #include <FL/Fl_Tooltip.H> +#include <FL/Fl_Image_Surface.H> #include <FL/fl_draw.H> #include <FL/fl_ask.H> #include <FL/Fl.H> @@ -158,11 +159,11 @@ void Fl_X11_Window_Driver::flush_double(int erase_overlay) pWindow->make_current(); // make sure fl_gc is non-zero Fl_X *i = Fl_X::flx(pWindow); if (!other_xid) { - other_xid = fl_create_offscreen(w(), h()); + other_xid = new Fl_Image_Surface(w(), h(), 1); #if FLTK_USE_CAIRO - fl_begin_offscreen(other_xid); + Fl_Surface_Device::push_current(other_xid); cairo_ = ((Fl_Cairo_Graphics_Driver*)fl_graphics_driver)->cr(); - fl_end_offscreen(); + Fl_Surface_Device::pop_current(); #endif pWindow->clear_damage(FL_DAMAGE_ALL); } @@ -171,7 +172,7 @@ void Fl_X11_Window_Driver::flush_double(int erase_overlay) #endif if (pWindow->damage() & ~FL_DAMAGE_EXPOSE) { fl_clip_region(i->region); i->region = 0; - fl_window = other_xid; + fl_window = other_xid->offscreen(); # if defined(FLTK_HAVE_CAIROEXT) if (Fl::cairo_autolink_context()) Fl::cairo_make_current(pWindow); # endif @@ -181,7 +182,7 @@ void Fl_X11_Window_Driver::flush_double(int erase_overlay) if (erase_overlay) fl_clip_region(0); int X = 0, Y = 0, W = 0, H = 0; fl_clip_box(0, 0, w(), h(), X, Y, W, H); - if (other_xid) fl_copy_offscreen(X, Y, W, H, other_xid, X, Y); + if (other_xid) fl_copy_offscreen(X, Y, W, H, other_xid->offscreen(), X, Y); } |
