diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2009-04-24 10:26:26 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-04-24 10:26:26 (GMT) |
commit | ed3b35cff7ed7663971665e67d3a4037da8bd158 (patch) | |
tree | 74c08f6edcc96566e2fb4ddf75ad5c4e7572d028 | |
parent | 3ab7dc5d764d41bf828dd76672ca2918b004bad3 (diff) | |
parent | 10fa7986020c75da0ce68ec051a1086bd6bf5bf4 (diff) | |
download | Qt-ed3b35cff7ed7663971665e67d3a4037da8bd158.zip Qt-ed3b35cff7ed7663971665e67d3a4037da8bd158.tar.gz Qt-ed3b35cff7ed7663971665e67d3a4037da8bd158.tar.bz2 |
Merge branch '4.5'
Conflicts (version number change in 4.5):
src/corelib/global/qglobal.h
src/qbase.pri
tools/qdoc3/test/assistant.qdocconf
tools/qdoc3/test/designer.qdocconf
tools/qdoc3/test/linguist.qdocconf
tools/qdoc3/test/qmake.qdocconf
tools/qdoc3/test/qt-build-docs.qdocconf
tools/qdoc3/test/qt.qdocconf
-rw-r--r-- | src/gui/kernel/qcocoaview_mac.mm | 76 | ||||
-rw-r--r-- | src/gui/kernel/qt_cocoa_helpers_mac.mm | 12 | ||||
-rw-r--r-- | src/gui/kernel/qt_cocoa_helpers_mac_p.h | 1 | ||||
-rw-r--r-- | src/gui/painting/qpaintengine_raster.cpp | 14 | ||||
-rw-r--r-- | src/network/socket/qlocalserver_unix.cpp | 6 | ||||
-rw-r--r-- | src/plugins/gfxdrivers/directfb/directfb.pro | 4 | ||||
-rw-r--r-- | src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp | 130 | ||||
-rw-r--r-- | src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.h | 1 | ||||
-rw-r--r-- | src/plugins/iconengines/svgiconengine/qsvgiconengine.cpp | 12 | ||||
-rw-r--r-- | src/plugins/qpluginbase.pri | 2 | ||||
-rw-r--r-- | src/svg/qsvgstyle.cpp | 1 | ||||
-rw-r--r-- | tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp | 44 | ||||
-rw-r--r-- | tools/assistant/tools/assistant/doc/assistant.qdocconf | 2 |
13 files changed, 229 insertions, 76 deletions
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index dcb3564..cf66605 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -293,9 +293,18 @@ extern "C" { QPoint posDrag(localPoint.x, localPoint.y); NSDragOperation nsActions = [sender draggingSourceOperationMask]; Qt::DropActions qtAllowed = qt_mac_mapNSDragOperations(nsActions); + QT_PREPEND_NAMESPACE(qt_mac_dnd_answer_rec.lastOperation) = nsActions; + Qt::KeyboardModifiers modifiers = Qt::NoModifier; + if ([sender draggingSource] != nil) { + // modifier flags might have changed, update it here since we don't send any input events. + QApplicationPrivate::modifier_buttons = qt_cocoaModifiers2QtModifiers([[NSApp currentEvent] modifierFlags]); + modifiers = QApplication::keyboardModifiers(); + } else { + // when the source is from another application the above technique will not work. + modifiers = qt_cocoaDragOperation2QtModifiers(nsActions); + } // send the drag enter event to the widget. - QDragEnterEvent qDEEvent(posDrag, qtAllowed, mimeData, - QApplication::mouseButtons(), QApplication::keyboardModifiers()); + QDragEnterEvent qDEEvent(posDrag, qtAllowed, mimeData, QApplication::mouseButtons(), modifiers); QApplication::sendEvent(qwidget, &qDEEvent); if (!qDEEvent.isAccepted()) { // widget is not interested in this drag, so ignore this drop data. @@ -303,24 +312,23 @@ extern "C" { return NSDragOperationNone; } else { // send a drag move event immediately after a drag enter event (as per documentation). - QDragMoveEvent qDMEvent(posDrag, qtAllowed, mimeData, - QApplication::mouseButtons(), QApplication::keyboardModifiers()); + QDragMoveEvent qDMEvent(posDrag, qtAllowed, mimeData, QApplication::mouseButtons(), modifiers); qDMEvent.setDropAction(qDEEvent.dropAction()); qDMEvent.accept(); // accept by default, since enter event was accepted. QApplication::sendEvent(qwidget, &qDMEvent); if (!qDMEvent.isAccepted() || qDMEvent.dropAction() == Qt::IgnoreAction) { // since we accepted the drag enter event, the widget expects // future drage move events. - // ### check if we need to treat this like the drag enter event. + // ### check if we need to treat this like the drag enter event. nsActions = QT_PREPEND_NAMESPACE(qt_mac_mapDropAction)(qDEEvent.dropAction()); } else { nsActions = QT_PREPEND_NAMESPACE(qt_mac_mapDropAction)(qDMEvent.dropAction()); - } + } QT_PREPEND_NAMESPACE(qt_mac_copy_answer_rect)(qDMEvent); - return nsActions; + return nsActions; } } - + - (NSDragOperation)draggingUpdated:(id < NSDraggingInfo >)sender { // drag enter event was rejected, so ignore the move event. @@ -338,11 +346,19 @@ extern "C" { // send drag move event to the widget QT_PREPEND_NAMESPACE(qt_mac_dnd_answer_rec.lastOperation) = nsActions; Qt::DropActions qtAllowed = QT_PREPEND_NAMESPACE(qt_mac_mapNSDragOperations)(nsActions); + Qt::KeyboardModifiers modifiers = Qt::NoModifier; + if ([sender draggingSource] != nil) { + // modifier flags might have changed, update it here since we don't send any input events. + QApplicationPrivate::modifier_buttons = qt_cocoaModifiers2QtModifiers([[NSApp currentEvent] modifierFlags]); + modifiers = QApplication::keyboardModifiers(); + } else { + // when the source is from another application the above technique will not work. + modifiers = qt_cocoaDragOperation2QtModifiers(nsActions); + } QMimeData *mimeData = dropData; if (QDragManager::self()->source()) mimeData = QDragManager::self()->dragPrivate()->data; - QDragMoveEvent qDMEvent(posDrag, qtAllowed, mimeData, - QApplication::mouseButtons(), QApplication::keyboardModifiers()); + QDragMoveEvent qDMEvent(posDrag, qtAllowed, mimeData, QApplication::mouseButtons(), modifiers); qDMEvent.setDropAction(QT_PREPEND_NAMESPACE(qt_mac_dnd_answer_rec).lastAction); qDMEvent.accept(); QApplication::sendEvent(qwidget, &qDMEvent); @@ -371,12 +387,12 @@ extern "C" { - (BOOL)performDragOperation:(id <NSDraggingInfo>)sender { [self addDropData:sender]; - + NSPoint windowPoint = [sender draggingLocation]; NSPoint globalPoint = [[sender draggingDestinationWindow] convertBaseToScreen:windowPoint]; NSPoint localPoint = [self convertPoint:windowPoint fromView:nil]; QPoint posDrop(localPoint.x, localPoint.y); - + NSDragOperation nsActions = [sender draggingSourceOperationMask]; Qt::DropActions qtAllowed = qt_mac_mapNSDragOperations(nsActions); QMimeData *mimeData = dropData; @@ -388,6 +404,8 @@ extern "C" { if (QDragManager::self()->object) QDragManager::self()->dragPrivate()->target = qwidget; QApplication::sendEvent(qwidget, &de); + if (QDragManager::self()->object) + QDragManager::self()->dragPrivate()->executed_action = de.dropAction(); if (!de.isAccepted()) return NO; else @@ -419,10 +437,9 @@ extern "C" { - (void) setFrameSize:(NSSize)newSize { [super setFrameSize:newSize]; - + // A change in size has required the view to be invalidated. - if ([self inLiveResize]) - { + if ([self inLiveResize]) { NSRect rects[4]; NSInteger count; [self getRectsExposedDuringLiveResize:rects count:&count]; @@ -430,9 +447,7 @@ extern "C" { { [self setNeedsDisplayInRect:rects[count]]; } - } - else - { + } else { [self setNeedsDisplay:YES]; } } @@ -567,7 +582,7 @@ extern "C" { if (!qAppInstance()->activeModalWidget() || QApplicationPrivate::tryModalHelper(qwidget, 0)) { QApplication::sendEvent(qwidget, &enterEvent); qt_mouseover = qwidget; - + // Update cursor and dispatch hover events. qt_mac_update_cursor_at_global_pos(flipPoint(globalPoint).toPoint()); if (qwidget->testAttribute(Qt::WA_Hover) && @@ -622,7 +637,7 @@ extern "C" { [viewsToLookAt addObject:qt_mac_nativeview_for(parentWidget)]; parentWidget = parentWidget->parentWidget(); } - + // Now walk through the subviews of each view and determine which subview should // get the event. We look through all the subviews at a given level with // the assumption that the last item to be found the candidate has a higher z-order. @@ -758,7 +773,7 @@ extern "C" { if (currentIManager && [currentIManager wantsToHandleMouseEvents]) { [currentIManager handleMouseEvent:theEvent]; } - + NSPoint windowPoint = [theEvent locationInWindow]; NSPoint globalPoint = [[theEvent window] convertBaseToScreen:windowPoint]; NSPoint localPoint = [self convertPoint:windowPoint fromView:nil]; @@ -767,7 +782,7 @@ extern "C" { Qt::MouseButton buttons = cocoaButton2QtButton([theEvent buttonNumber]); bool wheelOK = false; Qt::KeyboardModifiers keyMods = qt_cocoaModifiers2QtModifiers([theEvent modifierFlags]); - + // Mouse wheel deltas seem to tick in at increments of 0.1. Qt widgets // expect the delta to be a multiple of 120. const int ScrollFactor = 10 * 120; @@ -789,7 +804,7 @@ extern "C" { wheelOK = qwe2.isAccepted(); } } - + if (deltaY) { QWheelEvent qwe(qlocal, qglobal, deltaY, buttons, keyMods, Qt::Vertical); qt_sendSpontaneousEvent(qwidget, &qwe); @@ -802,7 +817,7 @@ extern "C" { wheelOK = qwe2.isAccepted(); } } - + if (deltaZ) { // Qt doesn't explicitly support wheels with a Z component. In a misguided attempt to // try to be ahead of the pack, I'm adding this extra value. @@ -891,6 +906,11 @@ extern "C" { Q_UNUSED(anImage); Q_UNUSED(aPoint); qMacDnDParams()->performedAction = operation; + if (QDragManager::self()->object + && QDragManager::self()->dragPrivate()->executed_action != Qt::ActionMask) { + qMacDnDParams()->performedAction = + qt_mac_mapDropAction(QDragManager::self()->dragPrivate()->executed_action); + } } - (QWidget *)qt_qwidget @@ -1214,13 +1234,13 @@ Qt::DropAction QDragManager::drag(QDrag *o) so we just bail early to prevent it */ if(!(GetCurrentEventButtonState() & kEventMouseButtonPrimary)) return Qt::IgnoreAction; - + if(object) { dragPrivate()->source->removeEventFilter(this); cancel(); beingCancelled = false; } - + object = o; dragPrivate()->target = 0; @@ -1232,7 +1252,7 @@ Qt::DropAction QDragManager::drag(QDrag *o) QMacPasteboard dragBoard((CFStringRef) NSDragPboard, QMacPasteboardMime::MIME_DND); dragPrivate()->data->setData(QLatin1String("application/x-qt-mime-type-name"), QByteArray()); dragBoard.setMimeData(dragPrivate()->data); - + // create the image QPoint hotspot; QPixmap pix = dragPrivate()->pixmap; @@ -1278,6 +1298,7 @@ Qt::DropAction QDragManager::drag(QDrag *o) NSSize mouseOffset = {0.0, 0.0}; NSPasteboard *pboard = [NSPasteboard pasteboardWithName:NSDragPboard]; NSPoint windowPoint = [dndParams->theEvent locationInWindow]; + dragPrivate()->executed_action = Qt::ActionMask; // do the drag [dndParams->view retain]; [dndParams->view dragImage:image @@ -1289,6 +1310,7 @@ Qt::DropAction QDragManager::drag(QDrag *o) slideBack:YES]; [dndParams->view release]; [image release]; + dragPrivate()->executed_action = Qt::IgnoreAction; object = 0; Qt::DropAction performedAction(qt_mac_mapNSDragOperation(dndParams->performedAction)); // do post drag processing, if required. diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm index 52e76d8..f000292 100644 --- a/src/gui/kernel/qt_cocoa_helpers_mac.mm +++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm @@ -515,6 +515,18 @@ Qt::KeyboardModifiers qt_cocoaModifiers2QtModifiers(ulong modifierFlags) return qtMods; } +Qt::KeyboardModifiers qt_cocoaDragOperation2QtModifiers(uint dragOperations) +{ + Qt::KeyboardModifiers qtMods =Qt::NoModifier; + if (dragOperations & NSDragOperationLink) + qtMods |= Qt::MetaModifier; + if (dragOperations & NSDragOperationGeneric) + qtMods |= Qt::ControlModifier; + if (dragOperations & NSDragOperationCopy) + qtMods |= Qt::AltModifier; + return qtMods; +} + static inline QEvent::Type cocoaEvent2QtEvent(NSUInteger eventType) { // Handle the trivial cases that can be determined from the type. diff --git a/src/gui/kernel/qt_cocoa_helpers_mac_p.h b/src/gui/kernel/qt_cocoa_helpers_mac_p.h index ef55aa4..63a301c 100644 --- a/src/gui/kernel/qt_cocoa_helpers_mac_p.h +++ b/src/gui/kernel/qt_cocoa_helpers_mac_p.h @@ -141,6 +141,7 @@ inline QApplication *qAppInstance() { return static_cast<QApplication *>(QCoreAp struct ::TabletProximityRec; void qt_dispatchTabletProximityEvent(const ::TabletProximityRec &proxRec); Qt::KeyboardModifiers qt_cocoaModifiers2QtModifiers(ulong modifierFlags); +Qt::KeyboardModifiers qt_cocoaDragOperation2QtModifiers(uint dragOperations); inline int flipYCoordinate(int y) { return QApplication::desktop()->screenGeometry(0).height() - y; diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index d2b1ed7..295abc5 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -4409,6 +4409,9 @@ void QClipData::fixup() */ void QClipData::setClipRect(const QRect &rect) { + if (rect == clipRect) + return; + // qDebug() << "setClipRect" << clipSpanHeight << count << allocated << rect; hasRectClip = true; clipRect = rect; @@ -4418,6 +4421,11 @@ void QClipData::setClipRect(const QRect &rect) ymin = qMin(rect.y(), clipSpanHeight); ymax = qMin(rect.y() + rect.height(), clipSpanHeight); + if (m_spans) { + delete m_spans; + m_spans = 0; + } + // qDebug() << xmin << xmax << ymin << ymax; } @@ -4441,6 +4449,12 @@ void QClipData::setClipRegion(const QRegion ®ion) ymin = rect.y(); ymax = rect.y() + rect.height(); } + + if (m_spans) { + delete m_spans; + m_spans = 0; + } + } /*! diff --git a/src/network/socket/qlocalserver_unix.cpp b/src/network/socket/qlocalserver_unix.cpp index 065a9de..e7d2252 100644 --- a/src/network/socket/qlocalserver_unix.cpp +++ b/src/network/socket/qlocalserver_unix.cpp @@ -148,9 +148,11 @@ void QLocalServerPrivate::closeServer() QT_CLOSE(listenSocket); listenSocket = -1; - if (socketNotifier) + if (socketNotifier) { + socketNotifier->setEnabled(false); // Otherwise, closed socket is checked before deleter runs socketNotifier->deleteLater(); - socketNotifier = 0; + socketNotifier = 0; + } if (!fullServerName.isEmpty()) QFile::remove(fullServerName); diff --git a/src/plugins/gfxdrivers/directfb/directfb.pro b/src/plugins/gfxdrivers/directfb/directfb.pro index 89a289c..1ee9030 100644 --- a/src/plugins/gfxdrivers/directfb/directfb.pro +++ b/src/plugins/gfxdrivers/directfb/directfb.pro @@ -3,7 +3,7 @@ include(../../qpluginbase.pri) QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/gfxdrivers -# These defines might be necessary if your DirectFB driver doesn't +# These defines might be necessary if your DirectFB driver doesn't # support all of the DirectFB API. # #DEFINES += QT_NO_DIRECTFB_WM @@ -14,6 +14,8 @@ QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/gfxdrivers #DEFINES += QT_NO_DIRECTFB_KEYBOARD #DEFINES += QT_DIRECTFB_TIMING #DEFINES += QT_NO_DIRECTFB_OPAQUE_DETECTION +#DEFINES += QT_DIRECTFB_WARN_ON_RASTERFALLBACKS +#DEFINES += QT_DIRECTFB_DISABLE_RASTERFALLBACKS target.path = $$[QT_INSTALL_PLUGINS]/gfxdrivers INSTALLS += target diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp index d9346fd..ba5d71a 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp @@ -54,6 +54,70 @@ #include <private/qpixmapdata_p.h> #include <private/qpixmap_raster_p.h> +#ifdef QT_DIRECTFB_WARN_ON_RASTERFALLBACKS +template <typename T> inline const T *ptr(const T &t) { return &t; } +template <> inline const bool* ptr<bool>(const bool &) { return 0; } +template <typename device, typename T1, typename T2, typename T3> +static void rasterFallbackWarn(const char *msg, const char *func, const device *dev, + bool matrixScale, bool matrixRotShear, bool simplePen, + bool dfbHandledClip, bool forceRasterPrimitives, + const char *nameOne, const T1 &one, + const char *nameTwo, const T2 &two, + const char *nameThree, const T3 &three) +{ + QString out; + QDebug dbg(&out); + dbg << msg << (QByteArray(func) + "()") << "painting on"; + if (dev->devType() == QInternal::Widget) { + dbg << static_cast<const QWidget*>(dev); + } else { + dbg << dev << "of type" << dev->devType(); + } + + dbg << "matrixScale" << matrixScale + << "matrixRotShear" << matrixRotShear + << "simplePen" << simplePen + << "dfbHandledClip" << dfbHandledClip + << "forceRasterPrimitives" << forceRasterPrimitives; + + const T1 *t1 = ptr(one); + const T2 *t2 = ptr(two); + const T3 *t3 = ptr(three); + + if (t1) { + dbg << nameOne << *t1; + if (t2) { + dbg << nameTwo << *t2; + if (t3) { + dbg << nameThree << *t3; + } + } + } + qWarning("%s", qPrintable(out)); +} +#endif + +#if defined QT_DIRECTFB_WARN_ON_RASTERFALLBACKS && defined QT_DIRECTFB_DISABLE_RASTERFALLBACKS +#define RASTERFALLBACK(one, two, three) rasterFallbackWarn("Disabled raster engine operation", \ + __FUNCTION__, state()->painter->device(), \ + d_func()->matrixScale, d_func()->matrixRotShear, \ + d_func()->simplePen, d_func()->dfbCanHandleClip(), \ + d_func()->forceRasterPrimitives, \ + #one, one, #two, two, #three, three); \ + return; +#elif defined QT_DIRECTFB_DISABLE_RASTERFALLBACKS +#define RASTERFALLBACK(one, two, three) return; +#elif defined QT_DIRECTFB_WARN_ON_RASTERFALLBACKS +#define RASTERFALLBACK(one, two, three) rasterFallbackWarn("Falling back to raster engine for", \ + __FUNCTION__, state()->painter->device(), \ + d_func()->matrixScale, d_func()->matrixRotShear, \ + d_func()->simplePen, d_func()->dfbCanHandleClip(), \ + d_func()->forceRasterPrimitives, \ + #one, one, #two, two, #three, three); +#else +#define RASTERFALLBACK(one, two, three) +#endif + static inline uint ALPHA_MUL(uint x, uint a) { uint t = x * a; @@ -181,20 +245,17 @@ public: IDirectFBSurface *surface; QPen pen; - QBrush brush; bool antialiased; bool forceRasterPrimitives; bool simplePen; - bool simpleBrush; bool matrixRotShear; bool matrixScale; void setTransform(const QTransform &m); void setPen(const QPen &pen); - void setBrush(const QBrush &brush); void setCompositionMode(QPainter::CompositionMode mode); void setOpacity(quint8 value); void setRenderHints(QPainter::RenderHints hints); @@ -207,6 +268,7 @@ public: inline bool dfbCanHandleClip(const QRect &rect) const; inline bool dfbCanHandleClip(const QRectF &rect) const; inline bool dfbCanHandleClip() const; + inline bool isSimpleBrush(const QBrush &brush) const; void drawLines(const QLine *lines, int count) const; void drawLines(const QLineF *lines, int count) const; @@ -217,6 +279,7 @@ public: void fillRects(const QRectF *rects, int count) const; void drawRects(const QRectF *rects, int count) const; + void drawPixmap(const QRectF &dest, const QPixmap &pixmap, const QRectF &src); void drawTiledPixmap(const QRectF &dest, const QPixmap &pixmap); @@ -253,7 +316,7 @@ private: QDirectFBPaintEnginePrivate::QDirectFBPaintEnginePrivate(QDirectFBPaintEngine *p) : surface(0), antialiased(false), forceRasterPrimitives(false), simplePen(false), - simpleBrush(false), matrixRotShear(false), matrixScale(false), lastLockedHeight(-1), + matrixRotShear(false), matrixScale(false), lastLockedHeight(-1), fbWidth(-1), fbHeight(-1), opacity(255), drawFlagsFromCompositionMode(0), blitFlagsFromCompositionMode(0), porterDuffRule(DSPD_SRC_OVER), dirtyClip(true), dfbHandledClip(false), dfbDevice(0), q(p) @@ -287,6 +350,11 @@ bool QDirectFBPaintEnginePrivate::dfbCanHandleClip() const return dfbHandledClip; } +bool QDirectFBPaintEnginePrivate::isSimpleBrush(const QBrush &brush) const +{ + return (brush.style() == Qt::NoBrush) || (brush.style() == Qt::SolidPattern && !antialiased); +} + void QDirectFBPaintEnginePrivate::setClipDirty() { dirtyClip = true; @@ -366,13 +434,6 @@ void QDirectFBPaintEnginePrivate::setPen(const QPen &p) && (pen.widthF() <= 1 && !matrixScale)); } -void QDirectFBPaintEnginePrivate::setBrush(const QBrush &b) -{ - brush = b; - simpleBrush = (brush.style() == Qt::NoBrush) || - (brush.style() == Qt::SolidPattern && !antialiased); -} - void QDirectFBPaintEnginePrivate::setCompositionMode(QPainter::CompositionMode mode) { blitFlagsFromCompositionMode = DSBLIT_NOFX; @@ -755,14 +816,6 @@ void QDirectFBPaintEngine::penChanged() QRasterPaintEngine::penChanged(); } -void QDirectFBPaintEngine::brushChanged() -{ - Q_D(QDirectFBPaintEngine); - d->setBrush(state()->brush); - - QRasterPaintEngine::brushChanged(); -} - void QDirectFBPaintEngine::opacityChanged() { Q_D(QDirectFBPaintEngine); @@ -801,7 +854,6 @@ void QDirectFBPaintEngine::setState(QPainterState *s) QRasterPaintEngine::setState(s); d->setClipDirty(); d->setPen(state()->pen); - d->setBrush(state()->brush); d->setOpacity(quint8(state()->opacity * 255)); d->setCompositionMode(state()->compositionMode()); d->setTransform(state()->transform()); @@ -834,8 +886,11 @@ void QDirectFBPaintEngine::drawRects(const QRect *rects, int rectCount) { Q_D(QDirectFBPaintEngine); d->updateClip(); - if (!d->dfbCanHandleClip() || d->matrixRotShear || !d->simpleBrush - || !d->simplePen || d->forceRasterPrimitives) { + const QBrush &brush = state()->brush; + if (!d->dfbCanHandleClip() || d->matrixRotShear + || !d->simplePen || d->forceRasterPrimitives + || !d->isSimpleBrush(brush)) { + RASTERFALLBACK(rectCount, static_cast<bool>(false), static_cast<bool>(false)); d->lock(); QRasterPaintEngine::drawRects(rects, rectCount); return; @@ -843,8 +898,8 @@ void QDirectFBPaintEngine::drawRects(const QRect *rects, int rectCount) d->unlock(); - if (d->brush != Qt::NoBrush) { - d->setDFBColor(d->brush.color()); + if (brush != Qt::NoBrush) { + d->setDFBColor(brush.color()); d->fillRects(rects, rectCount); } if (d->pen != Qt::NoPen) { @@ -857,8 +912,10 @@ void QDirectFBPaintEngine::drawRects(const QRectF *rects, int rectCount) { Q_D(QDirectFBPaintEngine); d->updateClip(); - if (!d->dfbCanHandleClip() || d->matrixRotShear || !d->simpleBrush - || !d->simplePen || d->forceRasterPrimitives) { + const QBrush &brush = state()->brush; + if (!d->dfbCanHandleClip() || d->matrixRotShear + || !d->simplePen || d->forceRasterPrimitives + || !d->isSimpleBrush(brush)) { d->lock(); QRasterPaintEngine::drawRects(rects, rectCount); return; @@ -866,8 +923,8 @@ void QDirectFBPaintEngine::drawRects(const QRectF *rects, int rectCount) d->unlock(); - if (d->brush != Qt::NoBrush) { - d->setDFBColor(d->brush.color()); + if (brush != Qt::NoBrush) { + d->setDFBColor(brush.color()); d->fillRects(rects, rectCount); } if (d->pen != Qt::NoPen) { @@ -881,6 +938,7 @@ void QDirectFBPaintEngine::drawLines(const QLine *lines, int lineCount) Q_D(QDirectFBPaintEngine); d->updateClip(); if (!d->simplePen || !d->dfbCanHandleClip() || d->forceRasterPrimitives) { + RASTERFALLBACK(lineCount, static_cast<bool>(false), static_cast<bool>(false)); d->lock(); QRasterPaintEngine::drawLines(lines, lineCount); return; @@ -898,6 +956,7 @@ void QDirectFBPaintEngine::drawLines(const QLineF *lines, int lineCount) Q_D(QDirectFBPaintEngine); d->updateClip(); if (!d->simplePen || !d->dfbCanHandleClip() || d->forceRasterPrimitives) { + RASTERFALLBACK(lineCount, static_cast<bool>(false), static_cast<bool>(false)); d->lock(); QRasterPaintEngine::drawLines(lines, lineCount); return; @@ -923,6 +982,7 @@ void QDirectFBPaintEngine::drawImage(const QRectF &r, const QImage &image, || QDirectFBScreen::getSurfacePixelFormat(image.format()) == DSPF_UNKNOWN) #endif { + RASTERFALLBACK(r, image.size(), sr); d->lock(); QRasterPaintEngine::drawImage(r, image, sr, flags); return; @@ -946,9 +1006,11 @@ void QDirectFBPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pixmap, d->updateClip(); if (pixmap.pixmapData()->classId() != QPixmapData::DirectFBClass) { + // not using RASTERFALLBACK since this is the way we do bitmaps? d->lock(); QRasterPaintEngine::drawPixmap(r, pixmap, sr); } else if (!d->dfbCanHandleClip(r) || d->matrixRotShear) { + RASTERFALLBACK(r, pixmap.size(), sr); const QImage *img = static_cast<QDirectFBPixmapData*>(pixmap.pixmapData())->buffer(); d->lock(); QRasterPaintEngine::drawImage(r, *img, sr); @@ -973,6 +1035,7 @@ void QDirectFBPaintEngine::drawTiledPixmap(const QRectF &r, d->lock(); QRasterPaintEngine::drawTiledPixmap(r, pixmap, sp); } else if (!d->dfbCanHandleClip(r) || d->matrixRotShear || !sp.isNull()) { + RASTERFALLBACK(r, pixmap.size(), sp); const QImage *img = static_cast<QDirectFBPixmapData*>(pixmap.pixmapData())->buffer(); d->lock(); QRasterPixmapData *data = new QRasterPixmapData(QPixmapData::PixmapType); @@ -995,6 +1058,7 @@ void QDirectFBPaintEngine::stroke(const QVectorPath &path, const QPen &pen) void QDirectFBPaintEngine::drawPath(const QPainterPath &path) { + RASTERFALLBACK(path.boundingRect(), static_cast<bool>(false), static_cast<bool>(false)); Q_D(QDirectFBPaintEngine); d->lock(); QRasterPaintEngine::drawPath(path); @@ -1002,6 +1066,7 @@ void QDirectFBPaintEngine::drawPath(const QPainterPath &path) void QDirectFBPaintEngine::drawPoints(const QPointF *points, int pointCount) { + RASTERFALLBACK(pointCount, static_cast<bool>(false), static_cast<bool>(false)); Q_D(QDirectFBPaintEngine); d->lock(); QRasterPaintEngine::drawPoints(points, pointCount); @@ -1009,6 +1074,7 @@ void QDirectFBPaintEngine::drawPoints(const QPointF *points, int pointCount) void QDirectFBPaintEngine::drawPoints(const QPoint *points, int pointCount) { + RASTERFALLBACK(pointCount, static_cast<bool>(false), static_cast<bool>(false)); Q_D(QDirectFBPaintEngine); d->lock(); QRasterPaintEngine::drawPoints(points, pointCount); @@ -1016,6 +1082,7 @@ void QDirectFBPaintEngine::drawPoints(const QPoint *points, int pointCount) void QDirectFBPaintEngine::drawEllipse(const QRectF &rect) { + RASTERFALLBACK(rect, static_cast<bool>(false), static_cast<bool>(false)); Q_D(QDirectFBPaintEngine); d->lock(); QRasterPaintEngine::drawEllipse(rect); @@ -1024,6 +1091,7 @@ void QDirectFBPaintEngine::drawEllipse(const QRectF &rect) void QDirectFBPaintEngine::drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) { + RASTERFALLBACK(pointCount, mode, static_cast<bool>(false)); Q_D(QDirectFBPaintEngine); d->lock(); QRasterPaintEngine::drawPolygon(points, pointCount, mode); @@ -1032,6 +1100,7 @@ void QDirectFBPaintEngine::drawPolygon(const QPointF *points, int pointCount, void QDirectFBPaintEngine::drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode) { + RASTERFALLBACK(pointCount, mode, static_cast<bool>(false)); Q_D(QDirectFBPaintEngine); d->lock(); QRasterPaintEngine::drawPolygon(points, pointCount, mode); @@ -1040,6 +1109,7 @@ void QDirectFBPaintEngine::drawPolygon(const QPoint *points, int pointCount, void QDirectFBPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textItem) { + RASTERFALLBACK(p, textItem.text(), static_cast<bool>(false)); Q_D(QDirectFBPaintEngine); d->lock(); QRasterPaintEngine::drawTextItem(p, textItem); @@ -1047,6 +1117,7 @@ void QDirectFBPaintEngine::drawTextItem(const QPointF &p, void QDirectFBPaintEngine::fill(const QVectorPath &path, const QBrush &brush) { + RASTERFALLBACK(path, brush, static_cast<bool>(false)); Q_D(QDirectFBPaintEngine); d->lock(); QRasterPaintEngine::fill(path, brush); @@ -1080,6 +1151,7 @@ void QDirectFBPaintEngine::fillRect(const QRectF &rect, const QBrush &brush) break; } } + RASTERFALLBACK(rect, brush, static_cast<bool>(false)); d->lock(); QRasterPaintEngine::fillRect(rect, brush); } @@ -1089,6 +1161,7 @@ void QDirectFBPaintEngine::fillRect(const QRectF &rect, const QColor &color) Q_D(QDirectFBPaintEngine); d->updateClip(); if (!d->dfbCanHandleClip() || d->matrixRotShear || d->forceRasterPrimitives) { + RASTERFALLBACK(rect, color, static_cast<bool>(false)); d->lock(); QRasterPaintEngine::fillRect(rect, color); } else { @@ -1105,6 +1178,7 @@ void QDirectFBPaintEngine::drawColorSpans(const QSpan *spans, int count, { Q_D(QDirectFBPaintEngine); if (d->forceRasterPrimitives) { + RASTERFALLBACK(count, color, static_cast<bool>(false)); d->lock(); QRasterPaintEngine::drawColorSpans(spans, count, color); } else { diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.h b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.h index 3c2cefa..e79ec61 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.h +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.h @@ -96,7 +96,6 @@ public: virtual void clipEnabledChanged(); virtual void penChanged(); - virtual void brushChanged(); virtual void opacityChanged(); virtual void compositionModeChanged(); virtual void renderHintsChanged(); diff --git a/src/plugins/iconengines/svgiconengine/qsvgiconengine.cpp b/src/plugins/iconengines/svgiconengine/qsvgiconengine.cpp index 7fdf81f..c7249d3 100644 --- a/src/plugins/iconengines/svgiconengine/qsvgiconengine.cpp +++ b/src/plugins/iconengines/svgiconengine/qsvgiconengine.cpp @@ -121,7 +121,7 @@ QSize QSvgIconEngine::actualSize(const QSize &size, QIcon::Mode mode, if (!pm.isNull() && pm.size() == size) return size; } - + QSvgRenderer renderer; d->loadDataForModeAndState(&renderer, mode, state); if (renderer.isValid()) { @@ -158,9 +158,13 @@ void QSvgIconEnginePrivate::loadDataForModeAndState(QSvgRenderer *renderer, QIco QPixmap QSvgIconEngine::pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) -{ +{ QPixmap pm; + QString pmckey(d->pmcKey(size, mode, state)); + if (QPixmapCache::find(pmckey, pm)) + return pm; + if (d->addedPixmaps) { pm = d->addedPixmaps->value(d->hashKey(mode, state)); if (!pm.isNull() && pm.size() == size) @@ -176,10 +180,6 @@ QPixmap QSvgIconEngine::pixmap(const QSize &size, QIcon::Mode mode, if (!actualSize.isNull()) actualSize.scale(size, Qt::KeepAspectRatio); - QString pmckey(d->pmcKey(actualSize, mode, state)); - if (QPixmapCache::find(pmckey, pm)) - return pm; - QImage img(actualSize, QImage::Format_ARGB32_Premultiplied); img.fill(0x00000000); QPainter p(&img); diff --git a/src/plugins/qpluginbase.pri b/src/plugins/qpluginbase.pri index 446efab..ae39021 100644 --- a/src/plugins/qpluginbase.pri +++ b/src/plugins/qpluginbase.pri @@ -1,6 +1,6 @@ TEMPLATE = lib isEmpty(QT_MAJOR_VERSION) { - VERSION=4.5.1 + VERSION=4.5.2 } else { VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} } diff --git a/src/svg/qsvgstyle.cpp b/src/svg/qsvgstyle.cpp index b065395..bd0804c 100644 --- a/src/svg/qsvgstyle.cpp +++ b/src/svg/qsvgstyle.cpp @@ -808,6 +808,7 @@ void QSvgGradientStyle::resolveStops() static_cast<QSvgGradientStyle*>(prop); st->resolveStops(); m_gradient->setStops(st->qgradient()->stops()); + m_gradientStopsSet = st->gradientStopsSet(); } } m_link = QString(); diff --git a/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp b/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp index 4a17031..4da99da 100644 --- a/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp +++ b/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp @@ -534,16 +534,42 @@ void tst_QSvgRenderer::gradientStops() const QCOMPARE(image, refImage); } + const char *svgs[] = { + "<svg>" + "<defs>" + "<linearGradient id=\"gradient\">" + "<stop offset=\"0\" stop-color=\"red\" stop-opacity=\"0\"/>" + "<stop offset=\"1\" stop-color=\"blue\"/>" + "</linearGradient>" + "</defs>" + "<rect fill=\"url(#gradient)\" height=\"8\" width=\"256\" x=\"0\" y=\"0\"/>" + "</svg>", + "<svg>" + "<defs>" + "<linearGradient id=\"gradient\" xlink:href=\"#gradient0\">" + "</linearGradient>" + "<linearGradient id=\"gradient0\">" + "<stop offset=\"0\" stop-color=\"red\" stop-opacity=\"0\"/>" + "<stop offset=\"1\" stop-color=\"blue\"/>" + "</linearGradient>" + "</defs>" + "<rect fill=\"url(#gradient)\" height=\"8\" width=\"256\" x=\"0\" y=\"0\"/>" + "</svg>", + "<svg>" + "<defs>" + "<linearGradient id=\"gradient0\">" + "<stop offset=\"0\" stop-color=\"red\" stop-opacity=\"0\"/>" + "<stop offset=\"1\" stop-color=\"blue\"/>" + "</linearGradient>" + "<linearGradient id=\"gradient\" xlink:href=\"#gradient0\">" + "</linearGradient>" + "</defs>" + "<rect fill=\"url(#gradient)\" height=\"8\" width=\"256\" x=\"0\" y=\"0\"/>" + "</svg>" + }; + for (int i = 0 ; i < sizeof(svgs) / sizeof(svgs[0]) ; ++i) { - QByteArray data("<svg>" - "<defs>" - "<linearGradient id=\"gradient\">" - "<stop offset=\"0\" stop-color=\"red\" stop-opacity=\"0\"/>" - "<stop offset=\"1\" stop-color=\"blue\"/>" - "</linearGradient>" - "</defs>" - "<rect fill=\"url(#gradient)\" height=\"8\" width=\"256\" x=\"0\" y=\"0\"/>" - "</svg>"); + QByteArray data = svgs[i]; QSvgRenderer renderer(data); QImage image(256, 8, QImage::Format_ARGB32_Premultiplied); diff --git a/tools/assistant/tools/assistant/doc/assistant.qdocconf b/tools/assistant/tools/assistant/doc/assistant.qdocconf index f71bc08..aca97ed 100644 --- a/tools/assistant/tools/assistant/doc/assistant.qdocconf +++ b/tools/assistant/tools/assistant/doc/assistant.qdocconf @@ -12,5 +12,5 @@ HTML.footer = "<p /><address><hr /><div align=\"center\">\n" \ "<table width=\"100%\" cellspacing=\"0\" border=\"0\"><tr class=\"address\">\n" \ "<td width=\"30%\" align=\"left\">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies)</td>\n" \ "<td width=\"40%\" align=\"center\">Trademarks</td>\n" \ - "<td width=\"30%\" align=\"right\"><div align=\"right\">Qt 4.5.1</div></td>\n" \ + "<td width=\"30%\" align=\"right\"><div align=\"right\">Qt 4.5.2</div></td>\n" \ "</tr></table></div></address>" |