OSDN Git Service

QX11PaintEngine cleanup
authorIvailo Monev <xakepa10@laimg.moc>
Sun, 26 May 2019 15:05:29 +0000 (15:05 +0000)
committerIvailo Monev <xakepa10@laimg.moc>
Sun, 26 May 2019 15:05:29 +0000 (15:05 +0000)
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
src/gui/painting/qpaintengine_x11.cpp
src/gui/painting/qpaintengine_x11_p.h

index bdc15eb..b701b11 100644 (file)
@@ -477,7 +477,6 @@ bool QX11PaintEngine::begin(QPaintDevice *pdev)
     d->has_clipping = false;
     d->has_complex_xform = false;
     d->has_scaling_xform = false;
-    d->has_non_scaling_xform = true;
     d->xform_scale = 1;
     d->has_custom_pen = false;
     d->matrix = QTransform();
@@ -645,7 +644,7 @@ void QX11PaintEngine::drawLines(const QLine *lines, int lineCount)
         || d->has_alpha_pen
         || d->has_custom_pen
         || (d->cpen.widthF() > 0 && d->has_complex_xform
-            && !d->has_non_scaling_xform)
+            && d->has_scaling_xform)
         || (d->render_hints & QPainter::Antialiasing)) {
         for (int i = 0; i < lineCount; ++i) {
             QPainterPath path(lines[i].p1());
@@ -684,7 +683,7 @@ void QX11PaintEngine::drawLines(const QLineF *lines, int lineCount)
         || d->has_alpha_pen
         || d->has_custom_pen
         || (d->cpen.widthF() > 0 && d->has_complex_xform
-            && !d->has_non_scaling_xform)
+            && d->has_scaling_xform)
         || (d->render_hints & QPainter::Antialiasing)) {
         for (int i = 0; i < lineCount; ++i) {
             QPainterPath path(lines[i].p1());
@@ -1444,7 +1443,7 @@ void QX11PaintEngine::drawEllipse(const QRect &rect)
     if (d->has_alpha_brush || d->has_alpha_pen || d->has_custom_pen || (d->render_hints & QPainter::Antialiasing)
         || d->has_alpha_texture || devclip.intersected(r) != r
         || (d->has_complex_xform
-            && !(d->has_non_scaling_xform && rect.width() == rect.height())))
+            && !(!d->has_scaling_xform && rect.width() == rect.height())))
     {
         QPainterPath path;
         path.addEllipse(rect);
@@ -1749,7 +1748,7 @@ void QX11PaintEngine::drawPath(const QPainterPath &path)
     if (d->has_pen
         && ((qt_x11Data->use_xrender && (d->has_alpha_pen || (d->render_hints & QPainter::Antialiasing)))
             || (!d->cpen.isCosmetic() && d->txop > QTransform::TxTranslate
-                && !d->has_non_scaling_xform)
+                && d->has_scaling_xform)
             || (d->cpen.style() == Qt::CustomDashLine))) {
         QPainterPathStroker stroker;
         if (d->cpen.style() == Qt::CustomDashLine) {
@@ -2018,7 +2017,6 @@ void QX11PaintEngine::updateMatrix(const QTransform &mtx)
     extern bool qt_scaleForTransform(const QTransform &transform, qreal *scale);
     bool scaling = qt_scaleForTransform(d->matrix, &d->xform_scale);
     d->has_scaling_xform = scaling && d->xform_scale != 1.0;
-    d->has_non_scaling_xform = scaling && d->xform_scale == 1.0;
 }
 
 /*
index 777ab8e..e7eda62 100644 (file)
@@ -208,23 +208,22 @@ public:
     QTransform matrix;
     qreal opacity;
 
-    uint has_complex_xform : 1;
-    uint has_scaling_xform : 1;
-    uint has_non_scaling_xform : 1;
-    uint has_custom_pen : 1;
-    uint use_path_fallback : 1;
-    uint adjust_coords : 1;
-    uint has_clipping : 1;
-    uint adapted_brush_origin : 1;
-    uint adapted_pen_origin : 1;
-    uint has_pen : 1;
-    uint has_brush : 1;
-    uint has_texture : 1;
-    uint has_alpha_texture : 1;
-    uint has_pattern : 1;
-    uint has_alpha_pen : 1;
-    uint has_alpha_brush : 1;
-    uint render_hints;
+    bool has_complex_xform;
+    bool has_scaling_xform;
+    bool has_custom_pen;
+    bool use_path_fallback;
+    bool adjust_coords;
+    bool has_clipping;
+    bool adapted_brush_origin;
+    bool adapted_pen_origin;
+    bool has_pen;
+    bool has_brush;
+    bool has_texture;
+    bool has_alpha_texture;
+    bool has_pattern;
+    bool has_alpha_pen;
+    bool has_alpha_brush;
+    QPainter::RenderHints render_hints;
 
     const QX11Info *xinfo;
     QPointF bg_origin;