summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FL/x.H1
-rw-r--r--src/Fl_x.cxx19
-rw-r--r--src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx6
3 files changed, 10 insertions, 16 deletions
diff --git a/FL/x.H b/FL/x.H
index 35ee1e0e5..1daa3ba0e 100644
--- a/FL/x.H
+++ b/FL/x.H
@@ -136,7 +136,6 @@ public:
static void x(Fl_Window* wi, int X) {wi->x(X);}
static void y(Fl_Window* wi, int Y) {wi->y(Y);}
static int ewmh_supported();
- static int xrender_supported();
static void activate_window(Window w);
static void copy_image(const unsigned char* data, int W, int H, int destination = 0);
};
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 <unistd.h>
# include <time.h>
# include <sys/time.h>
@@ -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);
}