QQuickCanvas renames
[profile/ivi/qtdeclarative.git] / src / quick / items / qquickimage.cpp
index 64c8ba1..4279e27 100644 (file)
@@ -63,10 +63,6 @@ public:
     }
 
     QSGTexture *texture() const {
-
-        if (m_texture && m_texture->isAtlasTexture())
-            const_cast<QQuickImageTextureProvider *>(this)->m_texture = m_texture->removedFromAtlas();
-
         if (m_texture) {
             m_texture->setFiltering(m_smooth ? QSGTexture::Linear : QSGTexture::Nearest);
             m_texture->setMipmapFiltering(QSGTexture::Nearest);
@@ -98,29 +94,29 @@ QQuickImagePrivate::QQuickImagePrivate()
 /*!
     \qmlclass Image QQuickImage
     \inqmlmodule QtQuick 2
-    \ingroup qml-basic-visual-elements
-    \brief The Image element displays an image in a declarative user interface
+    \ingroup qtquick-visual
     \inherits Item
+    \brief Displays an image
 
-    The Image element is used to display images in a declarative user interface.
+    The Image type display an image.
 
     The source of the image is specified as a URL using the \l source property.
     Images can be supplied in any of the standard image formats supported by Qt,
     including bitmap formats such as PNG and JPEG, and vector graphics formats
-    such as SVG. If you need to display animated images, use the \l AnimatedImage
-    element.
+    such as SVG. If you need to display animated images, use \l AnimatedSprite
+    or \l AnimatedImage.
 
     If the \l{Item::width}{width} and \l{Item::height}{height} properties are not
-    specified, the Image element automatically uses the size of the loaded image.
-    By default, specifying the width and height of the element causes the image
+    specified, the Image automatically uses the size of the loaded image.
+    By default, specifying the width and height of the item causes the image
     to be scaled to that size. This behavior can be changed by setting the
     \l fillMode property, allowing the image to be stretched and tiled instead.
 
     \section1 Example Usage
 
-    The following example shows the simplest usage of the Image element.
+    The following example shows the simplest usage of the Image type.
 
-    \snippet doc/src/snippets/qml/image.qml document
+    \snippet qml/image.qml document
 
     \beginfloatleft
     \image declarative-qtlogo.png
@@ -139,7 +135,7 @@ QQuickImagePrivate::QQuickImagePrivate()
     automatically loaded asynchronously, and the \l progress and \l status properties
     are updated as appropriate.
 
-    Images are cached and shared internally, so if several Image elements have the same \l source,
+    Images are cached and shared internally, so if several Image items have the same \l source,
     only one copy of the image will be loaded.
 
     \b Note: Images are often the greatest user of memory in QML user interfaces.  It is recommended
@@ -269,7 +265,7 @@ void QQuickImagePrivate::setImage(const QImage &image)
 
     \endtable
 
-    Note that \c clip is \c false by default which means that the element might
+    Note that \c clip is \c false by default which means that the item might
     paint outside its bounding rectangle even if the fillMode is set to \c PreserveAspectCrop.
 
     \sa {declarative/imageelements/image}{Image example}
@@ -300,7 +296,7 @@ void QQuickImage::setFillMode(FillMode mode)
     In most cases it is the same as \c width and \c height, but when using a
     \c fillMode \c PreserveAspectFit or \c fillMode \c PreserveAspectCrop
     \c paintedWidth or \c paintedHeight can be smaller or larger than
-    \c width and \c height of the Image element.
+    \c width and \c height of the Image item.
 */
 qreal QQuickImage::paintedWidth() const
 {
@@ -540,7 +536,7 @@ QSGTextureProvider *QQuickImage::textureProvider() const
     Q_D(const QQuickImage);
     if (!d->provider) {
         // Make sure it gets thread affinity on the rendering thread so deletion works properly..
-        Q_ASSERT_X(d->canvas
+        Q_ASSERT_X(d->window
                    && d->sceneGraphContext()
                    && QThread::currentThread() == d->sceneGraphContext()->thread(),
                    "QQuickImage::textureProvider",
@@ -548,7 +544,7 @@ QSGTextureProvider *QQuickImage::textureProvider() const
         QQuickImagePrivate *dd = const_cast<QQuickImagePrivate *>(d);
         dd->provider = new QQuickImageTextureProvider;
         dd->provider->m_smooth = d->smooth;
-        dd->provider->m_texture = d->sceneGraphContext()->textureForFactory(d->pix.textureFactory(), canvas());
+        dd->provider->m_texture = d->sceneGraphContext()->textureForFactory(d->pix.textureFactory(), window());
     }
 
     return d->provider;
@@ -558,7 +554,7 @@ QSGNode *QQuickImage::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *)
 {
     Q_D(QQuickImage);
 
-    QSGTexture *texture = d->sceneGraphContext()->textureForFactory(d->pix.textureFactory(), canvas());
+    QSGTexture *texture = d->sceneGraphContext()->textureForFactory(d->pix.textureFactory(), window());
 
     // Copy over the current texture state into the texture provider...
     if (d->provider) {
@@ -678,18 +674,15 @@ QSGNode *QQuickImage::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *)
                   sourceRect.width() / d->pix.width(),
                   sourceRect.height() / d->pix.height());
 
-    if (d->mirror) {
-        qreal oldLeft = nsrect.left();
-        nsrect.setLeft(nsrect.right());
-        nsrect.setRight(oldLeft);
-    }
-
     node->setHorizontalWrapMode(hWrap);
     node->setVerticalWrapMode(vWrap);
     node->setFiltering(d->smooth ? QSGTexture::Linear : QSGTexture::Nearest);
 
     node->setTargetRect(targetRect);
-    node->setSourceRect(nsrect);
+    node->setInnerTargetRect(targetRect);
+    node->setSubSourceRect(nsrect);
+    node->setMirror(d->mirror);
+    node->setAntialiasing(d->antialiasing);
     node->update();
 
     return node;