src/gui/painting/qpaintengine_x11.cpp
changeset 33 3e2da88830cd
parent 30 5dc02b23752f
child 37 758a864f9613
equal deleted inserted replaced
30:5dc02b23752f 33:3e2da88830cd
    77 
    77 
    78 #ifndef QT_NO_XRENDER
    78 #ifndef QT_NO_XRENDER
    79 #include <private/qtessellator_p.h>
    79 #include <private/qtessellator_p.h>
    80 #endif
    80 #endif
    81 
    81 
       
    82 #include <private/qstylehelper_p.h>
       
    83 
    82 QT_BEGIN_NAMESPACE
    84 QT_BEGIN_NAMESPACE
    83 
    85 
    84 extern Drawable qt_x11Handle(const QPaintDevice *pd);
    86 extern Drawable qt_x11Handle(const QPaintDevice *pd);
    85 extern const QX11Info *qt_x11Info(const QPaintDevice *pd);
    87 extern const QX11Info *qt_x11Info(const QPaintDevice *pd);
    86 extern QPixmap qt_pixmapForBrush(int brushStyle, bool invert); //in qbrush.cpp
    88 extern QPixmap qt_pixmapForBrush(int brushStyle, bool invert); //in qbrush.cpp
   222 };
   224 };
   223 
   225 
   224 static QPixmap qt_patternForAlpha(uchar alpha, int screen)
   226 static QPixmap qt_patternForAlpha(uchar alpha, int screen)
   225 {
   227 {
   226     QPixmap pm;
   228     QPixmap pm;
   227     QString key = QLatin1String("$qt-alpha-brush$") + QString::number(alpha) + QString::number(screen);
   229     QString key = QLatin1Literal("$qt-alpha-brush$")
       
   230                   % HexString<uchar>(alpha)
       
   231                   % HexString<int>(screen);
       
   232 
   228     if (!QPixmapCache::find(key, pm)) {
   233     if (!QPixmapCache::find(key, pm)) {
   229         // #### why not use a mono image here????
   234         // #### why not use a mono image here????
   230         QImage pattern(DITHER_SIZE, DITHER_SIZE, QImage::Format_ARGB32);
   235         QImage pattern(DITHER_SIZE, DITHER_SIZE, QImage::Format_ARGB32);
   231         pattern.fill(0xffffffff);
   236         pattern.fill(0xffffffff);
   232         for (int y = 0; y < DITHER_SIZE; ++y) {
   237         for (int y = 0; y < DITHER_SIZE; ++y) {
  1446         QPaintEngine::drawEllipse(rect);
  1451         QPaintEngine::drawEllipse(rect);
  1447 }
  1452 }
  1448 
  1453 
  1449 void QX11PaintEngine::drawEllipse(const QRect &rect)
  1454 void QX11PaintEngine::drawEllipse(const QRect &rect)
  1450 {
  1455 {
       
  1456     if (rect.isEmpty()) {
       
  1457         drawRects(&rect, 1);
       
  1458         return;
       
  1459     }
       
  1460 
  1451     Q_D(QX11PaintEngine);
  1461     Q_D(QX11PaintEngine);
  1452     QRect devclip(SHRT_MIN, SHRT_MIN, SHRT_MAX*2 - 1, SHRT_MAX*2 - 1);
  1462     QRect devclip(SHRT_MIN, SHRT_MIN, SHRT_MAX*2 - 1, SHRT_MAX*2 - 1);
  1453     QRect r(rect);
  1463     QRect r(rect);
  1454     if (d->txop < QTransform::TxRotate) {
  1464     if (d->txop < QTransform::TxRotate) {
  1455         r = d->matrix.mapRect(rect);
  1465         r = d->matrix.mapRect(rect);