[rkward-cvs] SF.net SVN: rkward-code:[4760] trunk/rkward/rkward/rbackend/rkwarddevice

tfry at users.sf.net tfry at users.sf.net
Fri Jul 19 08:15:14 UTC 2013


Revision: 4760
          http://sourceforge.net/p/rkward/code/4760
Author:   tfry
Date:     2013-07-19 08:15:13 +0000 (Fri, 19 Jul 2013)
Log Message:
-----------
Use QImage based rendering on X11, too, as QPixmap seems buggy on some (older?) systems. See http://sourceforge.net/p/rkward/bugs/129/

Modified Paths:
--------------
    trunk/rkward/rkward/rbackend/rkwarddevice/rkgraphicsdevice.cpp
    trunk/rkward/rkward/rbackend/rkwarddevice/rkgraphicsdevice.h
    trunk/rkward/rkward/rbackend/rkwarddevice/rkgraphicsdevice_frontendtransmitter.cpp

Modified: trunk/rkward/rkward/rbackend/rkwarddevice/rkgraphicsdevice.cpp
===================================================================
--- trunk/rkward/rkward/rbackend/rkwarddevice/rkgraphicsdevice.cpp	2013-07-05 14:14:16 UTC (rev 4759)
+++ trunk/rkward/rkward/rbackend/rkwarddevice/rkgraphicsdevice.cpp	2013-07-19 08:15:13 UTC (rev 4760)
@@ -123,8 +123,13 @@
 	RK_TRACE (GRAPHICS_DEVICE);
 
 	if (painter.isActive ()) painter.end ();
+#if QT_VERSION >= 0x040800
 	if (col.isValid ()) area.fill (col);
 	else area.fill (QColor (255, 255, 255, 255));
+#else
+	if (col.isValid ()) area.fill (col.rgb ());
+	else area.fill (qRgb (255, 255, 255));
+#endif
 	updateNow ();
 	setClip (area.rect ());	// R's devX11.c resets clip on clear, so we do this, too.
 }

Modified: trunk/rkward/rkward/rbackend/rkwarddevice/rkgraphicsdevice.h
===================================================================
--- trunk/rkward/rkward/rbackend/rkwarddevice/rkgraphicsdevice.h	2013-07-05 14:14:16 UTC (rev 4759)
+++ trunk/rkward/rkward/rbackend/rkwarddevice/rkgraphicsdevice.h	2013-07-19 08:15:13 UTC (rev 4760)
@@ -24,9 +24,14 @@
 #include <QPainter>
 #include <QLabel>
 
-#ifdef Q_WS_MAC
+#ifndef Q_WS_WIN
 // On Mac, drawing on a pixmap does not work correctly. Probably can only be done inside paint
 // events. (MacOSX 10.6.8, Qt 4.8.4).
+// On X11, similar problems seem to occur on some, but not all systems. Only on old versions?
+// See http://sourceforge.net/p/rkward/bugs/129/ .
+// Version not working with QPixmap: qt 4.7.0~beta2, libx11 1.3.2, xserver-xorg 7.5
+// Version working with QPixmap: qt 4.8.4, libx11 1.5.0, xserver-xorg 7.7
+//
 // Fortunately, a QImage based buffer does not seem to be _that_ much slower
 // (around 5-10% on X11, on plot (rnorm (100000)))
 #	define USE_QIMAGE_BUFFER

Modified: trunk/rkward/rkward/rbackend/rkwarddevice/rkgraphicsdevice_frontendtransmitter.cpp
===================================================================
--- trunk/rkward/rkward/rbackend/rkwarddevice/rkgraphicsdevice_frontendtransmitter.cpp	2013-07-05 14:14:16 UTC (rev 4759)
+++ trunk/rkward/rkward/rbackend/rkwarddevice/rkgraphicsdevice_frontendtransmitter.cpp	2013-07-19 08:15:13 UTC (rev 4760)
@@ -321,7 +321,6 @@
 			streamer.writeOutBuffer ();
 		} else if (opcode == RKDNewPageConfirm) {
 			device->confirmNewPage ();
-#warning TODO keep track of status
 		} else {
 			RK_DEBUG (GRAPHICS_DEVICE, DL_ERROR, "Unhandled operation of type %d for device number %d. Skippping.", opcode, devnum+1);
 		}





More information about the rkward-tracker mailing list