|
|
|
@ -107,35 +107,6 @@ void Fl_Wayland_Gl_Window_Driver::init() {
@@ -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; |
|
|
|
|