diff options
author | Joona Petrell <joona.t.petrell@nokia.com> | 2010-11-25 03:36:24 (GMT) |
---|---|---|
committer | Joona Petrell <joona.t.petrell@nokia.com> | 2010-11-25 03:40:29 (GMT) |
commit | 9e353ea7a1fedd020d39e83322286931f536dc16 (patch) | |
tree | a2452ef6c9166f9678c591f0274d15605bd0c133 /src/declarative | |
parent | 77d7cb79500cdb2ca277392ef5f7de79ec3e2823 (diff) | |
download | Qt-9e353ea7a1fedd020d39e83322286931f536dc16.zip Qt-9e353ea7a1fedd020d39e83322286931f536dc16.tar.gz Qt-9e353ea7a1fedd020d39e83322286931f536dc16.tar.bz2 |
End painting of Rectangle pixmap before inserting it to pixmap cache to avoid an unnecessary copy
Task-number: QTBUG-15534
Reviewed-by: Martin Jones
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativerectangle.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativerectangle.cpp b/src/declarative/graphicsitems/qdeclarativerectangle.cpp index 7686dde..dedb3f7 100644 --- a/src/declarative/graphicsitems/qdeclarativerectangle.cpp +++ b/src/declarative/graphicsitems/qdeclarativerectangle.cpp @@ -420,6 +420,10 @@ void QDeclarativeRectangle::generateRoundedRect() p.drawRoundedRect(QRectF(qreal(pw)/2+1, qreal(pw)/2+1, d->rectImage.width()-(pw+1), d->rectImage.height()-(pw+1)), d->radius, d->radius); else p.drawRoundedRect(QRectF(qreal(pw)/2, qreal(pw)/2, d->rectImage.width()-pw, d->rectImage.height()-pw), d->radius, d->radius); + + // end painting before inserting pixmap + // to pixmap cache to avoid a deep copy + p.end(); QPixmapCache::insert(key, d->rectImage); } } @@ -454,6 +458,10 @@ void QDeclarativeRectangle::generateBorderedRect() p.drawRect(QRectF(qreal(pw)/2+1, qreal(pw)/2+1, d->rectImage.width()-(pw+1), d->rectImage.height()-(pw+1))); else p.drawRect(QRectF(qreal(pw)/2, qreal(pw)/2, d->rectImage.width()-pw, d->rectImage.height()-pw)); + + // end painting before inserting pixmap + // to pixmap cache to avoid a deep copy + p.end(); QPixmapCache::insert(key, d->rectImage); } } |