Changeset 846 for trunk/src/plugins/gfxdrivers
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 36 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/plugins/gfxdrivers/ahi/qscreenahi_qws.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/plugins/gfxdrivers/ahi/qscreenahi_qws.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/plugins/gfxdrivers/ahi/qscreenahiplugin.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/plugins/gfxdrivers/directfb/directfb.pro
r561 r846 12 12 QMAKE_CXXFLAGS += $$QT_CFLAGS_DIRECTFB 13 13 LIBS += $$QT_LIBS_DIRECTFB 14 DEFINES += $$QT_DEFINES_DIRECTFB QT_DIRECTFB_PLUGIN14 DEFINES += $$QT_DEFINES_DIRECTFB 15 15 contains(gfx-plugins, directfb):DEFINES += QT_QWS_DIRECTFB -
trunk/src/plugins/gfxdrivers/directfb/qdirectfbkeyboard.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/plugins/gfxdrivers/directfb/qdirectfbkeyboard.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/plugins/gfxdrivers/directfb/qdirectfbmouse.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 56 56 #include <private/qimagepixmapcleanuphooks_p.h> 57 57 58 58 59 QT_BEGIN_NAMESPACE 59 60 … … 67 68 Matrix_BlitsUnsupported = (Matrix_NegativeScale|Matrix_RectsUnsupported) 68 69 }; 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 } 69 79 70 80 enum CompositionModeStatus { … … 99 109 inline bool isSimpleBrush(const QBrush &brush) const; 100 110 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); 102 112 void blit(const QRectF &dest, IDirectFBSurface *surface, const QRectF &src); 103 113 … … 113 123 #endif 114 124 115 void prepareForBlit(bool alpha); 125 enum BlitFlag { 126 HasAlpha = 0x1, 127 Premultiplied = 0x2 128 }; 129 void prepareForBlit(uint blitFlags); 116 130 117 131 IDirectFBSurface *surface; … … 168 182 #endif 169 183 170 #if defined QT_DIRECTFB_WARN_ON_RASTERFALLBACKS || defined QT_DIRECTFB_DISABLE_RASTERFALLBACKS || defined QT_DEBUG171 184 #define VOID_ARG() static_cast<bool>(false) 172 185 enum PaintOperation { … … 176 189 DRAW_POLYGON = 0x0200, DRAW_TEXT = 0x0400, FILL_PATH = 0x0800, 177 190 FILL_RECT = 0x1000, DRAW_COLORSPANS = 0x2000, DRAW_ROUNDED_RECT = 0x4000, 178 ALL = 0xffff191 DRAW_STATICTEXT = 0x8000, ALL = 0xffff 179 192 }; 180 193 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); 194 enum { RasterWarn = 1, RasterDisable = 2 }; 195 static 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 } 225 251 } 226 252 } 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 263 269 template <typename device, typename T1, typename T2, typename T3> 264 270 static void rasterFallbackWarn(const char *msg, const char *func, const device *dev, … … 268 274 const char *nameTwo, const T2 &two, 269 275 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 273 277 #define RASTERFALLBACK(op, one, two, three) \ 274 278 { \ 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", \ 280 284 __FUNCTION__, \ 281 285 state()->painter->device(), \ … … 285 289 d_func()->compositionModeStatus, \ 286 290 #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: \ 288 302 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 } 307 305 308 306 template <class T> … … 633 631 bool release; 634 632 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); 636 639 CLIPPED_PAINT(d->blit(r, imgSurface, sr)); 637 640 if (release) { … … 672 675 } else { 673 676 QDirectFBPaintEnginePrivate::unlock(dfbData); 674 d->prepareForBlit(pixmap.hasAlphaChannel());675 677 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); 676 685 CLIPPED_PAINT(d->blit(r, s, sr)); 677 686 } … … 708 717 QRasterPaintEngine::drawTiledPixmap(r, pix, offset); 709 718 } else { 710 CLIPPED_PAINT(d->drawTiledPixmap(r, pixmap, offset)); 719 QTransform transform(state()->matrix); 720 CLIPPED_PAINT(d->drawTiledPixmap(r, pixmap, offset, transform)); 711 721 } 712 722 } … … 796 806 d->lock(); 797 807 QRasterPaintEngine::drawRoundedRect(rect, xrad, yrad, mode); 808 } 809 810 void 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); 798 816 } 799 817 … … 820 838 821 839 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; 822 845 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())) { 825 848 break; 826 849 } … … 830 853 break; 831 854 832 CLIPPED_PAINT(d->drawTiledPixmap( rect, texture, rect.topLeft() - state()->brushOrigin));855 CLIPPED_PAINT(d->drawTiledPixmap(stateTransform.mapRect(rect), texture, rect.topLeft() - brushOrigin, transform)); 833 856 return; } 834 857 default: … … 941 964 void QDirectFBPaintEnginePrivate::setTransform(const QTransform &transform) 942 965 { 943 transformationType = transform.type(); 944 if (qMin(transform.m11(), transform.m22()) < 0) { 945 transformationType |= QDirectFBPaintEnginePrivate::Matrix_NegativeScale; 946 } 966 transformationType = getTransformationType(transform); 947 967 setPen(q->state()->pen); 948 968 } … … 1040 1060 } 1041 1061 1042 void QDirectFBPaintEnginePrivate::prepareForBlit(bool alpha) 1043 { 1044 DFBSurfaceBlittingFlags blittingFlags = alpha ? DSBLIT_BLEND_ALPHACHANNEL : DSBLIT_NOFX; 1062 void 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; 1045 1069 if (opacity != 255) { 1046 1070 blittingFlags |= DSBLIT_BLEND_COLORALPHA; 1047 } 1048 surface->SetColor(surface, 0xff, 0xff, 0xff, opacity); 1071 surface->SetColor(surface, 0xff, 0xff, 0xff, opacity); 1072 } 1073 1049 1074 surface->SetBlittingFlags(surface, blittingFlags); 1050 1075 } … … 1141 1166 } 1142 1167 1143 void QDirectFBPaintEnginePrivate::drawTiledPixmap(const QRectF &dest, const QPixmap &pixmap, const QPointF &off)1144 { 1145 Q_ASSERT(!(transformationType & Matrix_BlitsUnsupported)); 1168 void QDirectFBPaintEnginePrivate::drawTiledPixmap(const QRectF &dest, const QPixmap &pixmap, 1169 const QPointF &off, const QTransform &pixmapTransform) 1170 { 1146 1171 const QTransform &transform = q->state()->matrix; 1172 Q_ASSERT(!(getTransformationType(transform) & Matrix_BlitsUnsupported) && 1173 !(getTransformationType(pixmapTransform) & Matrix_BlitsUnsupported)); 1147 1174 const QRect destinationRect = transform.mapRect(dest).toRect().normalized(); 1148 1175 QRect newClip = destinationRect; … … 1161 1188 surface->SetClip(surface, &clip); 1162 1189 1163 QPointF offset = off;1190 QPointF offset = pixmapTransform.inverted().map(off); 1164 1191 Q_ASSERT(transform.type() <= QTransform::TxScale); 1165 prepareForBlit(pixmap.hasAlphaChannel());1166 1192 QPixmapData *data = pixmap.pixmapData(); 1167 1193 Q_ASSERT(data->classId() == QPixmapData::DirectFBClass); 1168 1194 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); 1169 1202 QDirectFBPaintEnginePrivate::unlock(dfbData); 1170 1203 const QSize pixmapSize = dfbData->size(); 1171 IDirectFBSurface *sourceSurface = dfbData->directFBSurface(); 1172 if (transform.isScaling()) { 1204 if (transform.isScaling() || pixmapTransform.isScaling()) { 1173 1205 Q_ASSERT(supportsStretchBlit()); 1174 1206 Q_ASSERT(qMin(transform.m11(), transform.m22()) >= 0); … … 1176 1208 offset.ry() *= transform.m22(); 1177 1209 1178 const QSizeF mappedSize(pixmapSize.width() * transform.m11(), pixmapSize.height() * transform.m22());1210 const QSizeF mappedSize(pixmapSize.width() * pixmapTransform.m11(), pixmapSize.height() * pixmapTransform.m22()); 1179 1211 qreal y = fixCoord(destinationRect.y(), mappedSize.height(), offset.y()); 1180 1212 const qreal startX = fixCoord(destinationRect.x(), mappedSize.width(), offset.x()); … … 1355 1387 } 1356 1388 1357 #if defined QT_DIRECTFB_WARN_ON_RASTERFALLBACKS || defined QT_DEBUG1358 1389 template <typename T> inline const T *ptr(const T &t) { return &t; } 1359 1390 template <> inline const bool* ptr<bool>(const bool &) { return 0; } … … 1396 1427 } 1397 1428 1398 #endif // QT_DIRECTFB_WARN_ON_RASTERFALLBACKS1399 1400 1429 QT_END_NAMESPACE 1401 1430 -
trunk/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 110 110 virtual void clip(const QRect &rect, Qt::ClipOperation op); 111 111 112 virtual void drawStaticTextItem(QStaticTextItem *item); 113 112 114 static void initImageCache(int size); 113 115 }; -
trunk/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 92 92 } 93 93 94 #ifdef QT_DIRECTFB_OPAQUE_DETECTION 94 95 // mostly duplicated from qimage.cpp (QImageData::checkForAlphaPixels) 95 96 static bool checkForAlphaPixels(const QImage &img) … … 161 162 return false; 162 163 } 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 166 bool 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)); 168 172 #else 173 Q_UNUSED(flags); 169 174 return img.hasAlphaChannel(); 170 175 #endif … … 247 252 QDirectFBPointer<IDirectFBImageProvider> provider(providerPtr); 248 253 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 255 254 DFBImageDescription imageDescription; 256 255 result = provider->GetImageDescription(provider.data(), &imageDescription); … … 260 259 } 261 260 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; 263 272 imageFormat = alpha ? screen->alphaPixmapFormat() : screen->pixelFormat(); 264 273 … … 288 297 #endif 289 298 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 } 299 void QDirectFBPixmapData::fromImage(const QImage &img, Qt::ImageConversionFlags flags) 300 { 301 alpha = QDirectFBPixmapData::hasAlphaChannel(img, flags); 303 302 imageFormat = alpha ? screen->alphaPixmapFormat() : screen->pixelFormat(); 304 303 QImage image; … … 591 590 } 592 591 593 #ifndef QT_DIRECTFB_PLUGIN594 592 Q_GUI_EXPORT IDirectFBSurface *qt_directfb_surface_for_pixmap(const QPixmap &pixmap) 595 593 { … … 600 598 return dfbData->directFBSurface(); 601 599 } 602 #endif603 600 604 601 QT_END_NAMESPACE -
trunk/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 87 87 88 88 inline QImage::Format pixelFormat() const { return imageFormat; } 89 static bool hasAlphaChannel(const QImage &img);90 89 inline bool hasAlphaChannel() const { return alpha; } 90 static bool hasAlphaChannel(const QImage &img, Qt::ImageConversionFlags flags = Qt::AutoColor); 91 91 private: 92 92 #ifdef QT_DIRECTFB_IMAGEPROVIDER -
trunk/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 1555 1555 } 1556 1556 } 1557 if (!region.isEmpty()) { 1558 solidFill(d_ptr->backgroundColor, region); 1559 } 1557 1558 solidFill(d_ptr->backgroundColor, region); 1560 1559 1561 1560 while (idx > 0) { … … 1630 1629 Q_UNUSED(region); 1631 1630 #else 1631 QDirectFBScreen::solidFill(d_ptr->primarySurface, color, region); 1632 #endif 1633 } 1634 1635 static 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, ®ion); 1641 surface->Clear(surface, color.red(), color.green(), color.blue(), color.alpha()); 1642 } 1643 1644 void QDirectFBScreen::solidFill(IDirectFBSurface *surface, const QColor &color, const QRegion ®ion) 1645 { 1632 1646 if (region.isEmpty()) 1633 1647 return; 1634 1648 1635 d_ptr->primarySurface->SetColor(d_ptr->primarySurface,1636 color.red(), color.green(), color.blue(),1637 color.alpha());1638 1649 const int n = region.rectCount(); 1639 1650 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()); 1642 1652 } else { 1643 1653 const QVector<QRect> rects = region.rects(); 1644 QVarLengthArray<DFBRectangle, 32> rectArray(n);1645 1654 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); 1655 1659 } 1656 1660 … … 1791 1795 #endif 1792 1796 1793 #ifndef QT_DIRECTFB_PLUGIN1794 1797 Q_GUI_EXPORT IDirectFBSurface *qt_directfb_surface_for_widget(const QWidget *widget, QRect *rect) 1795 1798 { … … 1809 1812 1810 1813 #endif 1811 #endif1812 1814 1813 1815 QT_END_NAMESPACE -
trunk/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 160 160 void exposeRegion(QRegion r, int changing); 161 161 void solidFill(const QColor &color, const QRegion ®ion); 162 static void solidFill(IDirectFBSurface *surface, const QColor &color, const QRegion ®ion); 162 163 163 164 void setMode(int width, int height, int depth); -
trunk/src/plugins/gfxdrivers/directfb/qdirectfbscreenplugin.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 345 345 return; 346 346 347 #ifndef QT_NO_QWS_PROXYSCREEN 347 348 QWExtra *extra = qt_widget_private(widget)->extraData(); 348 349 if (extra && extra->proxyWidget) 349 350 return; 351 #endif 350 352 351 353 const quint8 windowOpacity = quint8(win->windowOpacity() * 0xff); … … 381 383 } 382 384 383 void QDirectFBWindowSurface::beginPaint(const QRegion & )385 void QDirectFBWindowSurface::beginPaint(const QRegion ®ion) 384 386 { 385 387 if (!engine) { 386 388 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 } 387 396 } 388 397 flushPending = true; -
trunk/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/plugins/gfxdrivers/linuxfb/main.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.c
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 96 96 height = var.yres; 97 97 bytesPerPixel = var.bits_per_pixel / 8; 98 stride = var.xres * bytesPerPixel;98 stride = fix.line_length; 99 99 format = PVR2D_1BPP; 100 100 if (var.bits_per_pixel == 16) { -
trunk/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable_p.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreenplugin.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/plugins/gfxdrivers/qvfb/main.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/plugins/gfxdrivers/transformed/main.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/plugins/gfxdrivers/vnc/main.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/plugins/gfxdrivers/vnc/qscreenvnc_p.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 1054 1054 QRfbClientCutText ev; 1055 1055 1056 if ( ev.read(client)) {1056 if (cutTextPending == 0 && ev.read(client)) { 1057 1057 cutTextPending = ev.length; 1058 1058 if (!cutTextPending) … … 1482 1482 if (count & 0x1) { 1483 1483 const quint16 *src16 = reinterpret_cast<const quint16*>(src); 1484 dst32[count - 1]= qt_conv16ToRgb(src16[count - 1]);1484 *dst32 = qt_conv16ToRgb(src16[count - 1]); 1485 1485 } 1486 1486 return; … … 2039 2039 qvnc_cursor = 0; 2040 2040 #endif 2041 if (!qvnc_screen->screen() && !qvnc_screen->d_ptr->noDisablePainting )2041 if (!qvnc_screen->screen() && !qvnc_screen->d_ptr->noDisablePainting && QWSServer::instance()) 2042 2042 QWSServer::instance()->enablePainting(false); 2043 2043 } -
trunk/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com)
Note:
See TracChangeset
for help on using the changeset viewer.