Change the compile-time option to disable xft double-buffering to a
authorayin <ayin>
Sat, 26 Jan 2008 14:24:42 +0000 (14:24 +0000)
committerayin <ayin>
Sat, 26 Jan 2008 14:24:42 +0000 (14:24 +0000)
runtime one.

doc/rxvt.1.pod
src/feature.h
src/init.C
src/optinc.h
src/rsinc.h
src/rxvtfont.C
src/xdefaults.C

index 2380709..5c7ac7a 100644 (file)
@@ -574,6 +574,13 @@ extensions not documented here):
 Compile I<xft>: Attempt to find a visual with the given bit depth;
 option B<-depth>.
 
+=item B<buffered:> I<boolean>
+
+Compile I<xft>: 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<geometry:> I<geom>
 
 Create the window with the specified X window geometry [default 80x24];
index fb2c9d0..46b0b73 100644 (file)
  */
 
 /*
- * 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.
  */
 #define CURSOR_BLINK_INTERVAL 0.5
index e29824b..d346d64 100644 (file)
@@ -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
index 207e3be..3c60b02 100644 (file)
@@ -57,4 +57,7 @@
  nodef(iso14755_52)
 #endif
  def(console,              33)
+#if XFT
+ def(buffered,             34)
+#endif
 
index 670cb95..cfa7f1c 100644 (file)
@@ -65,6 +65,7 @@
 #endif
 #if XFT
   def (depth)
+  def (buffered)
 #endif
 #if ENABLE_FRILLS
   def (transient_for)
index 62d5203..7f2caf8 100644 (file)
@@ -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] == ' ')
index 0834024..5af940d 100644 (file)
@@ -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"),