diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-05-29 03:56:46 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-05-29 03:56:46 (GMT) |
commit | b189057d5105b3aae2049d2182ecfceb0399f041 (patch) | |
tree | 2745c01760617dbc9a9d211f412a54ccd262250a /src/declarative/fx/qfximage.cpp | |
parent | 2eb60d000f3666fc42ba2b7305ca52556497c86a (diff) | |
parent | 07929fef22cb9cffc059f949e216ec585e0e7466 (diff) | |
download | Qt-b189057d5105b3aae2049d2182ecfceb0399f041.zip Qt-b189057d5105b3aae2049d2182ecfceb0399f041.tar.gz Qt-b189057d5105b3aae2049d2182ecfceb0399f041.tar.bz2 |
Merge branch 'kinetic-declarativeui-pixmapopt' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative/fx/qfximage.cpp')
-rw-r--r-- | src/declarative/fx/qfximage.cpp | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/src/declarative/fx/qfximage.cpp b/src/declarative/fx/qfximage.cpp index 55aecd7..8f63a90 100644 --- a/src/declarative/fx/qfximage.cpp +++ b/src/declarative/fx/qfximage.cpp @@ -141,16 +141,15 @@ QFxImage::~QFxImage() QPixmap QFxImage::pixmap() const { Q_D(const QFxImage); - return d->_pix.pixmap(); + return d->_pix; } void QFxImage::setPixmap(const QPixmap &pix) { Q_D(QFxImage); d->url = QUrl(); - d->_pix.setPixmap(pix); + d->_pix = pix; d->_opaque=false; - d->_pix.setOpaque(false); setImplicitWidth(d->_pix.width()); setImplicitHeight(d->_pix.height()); @@ -255,7 +254,6 @@ void QFxImage::setOpaque(bool o) if (o == d->_opaque) return; d->_opaque = o; - d->_pix.setOpaque(o); update(); } @@ -326,21 +324,21 @@ void QFxImage::paintContents(QPainter &p) if (d->_smooth) p.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform, d->_smooth); - QSimpleCanvasConfig::Image pix = d->_pix; + QPixmap pix = d->_pix; if (d->_tiled) { p.save(); p.setClipRect(0, 0, width(), height(), Qt::IntersectClip); QRect me = QRect(0, 0, width(), height()); - int pw = d->_pix.width(); - int ph = d->_pix.height(); + int pw = pix.width(); + int ph = pix.height(); int yy = 0; while(yy < height()) { int xx = 0; while(xx < width()) { - p.drawImage(xx, yy, d->_pix); + p.drawPixmap(xx, yy, pix); xx += pw; } yy += ph; @@ -354,10 +352,10 @@ void QFxImage::paintContents(QPainter &p) height() / qreal(pix.height())); QTransform old = p.transform(); p.setWorldTransform(scale * old); - p.drawImage(0, 0, pix); + p.drawPixmap(0, 0, pix); p.setWorldTransform(old); } else { - p.drawImage(0, 0, pix); + p.drawPixmap(0, 0, pix); } } else { int sgl = d->_scaleGrid->left(); @@ -377,40 +375,40 @@ void QFxImage::paintContents(QPainter &p) // Upper left if (sgt && sgl) - p.drawImage(QRect(0, 0, sgl, sgt), pix, QRect(0, 0, sgl, sgt)); + p.drawPixmap(QRect(0, 0, sgl, sgt), pix, QRect(0, 0, sgl, sgt)); // Upper middle if (pix.width() - xSide && sgt) - p.drawImage(QRect(sgl, 0, w - xSide, sgt), pix, + p.drawPixmap(QRect(sgl, 0, w - xSide, sgt), pix, QRect(sgl, 0, pix.width() - xSide, sgt)); // Upper right if (sgt && pix.width() - sgr) - p.drawImage(QPoint(w-sgr, 0), pix, + p.drawPixmap(QPoint(w-sgr, 0), pix, QRect(pix.width()-sgr, 0, sgr, sgt)); // Middle left if (sgl && pix.height() - ySide) - p.drawImage(QRect(0, sgt, sgl, h - ySide), pix, + p.drawPixmap(QRect(0, sgt, sgl, h - ySide), pix, QRect(0, sgt, sgl, pix.height() - ySide)); // Middle if (pix.width() - xSide && pix.height() - ySide) - p.drawImage(QRect(sgl, sgt, w - xSide, h - ySide), + p.drawPixmap(QRect(sgl, sgt, w - xSide, h - ySide), pix, QRect(sgl, sgt, pix.width() - xSide, pix.height() - ySide)); // Middle right if (sgr && pix.height() - ySide) - p.drawImage(QRect(w-sgr, sgt, sgr, h - ySide), pix, + p.drawPixmap(QRect(w-sgr, sgt, sgr, h - ySide), pix, QRect(pix.width()-sgr, sgt, sgr, pix.height() - ySide)); // Lower left if (sgl && sgr) - p.drawImage(QPoint(0, h - sgb), pix, + p.drawPixmap(QPoint(0, h - sgb), pix, QRect(0, pix.height() - sgb, sgl, sgb)); // Lower Middle if (pix.width() - xSide && sgb) - p.drawImage(QRect(sgl, h - sgb, w - xSide, sgb), pix, + p.drawPixmap(QRect(sgl, h - sgb, w - xSide, sgb), pix, QRect(sgl, pix.height() - sgb, pix.width() - xSide, sgb)); // Lower Right if (sgr && sgb) - p.drawImage(QPoint(w-sgr, h - sgb), pix, + p.drawPixmap(QPoint(w-sgr, h - sgb), pix, QRect(pix.width()-sgr, pix.height() - sgb, sgr, sgb)); } @@ -945,7 +943,6 @@ void QFxImage::requestFinished() d->status = Error; } d->_pix = QFxPixmap(d->url); - d->_pix.setOpaque(d->_opaque); setOptions(QFxImage::SimpleItem, true); } setImplicitWidth(d->_pix.width()); |