Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
36 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/plugins/gfxdrivers/ahi/qscreenahi_qws.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/plugins/gfxdrivers/ahi/qscreenahi_qws.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/plugins/gfxdrivers/ahi/qscreenahiplugin.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/plugins/gfxdrivers/directfb/directfb.pro

    r561 r846  
    1212QMAKE_CXXFLAGS += $$QT_CFLAGS_DIRECTFB
    1313LIBS += $$QT_LIBS_DIRECTFB
    14 DEFINES += $$QT_DEFINES_DIRECTFB QT_DIRECTFB_PLUGIN
     14DEFINES += $$QT_DEFINES_DIRECTFB
    1515contains(gfx-plugins, directfb):DEFINES += QT_QWS_DIRECTFB
  • trunk/src/plugins/gfxdrivers/directfb/qdirectfbkeyboard.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/plugins/gfxdrivers/directfb/qdirectfbkeyboard.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/plugins/gfxdrivers/directfb/qdirectfbmouse.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    5656#include <private/qimagepixmapcleanuphooks_p.h>
    5757
     58
    5859QT_BEGIN_NAMESPACE
    5960
     
    6768        Matrix_BlitsUnsupported = (Matrix_NegativeScale|Matrix_RectsUnsupported)
    6869    };
     70
     71    inline static uint getTransformationType(const QTransform &transform)
     72    {
     73        int ret = transform.type();
     74        if (qMin(transform.m11(), transform.m22()) < 0) {
     75            ret |= QDirectFBPaintEnginePrivate::Matrix_NegativeScale;
     76        }
     77        return ret;
     78    }
    6979
    7080    enum CompositionModeStatus {
     
    99109    inline bool isSimpleBrush(const QBrush &brush) const;
    100110
    101     void drawTiledPixmap(const QRectF &dest, const QPixmap &pixmap, const QPointF &pos);
     111    void drawTiledPixmap(const QRectF &dest, const QPixmap &pixmap, const QPointF &pos, const QTransform &pixmapTransform);
    102112    void blit(const QRectF &dest, IDirectFBSurface *surface, const QRectF &src);
    103113
     
    113123#endif
    114124
    115     void prepareForBlit(bool alpha);
     125    enum BlitFlag {
     126        HasAlpha = 0x1,
     127        Premultiplied = 0x2
     128    };
     129    void prepareForBlit(uint blitFlags);
    116130
    117131    IDirectFBSurface *surface;
     
    168182#endif
    169183
    170 #if defined QT_DIRECTFB_WARN_ON_RASTERFALLBACKS || defined QT_DIRECTFB_DISABLE_RASTERFALLBACKS || defined QT_DEBUG
    171184#define VOID_ARG() static_cast<bool>(false)
    172185enum PaintOperation {
     
    176189    DRAW_POLYGON = 0x0200, DRAW_TEXT = 0x0400, FILL_PATH = 0x0800,
    177190    FILL_RECT = 0x1000, DRAW_COLORSPANS = 0x2000, DRAW_ROUNDED_RECT = 0x4000,
    178     ALL = 0xffff
     191    DRAW_STATICTEXT = 0x8000, ALL = 0xffff
    179192};
    180193
    181 #ifdef QT_DEBUG
    182 static void initRasterFallbacksMasks(int *warningMask, int *disableMask)
    183 {
    184     struct {
    185         const char *name;
    186         PaintOperation operation;
    187     } const operations[] = {
    188         { "DRAW_RECTS", DRAW_RECTS },
    189         { "DRAW_LINES", DRAW_LINES },
    190         { "DRAW_IMAGE", DRAW_IMAGE },
    191         { "DRAW_PIXMAP", DRAW_PIXMAP },
    192         { "DRAW_TILED_PIXMAP", DRAW_TILED_PIXMAP },
    193         { "STROKE_PATH", STROKE_PATH },
    194         { "DRAW_PATH", DRAW_PATH },
    195         { "DRAW_POINTS", DRAW_POINTS },
    196         { "DRAW_ELLIPSE", DRAW_ELLIPSE },
    197         { "DRAW_POLYGON", DRAW_POLYGON },
    198         { "DRAW_TEXT", DRAW_TEXT },
    199         { "FILL_PATH", FILL_PATH },
    200         { "FILL_RECT", FILL_RECT },
    201         { "DRAW_COLORSPANS", DRAW_COLORSPANS },
    202         { "DRAW_ROUNDED_RECT", DRAW_ROUNDED_RECT },
    203         { "ALL", ALL },
    204         { 0, ALL }
    205     };
    206 
    207     QStringList warning = QString::fromLatin1(qgetenv("QT_DIRECTFB_WARN_ON_RASTERFALLBACKS")).toUpper().split(QLatin1Char('|'),
    208                                                                                                               QString::SkipEmptyParts);
    209     QStringList disable = QString::fromLatin1(qgetenv("QT_DIRECTFB_DISABLE_RASTERFALLBACKS")).toUpper().split(QLatin1Char('|'),
    210                                                                                                               QString::SkipEmptyParts);
    211     *warningMask = 0;
    212     *disableMask = 0;
    213     if (!warning.isEmpty() || !disable.isEmpty()) {
    214         for (int i=0; operations[i].name; ++i) {
    215             const QString name = QString::fromLatin1(operations[i].name);
    216             int idx = warning.indexOf(name);
    217             if (idx != -1) {
    218                 *warningMask |= operations[i].operation;
    219                 warning.erase(warning.begin() + idx);
    220             }
    221             idx = disable.indexOf(name);
    222             if (idx != -1) {
    223                 *disableMask |= operations[i].operation;
    224                 disable.erase(disable.begin() + idx);
     194enum { RasterWarn = 1, RasterDisable = 2 };
     195static inline uint rasterFallbacksMask(PaintOperation op)
     196{
     197    uint ret = 0;
     198#ifdef QT_DIRECTFB_WARN_ON_RASTERFALLBACKS
     199    if (op & QT_DIRECTFB_WARN_ON_RASTERFALLBACKS)
     200        ret |= RasterWarn;
     201#endif
     202#ifdef QT_DIRECTFB_DISABLE_RASTERFALLBACKS
     203    if (op & QT_DIRECTFB_DISABLE_RASTERFALLBACKS)
     204        ret |= RasterDisable;
     205#endif
     206    static int warningMask = -1;
     207    static int disableMask = -1;
     208    if (warningMask < 0) {
     209        struct {
     210            const char *name;
     211            PaintOperation operation;
     212        } const operations[] = {
     213            { "DRAW_RECTS", DRAW_RECTS },
     214            { "DRAW_LINES", DRAW_LINES },
     215            { "DRAW_IMAGE", DRAW_IMAGE },
     216            { "DRAW_PIXMAP", DRAW_PIXMAP },
     217            { "DRAW_TILED_PIXMAP", DRAW_TILED_PIXMAP },
     218            { "STROKE_PATH", STROKE_PATH },
     219            { "DRAW_PATH", DRAW_PATH },
     220            { "DRAW_POINTS", DRAW_POINTS },
     221            { "DRAW_ELLIPSE", DRAW_ELLIPSE },
     222            { "DRAW_POLYGON", DRAW_POLYGON },
     223            { "DRAW_TEXT", DRAW_TEXT },
     224            { "FILL_PATH", FILL_PATH },
     225            { "FILL_RECT", FILL_RECT },
     226            { "DRAW_COLORSPANS", DRAW_COLORSPANS },
     227            { "DRAW_ROUNDED_RECT", DRAW_ROUNDED_RECT },
     228            { "ALL", ALL },
     229            { 0, ALL }
     230        };
     231
     232        QStringList warning = QString::fromLatin1(qgetenv("QT_DIRECTFB_WARN_ON_RASTERFALLBACKS")).toUpper().split(QLatin1Char('|'),
     233                                                                                                                  QString::SkipEmptyParts);
     234        QStringList disable = QString::fromLatin1(qgetenv("QT_DIRECTFB_DISABLE_RASTERFALLBACKS")).toUpper().split(QLatin1Char('|'),
     235                                                                                                                  QString::SkipEmptyParts);
     236        warningMask = 0;
     237        disableMask = 0;
     238        if (!warning.isEmpty() || !disable.isEmpty()) {
     239            for (int i=0; operations[i].name; ++i) {
     240                const QString name = QString::fromLatin1(operations[i].name);
     241                int idx = warning.indexOf(name);
     242                if (idx != -1) {
     243                    warningMask |= operations[i].operation;
     244                    warning.erase(warning.begin() + idx);
     245                }
     246                idx = disable.indexOf(name);
     247                if (idx != -1) {
     248                    disableMask |= operations[i].operation;
     249                    disable.erase(disable.begin() + idx);
     250                }
    225251            }
    226252        }
    227     }
    228     if (!warning.isEmpty()) {
    229         qWarning("QDirectFBPaintEngine QT_DIRECTFB_WARN_ON_RASTERFALLBACKS Unknown operation(s): %s",
    230                  qPrintable(warning.join(QLatin1String("|"))));
    231     }
    232     if (!disable.isEmpty()) {
    233         qWarning("QDirectFBPaintEngine QT_DIRECTFB_DISABLE_RASTERFALLBACKS Unknown operation(s): %s",
    234                  qPrintable(disable.join(QLatin1String("|"))));
    235     }
    236 
    237 }
    238 #endif
    239 
    240 static inline int rasterFallbacksMask(bool warn)
    241 {
    242 #ifdef QT_DIRECTFB_WARN_ON_RASTERFALLBACKS
    243     if (warn)
    244         return QT_DIRECTFB_WARN_ON_RASTERFALLBACKS;
    245 #endif
    246 #ifdef QT_DIRECTFB_DISABLE_RASTERFALLBACKS
    247     if (!warn)
    248         return QT_DIRECTFB_DISABLE_RASTERFALLBACKS;
    249 #endif
    250 #ifndef QT_DEBUG
    251     return 0;
    252 #else
    253     static int warnMask = -1;
    254     static int disableMask = -1;
    255     if (warnMask == -1)
    256         initRasterFallbacksMasks(&warnMask, &disableMask);
    257     return warn ? warnMask : disableMask;
    258 #endif
    259 }
    260 #endif
    261 
    262 #if defined QT_DIRECTFB_WARN_ON_RASTERFALLBACKS || defined QT_DEBUG
     253        if (!warning.isEmpty()) {
     254            qWarning("QDirectFBPaintEngine QT_DIRECTFB_WARN_ON_RASTERFALLBACKS Unknown operation(s): %s",
     255                     qPrintable(warning.join(QLatin1String("|"))));
     256        }
     257        if (!disable.isEmpty()) {
     258            qWarning("QDirectFBPaintEngine QT_DIRECTFB_DISABLE_RASTERFALLBACKS Unknown operation(s): %s",
     259                     qPrintable(disable.join(QLatin1String("|"))));
     260        }
     261    }
     262    if (op & warningMask)
     263        ret |= RasterWarn;
     264    if (op & disableMask)
     265        ret |= RasterDisable;
     266    return ret;
     267}
     268
    263269template <typename device, typename T1, typename T2, typename T3>
    264270static void rasterFallbackWarn(const char *msg, const char *func, const device *dev,
     
    268274                               const char *nameTwo, const T2 &two,
    269275                               const char *nameThree, const T3 &three);
    270 #endif
    271 
    272 #if defined QT_DEBUG || (defined QT_DIRECTFB_WARN_ON_RASTERFALLBACKS && defined QT_DIRECTFB_DISABLE_RASTERFALLBACKS)
     276
    273277#define RASTERFALLBACK(op, one, two, three)                             \
    274278    {                                                                   \
    275         const bool disable = op & rasterFallbacksMask(false);           \
    276         if (op & rasterFallbacksMask(true))                             \
    277             rasterFallbackWarn(disable                                  \
    278                                ? "Disabled raster engine operation"     \
    279                                : "Falling back to raster engine for",   \
     279        static const uint rasterFallbacks = rasterFallbacksMask(op);    \
     280        switch (rasterFallbacks) {                                      \
     281        case 0: break;                                                  \
     282        case RasterWarn:                                                \
     283            rasterFallbackWarn("Falling back to raster engine for",     \
    280284                               __FUNCTION__,                            \
    281285                               state()->painter->device(),              \
     
    285289                               d_func()->compositionModeStatus,         \
    286290                               #one, one, #two, two, #three, three);    \
    287         if (disable)                                                    \
     291            break;                                                      \
     292        case RasterDisable|RasterWarn:                                  \
     293            rasterFallbackWarn("Disabled raster engine operation",      \
     294                               __FUNCTION__,                            \
     295                               state()->painter->device(),              \
     296                               d_func()->transformationType,            \
     297                               d_func()->simplePen,                     \
     298                               d_func()->clipType,                      \
     299                               d_func()->compositionModeStatus,         \
     300                               #one, one, #two, two, #three, three);    \
     301        case RasterDisable:                                             \
    288302            return;                                                     \
    289     }
    290 #elif defined QT_DIRECTFB_DISABLE_RASTERFALLBACKS
    291 #define RASTERFALLBACK(op, one, two, three)                             \
    292     if (op & rasterFallbacksMask(false))                                \
    293         return;
    294 #elif defined QT_DIRECTFB_WARN_ON_RASTERFALLBACKS
    295 #define RASTERFALLBACK(op, one, two, three)                             \
    296     if (op & rasterFallbacksMask(true))                                 \
    297         rasterFallbackWarn("Falling back to raster engine for",         \
    298                            __FUNCTION__, state()->painter->device(),    \
    299                            d_func()->transformationType,                \
    300                            d_func()->simplePen,                         \
    301                            d_func()->clipType,                          \
    302                            d_func()->compositionModeStatus,             \
    303                            #one, one, #two, two, #three, three);
    304 #else
    305 #define RASTERFALLBACK(op, one, two, three)
    306 #endif
     303        }                                                               \
     304    }
    307305
    308306template <class T>
     
    633631    bool release;
    634632    IDirectFBSurface *imgSurface = d->getSurface(image, &release);
    635     d->prepareForBlit(QDirectFBScreen::hasAlphaChannel(imgSurface));
     633    uint blitFlags = 0;
     634    if (image.hasAlphaChannel())
     635        blitFlags |= QDirectFBPaintEnginePrivate::HasAlpha;
     636    if (QDirectFBScreen::isPremultiplied(image.format()))
     637        blitFlags |= QDirectFBPaintEnginePrivate::Premultiplied;
     638    d->prepareForBlit(blitFlags);
    636639    CLIPPED_PAINT(d->blit(r, imgSurface, sr));
    637640    if (release) {
     
    672675        } else {
    673676            QDirectFBPaintEnginePrivate::unlock(dfbData);
    674             d->prepareForBlit(pixmap.hasAlphaChannel());
    675677            IDirectFBSurface *s = dfbData->directFBSurface();
     678            uint blitFlags = 0;
     679            if (pixmap.hasAlphaChannel())
     680                blitFlags |= QDirectFBPaintEnginePrivate::HasAlpha;
     681            if (QDirectFBScreen::isPremultiplied(dfbData->pixelFormat()))
     682                blitFlags |= QDirectFBPaintEnginePrivate::Premultiplied;
     683
     684            d->prepareForBlit(blitFlags);
    676685            CLIPPED_PAINT(d->blit(r, s, sr));
    677686        }
     
    708717        QRasterPaintEngine::drawTiledPixmap(r, pix, offset);
    709718    } else {
    710         CLIPPED_PAINT(d->drawTiledPixmap(r, pixmap, offset));
     719        QTransform transform(state()->matrix);
     720        CLIPPED_PAINT(d->drawTiledPixmap(r, pixmap, offset, transform));
    711721    }
    712722}
     
    796806    d->lock();
    797807    QRasterPaintEngine::drawRoundedRect(rect, xrad, yrad, mode);
     808}
     809
     810void QDirectFBPaintEngine::drawStaticTextItem(QStaticTextItem *item)
     811{
     812    RASTERFALLBACK(DRAW_STATICTEXT, item, VOID_ARG(), VOID_ARG());
     813    Q_D(QDirectFBPaintEngine);
     814    d->lock();
     815    QRasterPaintEngine::drawStaticTextItem(item);
    798816}
    799817
     
    820838
    821839        case Qt::TexturePattern: {
     840            const QPointF &brushOrigin = state()->brushOrigin;
     841            const QTransform stateTransform = state()->matrix;
     842            QTransform transform(stateTransform);
     843            transform.translate(brushOrigin.x(), brushOrigin.y());
     844            transform = brush.transform() * transform;
    822845            if (!(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_Supported)
    823                 || (d->transformationType & QDirectFBPaintEnginePrivate::Matrix_BlitsUnsupported)
    824                 || (!d->supportsStretchBlit() && state()->matrix.isScaling())) {
     846                || (QDirectFBPaintEnginePrivate::getTransformationType(transform) & QDirectFBPaintEnginePrivate::Matrix_BlitsUnsupported)
     847                || (!d->supportsStretchBlit() && transform.isScaling())) {
    825848                break;
    826849            }
     
    830853                break;
    831854
    832             CLIPPED_PAINT(d->drawTiledPixmap(rect, texture, rect.topLeft() - state()->brushOrigin));
     855            CLIPPED_PAINT(d->drawTiledPixmap(stateTransform.mapRect(rect), texture, rect.topLeft() - brushOrigin, transform));
    833856            return; }
    834857        default:
     
    941964void QDirectFBPaintEnginePrivate::setTransform(const QTransform &transform)
    942965{
    943     transformationType = transform.type();
    944     if (qMin(transform.m11(), transform.m22()) < 0) {
    945         transformationType |= QDirectFBPaintEnginePrivate::Matrix_NegativeScale;
    946     }
     966    transformationType = getTransformationType(transform);
    947967    setPen(q->state()->pen);
    948968}
     
    10401060}
    10411061
    1042 void QDirectFBPaintEnginePrivate::prepareForBlit(bool alpha)
    1043 {
    1044     DFBSurfaceBlittingFlags blittingFlags = alpha ? DSBLIT_BLEND_ALPHACHANNEL : DSBLIT_NOFX;
     1062void QDirectFBPaintEnginePrivate::prepareForBlit(uint flags)
     1063{
     1064    DFBSurfaceBlittingFlags blittingFlags = DSBLIT_NOFX;
     1065    if (flags & Premultiplied)
     1066        blittingFlags |= DSBLIT_SRC_PREMULTIPLY;
     1067    if (flags & HasAlpha)
     1068        blittingFlags |= DSBLIT_BLEND_ALPHACHANNEL;
    10451069    if (opacity != 255) {
    10461070        blittingFlags |= DSBLIT_BLEND_COLORALPHA;
    1047     }
    1048     surface->SetColor(surface, 0xff, 0xff, 0xff, opacity);
     1071        surface->SetColor(surface, 0xff, 0xff, 0xff, opacity);
     1072    }
     1073
    10491074    surface->SetBlittingFlags(surface, blittingFlags);
    10501075}
     
    11411166}
    11421167
    1143 void QDirectFBPaintEnginePrivate::drawTiledPixmap(const QRectF &dest, const QPixmap &pixmap, const QPointF &off)
    1144 {
    1145     Q_ASSERT(!(transformationType & Matrix_BlitsUnsupported));
     1168void QDirectFBPaintEnginePrivate::drawTiledPixmap(const QRectF &dest, const QPixmap &pixmap,
     1169                                                  const QPointF &off, const QTransform &pixmapTransform)
     1170{
    11461171    const QTransform &transform = q->state()->matrix;
     1172    Q_ASSERT(!(getTransformationType(transform) & Matrix_BlitsUnsupported) &&
     1173             !(getTransformationType(pixmapTransform) & Matrix_BlitsUnsupported));
    11471174    const QRect destinationRect = transform.mapRect(dest).toRect().normalized();
    11481175    QRect newClip = destinationRect;
     
    11611188    surface->SetClip(surface, &clip);
    11621189
    1163     QPointF offset = off;
     1190    QPointF offset = pixmapTransform.inverted().map(off);
    11641191    Q_ASSERT(transform.type() <= QTransform::TxScale);
    1165     prepareForBlit(pixmap.hasAlphaChannel());
    11661192    QPixmapData *data = pixmap.pixmapData();
    11671193    Q_ASSERT(data->classId() == QPixmapData::DirectFBClass);
    11681194    QDirectFBPixmapData *dfbData = static_cast<QDirectFBPixmapData*>(data);
     1195    IDirectFBSurface *sourceSurface = dfbData->directFBSurface();
     1196    uint blitFlags = 0;
     1197    if (dfbData->hasAlphaChannel())
     1198        blitFlags |= HasAlpha;
     1199    if (QDirectFBScreen::isPremultiplied(dfbData->pixelFormat()))
     1200        blitFlags |= Premultiplied;
     1201    prepareForBlit(blitFlags);
    11691202    QDirectFBPaintEnginePrivate::unlock(dfbData);
    11701203    const QSize pixmapSize = dfbData->size();
    1171     IDirectFBSurface *sourceSurface = dfbData->directFBSurface();
    1172     if (transform.isScaling()) {
     1204    if (transform.isScaling() || pixmapTransform.isScaling()) {
    11731205        Q_ASSERT(supportsStretchBlit());
    11741206        Q_ASSERT(qMin(transform.m11(), transform.m22()) >= 0);
     
    11761208        offset.ry() *= transform.m22();
    11771209
    1178         const QSizeF mappedSize(pixmapSize.width() * transform.m11(), pixmapSize.height() * transform.m22());
     1210        const QSizeF mappedSize(pixmapSize.width() * pixmapTransform.m11(), pixmapSize.height() * pixmapTransform.m22());
    11791211        qreal y = fixCoord(destinationRect.y(), mappedSize.height(), offset.y());
    11801212        const qreal startX = fixCoord(destinationRect.x(), mappedSize.width(), offset.x());
     
    13551387}
    13561388
    1357 #if defined QT_DIRECTFB_WARN_ON_RASTERFALLBACKS || defined QT_DEBUG
    13581389template <typename T> inline const T *ptr(const T &t) { return &t; }
    13591390template <> inline const bool* ptr<bool>(const bool &) { return 0; }
     
    13961427}
    13971428
    1398 #endif // QT_DIRECTFB_WARN_ON_RASTERFALLBACKS
    1399 
    14001429QT_END_NAMESPACE
    14011430
  • trunk/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    110110    virtual void clip(const QRect &rect, Qt::ClipOperation op);
    111111
     112    virtual void drawStaticTextItem(QStaticTextItem *item);
     113
    112114    static void initImageCache(int size);
    113115};
  • trunk/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    9292}
    9393
     94#ifdef QT_DIRECTFB_OPAQUE_DETECTION
    9495// mostly duplicated from qimage.cpp (QImageData::checkForAlphaPixels)
    9596static bool checkForAlphaPixels(const QImage &img)
     
    161162    return false;
    162163}
    163 
    164 bool QDirectFBPixmapData::hasAlphaChannel(const QImage &img)
    165 {
    166 #ifndef QT_NO_DIRECTFB_OPAQUE_DETECTION
    167     return checkForAlphaPixels(img);
     164#endif // QT_DIRECTFB_OPAQUE_DETECTION
     165
     166bool QDirectFBPixmapData::hasAlphaChannel(const QImage &img, Qt::ImageConversionFlags flags)
     167{
     168    if (img.depth() == 1)
     169        return true;
     170#ifdef QT_DIRECTFB_OPAQUE_DETECTION
     171    return ((flags & Qt::NoOpaqueDetection) ? img.hasAlphaChannel() : checkForAlphaPixels(img));
    168172#else
     173    Q_UNUSED(flags);
    169174    return img.hasAlphaChannel();
    170175#endif
     
    247252    QDirectFBPointer<IDirectFBImageProvider> provider(providerPtr);
    248253
    249     DFBSurfaceDescription surfaceDescription;
    250     if ((result = provider->GetSurfaceDescription(provider.data(), &surfaceDescription)) != DFB_OK) {
    251         DirectFBError("QDirectFBPixmapData::fromDataBufferDescription(): Can't get surface description", result);
    252         return false;
    253     }
    254 
    255254    DFBImageDescription imageDescription;
    256255    result = provider->GetImageDescription(provider.data(), &imageDescription);
     
    260259    }
    261260
    262     alpha = imageDescription.caps & (DICAPS_ALPHACHANNEL|DICAPS_COLORKEY);
     261    if (imageDescription.caps & DICAPS_COLORKEY) {
     262        return false;
     263    }
     264
     265    DFBSurfaceDescription surfaceDescription;
     266    if ((result = provider->GetSurfaceDescription(provider.data(), &surfaceDescription)) != DFB_OK) {
     267        DirectFBError("QDirectFBPixmapData::fromDataBufferDescription(): Can't get surface description", result);
     268        return false;
     269    }
     270
     271    alpha = imageDescription.caps & DICAPS_ALPHACHANNEL;
    263272    imageFormat = alpha ? screen->alphaPixmapFormat() : screen->pixelFormat();
    264273
     
    288297#endif
    289298
    290 void QDirectFBPixmapData::fromImage(const QImage &img,
    291                                     Qt::ImageConversionFlags flags)
    292 {
    293     if (img.depth() == 1) {
    294         alpha = true;
    295 #ifndef QT_NO_DIRECTFB_OPAQUE_DETECTION
    296     } else if (flags & Qt::NoOpaqueDetection || QDirectFBPixmapData::hasAlphaChannel(img)) {
    297         alpha = true;
    298 #else
    299     } else if (img.hasAlphaChannel()) {
    300         alpha = true;
    301 #endif
    302     }
     299void QDirectFBPixmapData::fromImage(const QImage &img, Qt::ImageConversionFlags flags)
     300{
     301    alpha = QDirectFBPixmapData::hasAlphaChannel(img, flags);
    303302    imageFormat = alpha ? screen->alphaPixmapFormat() : screen->pixelFormat();
    304303    QImage image;
     
    591590}
    592591
    593 #ifndef QT_DIRECTFB_PLUGIN
    594592Q_GUI_EXPORT IDirectFBSurface *qt_directfb_surface_for_pixmap(const QPixmap &pixmap)
    595593{
     
    600598    return dfbData->directFBSurface();
    601599}
    602 #endif
    603600
    604601QT_END_NAMESPACE
  • trunk/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    8787
    8888    inline QImage::Format pixelFormat() const { return imageFormat; }
    89     static bool hasAlphaChannel(const QImage &img);
    9089    inline bool hasAlphaChannel() const { return alpha; }
     90    static bool hasAlphaChannel(const QImage &img, Qt::ImageConversionFlags flags = Qt::AutoColor);
    9191private:
    9292#ifdef QT_DIRECTFB_IMAGEPROVIDER
  • trunk/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    15551555        }
    15561556    }
    1557     if (!region.isEmpty()) {
    1558         solidFill(d_ptr->backgroundColor, region);
    1559     }
     1557
     1558    solidFill(d_ptr->backgroundColor, region);
    15601559
    15611560    while (idx > 0) {
     
    16301629    Q_UNUSED(region);
    16311630#else
     1631    QDirectFBScreen::solidFill(d_ptr->primarySurface, color, region);
     1632#endif
     1633}
     1634
     1635static inline void clearRect(IDirectFBSurface *surface, const QColor &color, const QRect &rect)
     1636{
     1637    Q_ASSERT(surface);
     1638    const DFBRegion region = { rect.left(), rect.top(), rect.right(), rect.bottom() };
     1639    // could just reinterpret_cast this to a DFBRegion
     1640    surface->SetClip(surface, &region);
     1641    surface->Clear(surface, color.red(), color.green(), color.blue(), color.alpha());
     1642}
     1643
     1644void QDirectFBScreen::solidFill(IDirectFBSurface *surface, const QColor &color, const QRegion &region)
     1645{
    16321646    if (region.isEmpty())
    16331647        return;
    16341648
    1635     d_ptr->primarySurface->SetColor(d_ptr->primarySurface,
    1636                                     color.red(), color.green(), color.blue(),
    1637                                     color.alpha());
    16381649    const int n = region.rectCount();
    16391650    if (n == 1) {
    1640         const QRect r = region.boundingRect();
    1641         d_ptr->primarySurface->FillRectangle(d_ptr->primarySurface, r.x(), r.y(), r.width(), r.height());
     1651        clearRect(surface, color, region.boundingRect());
    16421652    } else {
    16431653        const QVector<QRect> rects = region.rects();
    1644         QVarLengthArray<DFBRectangle, 32> rectArray(n);
    16451654        for (int i=0; i<n; ++i) {
    1646             const QRect &r = rects.at(i);
    1647             rectArray[i].x = r.x();
    1648             rectArray[i].y = r.y();
    1649             rectArray[i].w = r.width();
    1650             rectArray[i].h = r.height();
    1651         }
    1652         d_ptr->primarySurface->FillRectangles(d_ptr->primarySurface, rectArray.constData(), n);
    1653     }
    1654 #endif
     1655            clearRect(surface, color, rects.at(i));
     1656        }
     1657    }
     1658    surface->SetClip(surface, 0);
    16551659}
    16561660
     
    17911795#endif
    17921796
    1793 #ifndef QT_DIRECTFB_PLUGIN
    17941797Q_GUI_EXPORT IDirectFBSurface *qt_directfb_surface_for_widget(const QWidget *widget, QRect *rect)
    17951798{
     
    18091812
    18101813#endif
    1811 #endif
    18121814
    18131815QT_END_NAMESPACE
  • trunk/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    160160    void exposeRegion(QRegion r, int changing);
    161161    void solidFill(const QColor &color, const QRegion &region);
     162    static void solidFill(IDirectFBSurface *surface, const QColor &color, const QRegion &region);   
    162163
    163164    void setMode(int width, int height, int depth);
  • trunk/src/plugins/gfxdrivers/directfb/qdirectfbscreenplugin.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    345345        return;
    346346
     347#ifndef QT_NO_QWS_PROXYSCREEN
    347348    QWExtra *extra = qt_widget_private(widget)->extraData();
    348349    if (extra && extra->proxyWidget)
    349350        return;
     351#endif
    350352
    351353    const quint8 windowOpacity = quint8(win->windowOpacity() * 0xff);
     
    381383}
    382384
    383 void QDirectFBWindowSurface::beginPaint(const QRegion &)
     385void QDirectFBWindowSurface::beginPaint(const QRegion &region)
    384386{
    385387    if (!engine) {
    386388        engine = new QDirectFBPaintEngine(this);
     389    }
     390
     391    if (dfbSurface) {
     392        const QWidget *win = window();
     393        if (win && win->testAttribute(Qt::WA_NoSystemBackground)) {
     394            QDirectFBScreen::solidFill(dfbSurface, Qt::transparent, region);
     395        }
    387396    }
    388397    flushPending = true;
  • trunk/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/plugins/gfxdrivers/linuxfb/main.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.c

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    9696    height = var.yres;
    9797    bytesPerPixel = var.bits_per_pixel / 8;
    98     stride = var.xres * bytesPerPixel;
     98    stride = fix.line_length;
    9999    format = PVR2D_1BPP;
    100100    if (var.bits_per_pixel == 16) {
  • trunk/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable_p.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.cpp

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreenplugin.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/plugins/gfxdrivers/qvfb/main.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/plugins/gfxdrivers/transformed/main.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/plugins/gfxdrivers/vnc/main.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/plugins/gfxdrivers/vnc/qscreenvnc_p.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    10541054    QRfbClientCutText ev;
    10551055
    1056     if (ev.read(client)) {
     1056    if (cutTextPending == 0 && ev.read(client)) {
    10571057        cutTextPending = ev.length;
    10581058        if (!cutTextPending)
     
    14821482            if (count & 0x1) {
    14831483                const quint16 *src16 = reinterpret_cast<const quint16*>(src);
    1484                 dst32[count - 1] = qt_conv16ToRgb(src16[count - 1]);
     1484                *dst32 = qt_conv16ToRgb(src16[count - 1]);
    14851485            }
    14861486            return;
     
    20392039    qvnc_cursor = 0;
    20402040#endif
    2041     if (!qvnc_screen->screen() && !qvnc_screen->d_ptr->noDisablePainting)
     2041    if (!qvnc_screen->screen() && !qvnc_screen->d_ptr->noDisablePainting && QWSServer::instance())
    20422042        QWSServer::instance()->enablePainting(false);
    20432043}
  • trunk/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
Note: See TracChangeset for help on using the changeset viewer.