summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsitem.cpp26
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsitem_p.h2
-rw-r--r--src/openvg/qpaintengine_vg.cpp21
-rw-r--r--src/openvg/qpixmapdata_vg.cpp12
4 files changed, 25 insertions, 36 deletions
diff --git a/src/declarative/graphicsitems/qmlgraphicsitem.cpp b/src/declarative/graphicsitems/qmlgraphicsitem.cpp
index b03f359..8973cb4 100644
--- a/src/declarative/graphicsitems/qmlgraphicsitem.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsitem.cpp
@@ -119,7 +119,7 @@ QML_DEFINE_TYPE(Qt,4,6,Rotation,QGraphicsRotation)
/*!
\qmlproperty real Scale::xScale
- The scaling factor for the X axis.
+ The scaling factor for the X axis.
*/
/*!
@@ -1408,7 +1408,7 @@ QmlGraphicsKeysAttached *QmlGraphicsKeysAttached::qmlAttachedProperties(QObject
/*!
\fn void QmlGraphicsItem::widthChanged()
- \internal
+ \internal
*/
/*!
@@ -1443,7 +1443,7 @@ QmlGraphicsKeysAttached *QmlGraphicsKeysAttached::qmlAttachedProperties(QObject
// ### Must fix
struct RegisterAnchorLineAtStartup {
- RegisterAnchorLineAtStartup() {
+ RegisterAnchorLineAtStartup() {
qRegisterMetaType<QmlGraphicsAnchorLine>("QmlGraphicsAnchorLine");
}
};
@@ -1508,16 +1508,16 @@ QmlGraphicsItem::~QmlGraphicsItem()
\image declarative-transformorigin.png
- This example scales an image about its center.
+ This example rotates an image around its bottom-right corner.
\qml
Image {
source: "myimage.png"
- transformOrigin: Item.Center
- scale: 4
+ transformOrigin: Item.BottomRight
+ rotate: 45
}
\endqml
- The default transform origin is \c TopLeft.
+ The default transform origin is \c Center.
*/
/*!
@@ -2586,7 +2586,7 @@ void QmlGraphicsItem::setState(const QString &state)
/*!
\property QmlGraphicsItem::transform
- \internal
+ \internal
*/
/*! \internal */
@@ -2813,7 +2813,7 @@ void QmlGraphicsItem::setTransformOrigin(TransformOrigin origin)
smooth pixmap filtering, false otherwise.
The default is false.
-
+
\sa setSmooth()
*/
bool QmlGraphicsItem::smooth() const
@@ -3050,16 +3050,16 @@ QDebug operator<<(QDebug debug, QmlGraphicsItem *item)
}
int QmlGraphicsItemPrivate::consistentTime = -1;
-void QmlGraphicsItemPrivate::setConsistentTime(int t)
-{
- consistentTime = t;
+void QmlGraphicsItemPrivate::setConsistentTime(int t)
+{
+ consistentTime = t;
}
QTime QmlGraphicsItemPrivate::currentTime()
{
if (consistentTime == -1)
return QTime::currentTime();
- else
+ else
return QTime(0, 0).addMSecs(consistentTime);
}
diff --git a/src/declarative/graphicsitems/qmlgraphicsitem_p.h b/src/declarative/graphicsitems/qmlgraphicsitem_p.h
index 91d2119..1741808 100644
--- a/src/declarative/graphicsitems/qmlgraphicsitem_p.h
+++ b/src/declarative/graphicsitems/qmlgraphicsitem_p.h
@@ -110,7 +110,7 @@ public:
: _anchors(0), _contents(0),
_baselineOffset(0),
_anchorLines(0),
- _stateGroup(0), origin(QmlGraphicsItem::TopLeft),
+ _stateGroup(0), origin(QmlGraphicsItem::Center),
widthValid(false), heightValid(false),
_componentComplete(true), _keepMouse(false),
smooth(false), keyHandler(0),
diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp
index cc9ba77..923563b 100644
--- a/src/openvg/qpaintengine_vg.cpp
+++ b/src/openvg/qpaintengine_vg.cpp
@@ -978,7 +978,7 @@ static QImage colorizeBitmap(const QImage &image, const QColor &color)
int height = sourceImage.height();
int width = sourceImage.width();
for (int y=0; y<height; ++y) {
- uchar *source = sourceImage.scanLine(y);
+ const uchar *source = sourceImage.constScanLine(y);
QRgb *target = reinterpret_cast<QRgb *>(dest.scanLine(y));
for (int x=0; x < width; ++x)
target[x] = (source[x>>3] >> (x&7)) & 1 ? fg : bg;
@@ -986,9 +986,6 @@ static QImage colorizeBitmap(const QImage &image, const QColor &color)
return dest;
}
-// defined in qpixmapdata_vg.cpp.
-const uchar *qt_vg_imageBits(const QImage& image);
-
static VGImage toVGImage
(const QImage & image, Qt::ImageConversionFlags flags = Qt::AutoColor)
{
@@ -1022,7 +1019,7 @@ static VGImage toVGImage
break;
}
- const uchar *pixels = qt_vg_imageBits(img);
+ const uchar *pixels = img.constBits();
VGImage vgImg = QVGImagePool::instance()->createPermanentImage
(format, img.width(), img.height(), VG_IMAGE_QUALITY_FASTER);
@@ -1066,7 +1063,7 @@ static VGImage toVGImageSubRect
break;
}
- const uchar *pixels = qt_vg_imageBits(img) + bpp * sr.x() +
+ const uchar *pixels = img.constBits() + bpp * sr.x() +
img.bytesPerLine() * sr.y();
VGImage vgImg = QVGImagePool::instance()->createPermanentImage
@@ -1088,7 +1085,7 @@ static VGImage toVGImageWithOpacity(const QImage & image, qreal opacity)
painter.drawImage(0, 0, image);
painter.end();
- const uchar *pixels = qt_vg_imageBits(img);
+ const uchar *pixels = img.constBits();
VGImage vgImg = QVGImagePool::instance()->createPermanentImage
(VG_sARGB_8888_PRE, img.width(), img.height(), VG_IMAGE_QUALITY_FASTER);
@@ -1110,7 +1107,7 @@ static VGImage toVGImageWithOpacitySubRect
painter.drawImage(QPoint(0, 0), image, sr);
painter.end();
- const uchar *pixels = qt_vg_imageBits(img);
+ const uchar *pixels = img.constBits();
VGImage vgImg = QVGImagePool::instance()->createPermanentImage
(VG_sARGB_8888_PRE, img.width(), img.height(), VG_IMAGE_QUALITY_FASTER);
@@ -3175,15 +3172,15 @@ void QVGFontGlyphCache::cacheGlyphs
if (!scaledImage.isNull()) { // Not a space character
if (scaledImage.format() == QImage::Format_Indexed8) {
vgImage = vgCreateImage(VG_A_8, scaledImage.width(), scaledImage.height(), VG_IMAGE_QUALITY_FASTER);
- vgImageSubData(vgImage, qt_vg_imageBits(scaledImage), scaledImage.bytesPerLine(), VG_A_8, 0, 0, scaledImage.width(), scaledImage.height());
+ vgImageSubData(vgImage, scaledImage.constBits(), scaledImage.bytesPerLine(), VG_A_8, 0, 0, scaledImage.width(), scaledImage.height());
} else if (scaledImage.format() == QImage::Format_Mono) {
QImage img = scaledImage.convertToFormat(QImage::Format_Indexed8);
vgImage = vgCreateImage(VG_A_8, img.width(), img.height(), VG_IMAGE_QUALITY_FASTER);
- vgImageSubData(vgImage, qt_vg_imageBits(img), img.bytesPerLine(), VG_A_8, 0, 0, img.width(), img.height());
+ vgImageSubData(vgImage, img.constBits(), img.bytesPerLine(), VG_A_8, 0, 0, img.width(), img.height());
} else {
QImage img = scaledImage.convertToFormat(QImage::Format_ARGB32_Premultiplied);
vgImage = vgCreateImage(VG_sARGB_8888_PRE, img.width(), img.height(), VG_IMAGE_QUALITY_FASTER);
- vgImageSubData(vgImage, qt_vg_imageBits(img), img.bytesPerLine(), VG_sARGB_8888_PRE, 0, 0, img.width(), img.height());
+ vgImageSubData(vgImage, img.constBits(), img.bytesPerLine(), VG_sARGB_8888_PRE, 0, 0, img.width(), img.height());
}
}
origin[0] = -metrics.x.toReal() + 0.5f;
@@ -3650,7 +3647,7 @@ void QVGCompositionHelper::drawCursorPixmap
if (vgImage == VG_INVALID_HANDLE)
return;
vgImageSubData
- (vgImage, qt_vg_imageBits(img) + img.bytesPerLine() * (img.height() - 1),
+ (vgImage, img.constBits() + img.bytesPerLine() * (img.height() - 1),
-(img.bytesPerLine()), VG_sARGB_8888_PRE, 0, 0,
img.width(), img.height());
diff --git a/src/openvg/qpixmapdata_vg.cpp b/src/openvg/qpixmapdata_vg.cpp
index 3087b77..44814cc 100644
--- a/src/openvg/qpixmapdata_vg.cpp
+++ b/src/openvg/qpixmapdata_vg.cpp
@@ -231,14 +231,6 @@ QPaintEngine* QVGPixmapData::paintEngine() const
return source.paintEngine();
}
-// This function works around QImage::bits() making a deep copy if the
-// QImage is not const. We force it to be const and then get the bits.
-// XXX: Should add a QImage::constBits() in the future to replace this.
-const uchar *qt_vg_imageBits(const QImage& image)
-{
- return image.bits();
-}
-
VGImage QVGPixmapData::toVGImage()
{
if (!isValid())
@@ -271,7 +263,7 @@ VGImage QVGPixmapData::toVGImage()
if (!source.isNull() && recreate) {
vgImageSubData
(vgImage,
- qt_vg_imageBits(source), source.bytesPerLine(),
+ source.constBits(), source.bytesPerLine(),
VG_sARGB_8888_PRE, 0, 0, w, h);
}
@@ -670,7 +662,7 @@ void* QVGPixmapData::toNativeType(NativeType type)
if (bitmap) {
if (bitmap->Create(TSize(source.width(), source.height()),
EColor16MAP) == KErrNone) {
- const uchar *sptr = qt_vg_imageBits(source);
+ const uchar *sptr = source.constBits();
bitmap->BeginDataAccess();
uchar *dptr = (uchar*)bitmap->DataAddress();