Changeset 769 for trunk/src/gui/painting/qwindowsurface_s60.cpp
- Timestamp:
- Aug 2, 2010, 9:27:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.3 (added) merged: 768 /branches/vendor/nokia/qt/current merged: 767 /branches/vendor/nokia/qt/4.6.2 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/painting/qwindowsurface_s60.cpp
r651 r769 71 71 CFbsBitmap *bitmap = q_check_ptr(new CFbsBitmap); // CBase derived object needs check on new 72 72 qt_symbian_throwIfError( bitmap->Create( TSize(0, 0), mode ) ); 73 73 74 74 QS60PixmapData *data = new QS60PixmapData(QPixmapData::PixmapType); 75 75 if (data) { … … 77 77 d_ptr->device = QPixmap(data); 78 78 } 79 79 80 80 setStaticContentsSupport(true); 81 81 } … … 90 90 QS60PixmapData *pixmapData = static_cast<QS60PixmapData *>(d_ptr->device.data_ptr().data()); 91 91 pixmapData->beginDataAccess(); 92 QImage &image = pixmapData->image;93 QRgb *data = reinterpret_cast<QRgb *>(image.bits());94 const int row_stride = image.bytesPerLine() / 4;95 92 93 QPainter p(&pixmapData->image); 94 p.setCompositionMode(QPainter::CompositionMode_Source); 96 95 const QVector<QRect> rects = rgn.rects(); 96 const QColor blank = Qt::transparent; 97 97 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 } 100 100 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 }110 101 pixmapData->endDataAccess(); 111 102 } … … 129 120 const QPoint off = offset(widget); 130 121 QImage *img = &(static_cast<QS60PixmapData *>(d_ptr->device.data_ptr().data())->image); 131 122 132 123 QRect rect(off, widget->size()); 133 124 rect &= QRect(QPoint(), img->size()); … … 150 141 QTLWExtra *topExtra = window->d_func()->maybeTopData(); 151 142 Q_ASSERT(topExtra); 143 QRect qr = region.boundingRect(); 152 144 if (!topExtra->inExpose) { 153 145 topExtra->inExpose = true; // Prevent DrawNow() from calling syncBackingStore() again 154 TRect tr = qt_QRect2TRect( region.boundingRect());146 TRect tr = qt_QRect2TRect(qr); 155 147 widget->winId()->DrawNow(tr); 156 148 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(); 157 156 } 158 157 }
Note:
See TracChangeset
for help on using the changeset viewer.