From 083e9ed06aa8c9862abad7eabdcf5ad5782da8eb Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Sat, 16 Apr 2016 09:01:19 +0000 Subject: Begin moving non window-related member functions out of Fl_X class. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11629 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_x.cxx | 19 ++++++++++--------- src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx | 6 ------ 2 files changed, 10 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx index 47b984480..cdcbfe4f6 100644 --- a/src/Fl_x.cxx +++ b/src/Fl_x.cxx @@ -40,6 +40,7 @@ # include "drivers/X11/Fl_X11_Screen_Driver.H" # include "drivers/X11/Fl_X11_Window_Driver.H" # include "drivers/X11/Fl_X11_System_Driver.H" +# include "drivers/Xlib/Fl_Xlib_Graphics_Driver.H" # include # include # include @@ -2194,17 +2195,17 @@ int Fl_X::ewmh_supported() { return result; } -int Fl_X::xrender_supported() { #if HAVE_XRENDER - static int result = -1; - - if (result == -1) { - fl_open_display(); - - int nop1, nop2; - result = XRenderQueryExtension(fl_display, &nop1, &nop2); - } +static int xrender_supported() { + int nop1, nop2; + fl_open_display(); + return XRenderQueryExtension(fl_display, &nop1, &nop2); +} +#endif +char Fl_Xlib_Graphics_Driver::can_do_alpha_blending() { +#if HAVE_XRENDER + static char result = (char)xrender_supported(); return result; #else return 0; diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx index 98dafbb7e..44d0ad1a5 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx @@ -61,12 +61,6 @@ void Fl_Xlib_Graphics_Driver::gc(void *value) { fl_gc = gc_; } - -char Fl_Xlib_Graphics_Driver::can_do_alpha_blending() { - return Fl_X::xrender_supported(); -} - - void Fl_Xlib_Graphics_Driver::copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy) { XCopyArea(fl_display, pixmap, fl_window, gc_, srcx, srcy, w, h, x, y); } -- cgit v1.2.3