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/Cocoa/Fl_Cocoa_Window_Driver.cxx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/drivers/Cocoa') diff --git a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx index 4d3c3ab3d..e479a4d8b 100644 --- a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx +++ b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx @@ -54,20 +54,18 @@ void Fl_Cocoa_Window_Driver::flush_overlay() if (!oWindow->shown()) return; pWindow->make_current(); // make sure fl_gc is non-zero if (!other_xid) { - other_xid = fl_create_offscreen(oWindow->w(), oWindow->h()); + other_xid = new Fl_Image_Surface(oWindow->w(), oWindow->h(), 1); oWindow->clear_damage(FL_DAMAGE_ALL); } if (oWindow->damage() & ~FL_DAMAGE_EXPOSE) { Fl_X *myi = Fl_X::flx(pWindow); fl_clip_region(myi->region); myi->region = 0; - fl_begin_offscreen(other_xid); + Fl_Surface_Device::push_current(other_xid); draw(); - fl_end_offscreen(); + Fl_Surface_Device::pop_current(); } if (erase_overlay) fl_clip_region(0); - if (other_xid) { - fl_copy_offscreen(0, 0, oWindow->w(), oWindow->h(), other_xid, 0, 0); - } + fl_copy_offscreen(0, 0, oWindow->w(), oWindow->h(), other_xid->offscreen(), 0, 0); if (overlay() == oWindow) oWindow->draw_overlay(); } -- cgit v1.2.3