Am 23.10.2011 um 09:21 schrieb Abdelrazak Younes: > On 23/10/2011 08:52, you...@lyx.org wrote: >> Author: younes >> Date: Sun Oct 23 08:52:03 2011 >> New Revision: 39932 >> URL: http://www.lyx.org/trac/changeset/39932 >> >> Log: >> Introduce new USE_QIMAGE macro to optionally use a QImage drawing backend >> instead of a QPixmap. This may help when running locally under X11 with some >> graphics cards (there were some complain about that in the user list). > > If this proves to really fix the slowness on some X11 with nvidia cards, we > might want to introduce an option. Is there anybody suffering this issue?
Not me. But isn't it possible to make the QImage versus QPixmap a dependency on local or remote X11 screen? I didn't check if this info is available at runtime... perhaps you know that. Stephan >> Modified: lyx-devel/trunk/src/frontends/qt4/GuiWorkArea_Private.h >> ============================================================================== >> --- lyx-devel/trunk/src/frontends/qt4/GuiWorkArea_Private.h Sun Oct 23 >> 05:32:37 2011 (r39931) >> +++ lyx-devel/trunk/src/frontends/qt4/GuiWorkArea_Private.h Sun Oct 23 >> 08:52:03 2011 (r39932) >> @@ -12,6 +12,11 @@ >> #ifndef WORKAREA_PRIVATE_H >> #define WORKAREA_PRIVATE_H >> >> +// Comment out to use QImage backend instead of QPixmap. This won't have any >> +// effect on Windows, MacOSX and most X11 environment when running locally. >> +// When running remotely on X11, this may have a big performance penalty. >> +//#define USE_QIMAGE >> + >> #include "FuncRequest.h" >> #include "qt_helpers.h" >> >> @@ -20,7 +25,11 @@ >> >> #include<QAbstractScrollArea> >> #include<QMouseEvent> >> +#ifdef USE_QIMAGE >> +#include<QImage> >> +#else >> #include<QPixmap> >> +#endif >> #include<QTimer> >> >> class QContextMenuEvent; >> @@ -117,6 +126,23 @@ >> void updateCursorShape(); >> /// >> void setCursorShape(Qt::CursorShape shape); >> + >> +#ifdef USE_QIMAGE >> + void resetScreen() >> + { >> + screen_ = QImage(p->viewport()->width(), >> p->viewport()->height(), >> + QImage::Format_ARGB32_Premultiplied); >> + } >> + >> + QImage screen_; >> +#else >> + void resetScreen() >> + { >> + screen_ = QPixmap(p->viewport()->width(), >> p->viewport()->height()); >> + } >> + >> + QPixmap screen_; >> +#endif >> /// >> GuiWorkArea * p; >> >> @@ -139,8 +165,6 @@ >> /// >> CursorWidget * cursor_; >> /// >> - QPixmap screen_; >> - /// >> bool need_resize_; >> /// >> bool schedule_redraw_; >