From b17357339f66949de7787e83aa9d21d613439170 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Sun, 9 Jun 2024 20:04:23 +0200 Subject: Fix: Changing default color palette affects opengl child drawing on Wayland (#989) --- src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H | 2 -- .../Wayland/Fl_Wayland_Gl_Window_Driver.cxx | 29 ---------------------- 2 files changed, 31 deletions(-) (limited to 'src') diff --git a/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H b/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H index df321fc10..206efeb80 100644 --- a/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H +++ b/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H @@ -56,8 +56,6 @@ private: void redraw_overlay() FL_OVERRIDE; void gl_start() FL_OVERRIDE; void gl_visual(Fl_Gl_Choice *c) FL_OVERRIDE; - char *alpha_mask_for_string( - const char *str, int n, int w, int h, Fl_Fontsize fs) FL_OVERRIDE; void init(); public: //virtual bool need_scissor() { return true; } // CONTROL_LEAKING_SUB_GL_WINDOWS diff --git a/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx index 5f96480ab..d25738ab3 100644 --- a/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx @@ -107,35 +107,6 @@ void Fl_Wayland_Gl_Window_Driver::init() { } -char *Fl_Wayland_Gl_Window_Driver::alpha_mask_for_string(const char *str, int n, - int w, int h, Fl_Fontsize fs) -{ - // write str to a bitmap just big enough - Fl_Image_Surface *surf = new Fl_Image_Surface(w, h); - Fl_Font f = fl_font(); - Fl_Surface_Device::push_current(surf); - fl_color(FL_BLACK); - fl_rectf(0, 0, w, h); - fl_color(FL_WHITE); - fl_font(f, fs); - fl_draw(str, n, 0, fl_height() - fl_descent()); - // get the R channel only of the bitmap - char *alpha_buf = new char[w*h], *r = alpha_buf; - struct Fl_Wayland_Graphics_Driver::draw_buffer *off = - Fl_Wayland_Graphics_Driver::offscreen_buffer(surf->offscreen()); - for (int i = 0; i < h; i++) { - uchar *q = off->buffer + i * off->stride; - for (int j = 0; j < w; j++) { - *r++ = *q; - q += 4; - } - } - Fl_Surface_Device::pop_current(); - delete surf; - return alpha_buf; -} - - Fl_Gl_Choice *Fl_Wayland_Gl_Window_Driver::find(int m, const int *alistp) { m |= FL_DOUBLE; -- cgit v1.2.3