From c720aae51515907ae82ee02df80bd084f291d4b1 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Tue, 15 Mar 2022 06:42:06 +0100 Subject: Make hybrid Wayland/X11 platform. --- src/Fl_Image_Surface.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/Fl_Image_Surface.cxx') diff --git a/src/Fl_Image_Surface.cxx b/src/Fl_Image_Surface.cxx index e2870e578..1a5f5ec31 100644 --- a/src/Fl_Image_Surface.cxx +++ b/src/Fl_Image_Surface.cxx @@ -37,6 +37,7 @@ */ Fl_Image_Surface::Fl_Image_Surface(int w, int h, int high_res, Fl_Offscreen off) : Fl_Widget_Surface(NULL) { platform_surface = Fl_Image_Surface_Driver::newImageSurfaceDriver(w, h, high_res, off); + platform_surface->image_surface_ = this; if (platform_surface) driver(platform_surface->driver()); } @@ -88,6 +89,10 @@ int Fl_Image_Surface_Driver::printable_rect(int *w, int *h) { *w = width; *h = height; return 0; } + +Fl_Image_Surface *Fl_Image_Surface_Driver::as_image_surface() { + return image_surface_; +} /** \} \endcond @@ -149,6 +154,12 @@ void Fl_Image_Surface::rescale() { delete rgb; } + +Fl_Image_Surface *Fl_Image_Surface::as_image_surface() { + return this; +} + + // implementation of the fl_XXX_offscreen() functions static Fl_Image_Surface **offscreen_api_surface = NULL; -- cgit v1.2.3