This simple patch saves 4 seconds in the PageDown test.
Committed in the "younes" branch.
Abdel.
Index: QLPainter.C
===================================================================
--- QLPainter.C (revision 14026)
+++ QLPainter.C (working copy)
@@ -60,6 +60,13 @@
QPainter & QLPainter::setQPainterPen(QPainter & qp, LColor_color c,
Painter::line_style ls, Painter::line_width lw)
{
+ if (c == current_color_ && ls == current_ls_ && lw == current_lw_)
+ return qp;
+
+ current_color_ = c;
+ current_ls_ = ls;
+ current_lw_ = lw;
+
QPen pen = qp.pen();
pen.setColor(lcolorcache.get(c));
@@ -241,7 +248,7 @@
// We need to draw the text as LTR as we use our own bidi
// code.
qp.setLayoutDirection(Qt::LeftToRight);
- qp.drawText(x, y, str, -1);
+ qp.drawText(x, y, str);
} else {
smallCapsText(x, y, str, f);
}
Index: QLPainter.h
===================================================================
--- QLPainter.h (revision 14026)
+++ QLPainter.h (working copy)
@@ -151,6 +151,10 @@
/// the working area
WorkArea * qwa_;
+
+ LColor::color current_color_;
+ Painter::line_style current_ls_;
+ Painter::line_width current_lw_;
};
} // namespace frontend