Ignore:
Timestamp:
Aug 2, 2010, 9:27:30 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

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

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/painting/qwindowsurface_s60.cpp

    r651 r769  
    7171    CFbsBitmap *bitmap = q_check_ptr(new CFbsBitmap);   // CBase derived object needs check on new
    7272    qt_symbian_throwIfError( bitmap->Create( TSize(0, 0), mode ) );
    73        
     73
    7474    QS60PixmapData *data = new QS60PixmapData(QPixmapData::PixmapType);
    7575    if (data) {
     
    7777        d_ptr->device = QPixmap(data);
    7878    }
    79        
     79
    8080    setStaticContentsSupport(true);
    8181}
     
    9090        QS60PixmapData *pixmapData = static_cast<QS60PixmapData *>(d_ptr->device.data_ptr().data());
    9191        pixmapData->beginDataAccess();
    92         QImage &image = pixmapData->image;
    93         QRgb *data = reinterpret_cast<QRgb *>(image.bits());
    94         const int row_stride = image.bytesPerLine() / 4;
    9592
     93        QPainter p(&pixmapData->image);
     94        p.setCompositionMode(QPainter::CompositionMode_Source);
    9695        const QVector<QRect> rects = rgn.rects();
     96        const QColor blank = Qt::transparent;
    9797        for (QVector<QRect>::const_iterator it = rects.begin(); it != rects.end(); ++it) {
    98             const int x_start = it->x();
    99             const int width = it->width();
     98            p.fillRect(*it, blank);
     99        }
    100100
    101             const int y_start = it->y();
    102             const int height = it->height();
    103 
    104             QRgb *row = data + row_stride * y_start;
    105             for (int y = 0; y < height; ++y) {
    106                 qt_memfill(row + x_start, 0U, width);
    107                 row += row_stride;
    108             }
    109         }
    110101        pixmapData->endDataAccess();
    111102    }
     
    129120    const QPoint off = offset(widget);
    130121    QImage *img = &(static_cast<QS60PixmapData *>(d_ptr->device.data_ptr().data())->image);
    131    
     122
    132123    QRect rect(off, widget->size());
    133124    rect &= QRect(QPoint(), img->size());
     
    150141    QTLWExtra *topExtra = window->d_func()->maybeTopData();
    151142    Q_ASSERT(topExtra);
     143    QRect qr = region.boundingRect();
    152144    if (!topExtra->inExpose) {
    153145        topExtra->inExpose = true; // Prevent DrawNow() from calling syncBackingStore() again
    154         TRect tr = qt_QRect2TRect(region.boundingRect());
     146        TRect tr = qt_QRect2TRect(qr);
    155147        widget->winId()->DrawNow(tr);
    156148        topExtra->inExpose = false;
     149    } else {
     150        // This handles the case when syncBackingStore updates content outside of the
     151        // original drawing rectangle. This might happen if there are pending update()
     152        // events at the same time as we get a Draw() from Symbian.
     153        QRect drawRect = qt_TRect2QRect(widget->winId()->DrawableWindow()->GetDrawRect());
     154        if (!drawRect.contains(qr))
     155            widget->winId()->DrawDeferred();
    157156    }
    158157}
Note: See TracChangeset for help on using the changeset viewer.