From de69ecbda49af9d3bd50c1550045d7ecf37cdd9a Mon Sep 17 00:00:00 2001 From: ayin Date: Sat, 26 Jan 2008 14:24:42 +0000 Subject: [PATCH] Change the compile-time option to disable xft double-buffering to a runtime one. --- doc/rxvt.1.pod | 7 +++++++ src/feature.h | 7 ------- src/init.C | 1 + src/optinc.h | 3 +++ src/rsinc.h | 1 + src/rxvtfont.C | 6 ++---- src/xdefaults.C | 1 + 7 files changed, 15 insertions(+), 11 deletions(-) diff --git a/doc/rxvt.1.pod b/doc/rxvt.1.pod index 23807092..5c7ac7a1 100644 --- a/doc/rxvt.1.pod +++ b/doc/rxvt.1.pod @@ -574,6 +574,13 @@ extensions not documented here): Compile I: Attempt to find a visual with the given bit depth; option B<-depth>. +=item B I + +Compile I: Turn on/off double-buffering for xft (default enabled). +On some card/driver combination enabling it slightly decreases +performance, on most it greatly helps it. The slowdown is small, so it +should normally be enabled. + =item B I Create the window with the specified X window geometry [default 80x24]; diff --git a/src/feature.h b/src/feature.h index fb2c9d0c..46b0b73e 100644 --- a/src/feature.h +++ b/src/feature.h @@ -60,13 +60,6 @@ * report bugs, too!), but don't _expect_ them to work. */ -/* - * Forcefully disable double-buffering for xft. On some card/driver combination - * enabling it slightly decreases performance, on most it greatly helps it. - * The slowdown is small, so it should normally be enabled. - */ -/* #define FORCE_UNBUFFERED_XFT */ - /* * The cursor blink interval, in seconds. */ diff --git a/src/init.C b/src/init.C index e29824bb..d346d645 100644 --- a/src/init.C +++ b/src/init.C @@ -310,6 +310,7 @@ rxvt_term::init_vars () set_option (Opt_pastableTabs); set_option (Opt_intensityStyles); set_option (Opt_iso14755_52); + set_option (Opt_buffered); } static void diff --git a/src/optinc.h b/src/optinc.h index 207e3bea..3c60b02a 100644 --- a/src/optinc.h +++ b/src/optinc.h @@ -57,4 +57,7 @@ nodef(iso14755_52) #endif def(console, 33) +#if XFT + def(buffered, 34) +#endif diff --git a/src/rsinc.h b/src/rsinc.h index 670cb959..cfa7f1ce 100644 --- a/src/rsinc.h +++ b/src/rsinc.h @@ -65,6 +65,7 @@ #endif #if XFT def (depth) + def (buffered) #endif #if ENABLE_FRILLS def (transient_for) diff --git a/src/rxvtfont.C b/src/rxvtfont.C index 62d52036..7f2caf89 100644 --- a/src/rxvtfont.C +++ b/src/rxvtfont.C @@ -1302,10 +1302,8 @@ rxvt_font_xft::draw (rxvt_drawable &d, int x, int y, * Maybe make buffering into a resource flag? Compile time option doesn't seems like a * good idea from the perspective of packaging for wide variety of user configs. */ - bool buffered = bg >= Color_transparent; -#ifdef FORCE_UNBUFFERED_XFT - buffered = false; -#endif + bool buffered = bg >= Color_transparent + && term->option (Opt_buffered); // cut trailing spaces while (len && text [len - 1] == ' ') diff --git a/src/xdefaults.C b/src/xdefaults.C index 0834024f..5af940d1 100644 --- a/src/xdefaults.C +++ b/src/xdefaults.C @@ -217,6 +217,7 @@ optList[] = { #endif #if XFT STRG (Rs_depth, "depth", "depth", "number", "depth of visual to request"), + BOOL (Rs_buffered, "buffered", NULL, Opt_buffered, 0, NULL), #endif #if ENABLE_FRILLS RSTRG (Rs_transient_for, "transient-for", "windowid"), -- 2.34.1