diff options
author | Olivier Goffart <olivier.goffart@nokia.com> | 2011-01-25 17:56:33 (GMT) |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2011-01-25 17:56:33 (GMT) |
commit | 5422e929cad04633a06c156cba96cfcd69262522 (patch) | |
tree | afb3c9b76c05d80238a1ff76f4e8f4019fac1651 /src/openvg | |
parent | ac798c5d77c59ea8dfe29c9d1896fb6604e3a628 (diff) | |
parent | a0e0a9378d10db9c8ab3ba4d59f5c576ee4cbc40 (diff) | |
download | Qt-5422e929cad04633a06c156cba96cfcd69262522.zip Qt-5422e929cad04633a06c156cba96cfcd69262522.tar.gz Qt-5422e929cad04633a06c156cba96cfcd69262522.tar.bz2 |
Merge remote branch 'origin/4.7' into qt-master-from-4.7
Conflicts:
configure
src/network/bearer/bearer.pri
Diffstat (limited to 'src/openvg')
-rw-r--r-- | src/openvg/qpaintengine_vg.cpp | 10 | ||||
-rw-r--r-- | src/openvg/qpixmapdata_vg.cpp | 16 |
2 files changed, 17 insertions, 9 deletions
diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp index 09cbc36..a15f0c3 100644 --- a/src/openvg/qpaintengine_vg.cpp +++ b/src/openvg/qpaintengine_vg.cpp @@ -77,8 +77,8 @@ static const qreal aliasedCoordinateDelta = 0.5 - 0.015625; #if !defined(QVG_NO_DRAW_GLYPHS) -Q_DECL_IMPORT extern int qt_defaultDpiX(); -Q_DECL_IMPORT extern int qt_defaultDpiY(); +Q_GUI_EXPORT int qt_defaultDpiX(); +Q_GUI_EXPORT int qt_defaultDpiY(); class QVGPaintEnginePrivate; @@ -526,7 +526,7 @@ void QVGPaintEnginePrivate::setTransform vgLoadMatrix(mat); } -Q_DECL_IMPORT extern bool qt_scaleForTransform(const QTransform &transform, qreal *scale); +Q_GUI_EXPORT bool qt_scaleForTransform(const QTransform &transform, qreal *scale); void QVGPaintEnginePrivate::updateTransform(QPaintDevice *pdev) { @@ -994,7 +994,7 @@ VGPath QVGPaintEnginePrivate::roundedRectPath(const QRectF &rect, qreal xRadius, return vgpath; } -Q_DECL_IMPORT extern QImage qt_imageForBrush(int style, bool invert); +Q_GUI_EXPORT QImage qt_imageForBrush(int style, bool invert); static QImage colorizeBitmap(const QImage &image, const QColor &color) { @@ -1472,7 +1472,7 @@ void QVGPaintEnginePrivate::draw (VGPath path, const QPen& pen, const QBrush& brush, VGint rule) { VGbitfield mode = 0; - if (pen.style() != Qt::NoPen) { + if (qpen_style(pen) != Qt::NoPen && qbrush_style(qpen_brush(pen)) != Qt::NoBrush) { ensurePen(pen); mode |= VG_STROKE_PATH; } diff --git a/src/openvg/qpixmapdata_vg.cpp b/src/openvg/qpixmapdata_vg.cpp index 3f768fd..732b484 100644 --- a/src/openvg/qpixmapdata_vg.cpp +++ b/src/openvg/qpixmapdata_vg.cpp @@ -200,6 +200,9 @@ bool QVGPixmapData::fromData(const uchar *buffer, uint len, const char *format, return !isNull(); } +/*! + out-of-place conversion (inPlace == false) will always detach() + */ void QVGPixmapData::createPixmapForImage(QImage &image, Qt::ImageConversionFlags flags, bool inPlace) { if (image.size() == QSize(w, h)) @@ -216,11 +219,16 @@ void QVGPixmapData::createPixmapForImage(QImage &image, Qt::ImageConversionFlags else format = image.hasAlphaChannel() ? sourceFormat() : QImage::Format_RGB32; - if (inPlace && image.data_ptr()->convertInPlace(format, flags)) + if (inPlace && image.data_ptr()->convertInPlace(format, flags)) { source = image; - else + } else { source = image.convertToFormat(format); + // convertToFormat won't detach the image if format stays the same. + if (image.format() == format) + source.detach(); + } + recreate = true; } @@ -404,8 +412,8 @@ void QVGPixmapData::reclaimImages() destroyImages(); } -Q_DECL_IMPORT extern int qt_defaultDpiX(); -Q_DECL_IMPORT extern int qt_defaultDpiY(); +Q_GUI_EXPORT int qt_defaultDpiX(); +Q_GUI_EXPORT int qt_defaultDpiY(); int QVGPixmapData::metric(QPaintDevice::PaintDeviceMetric metric) const { |