diff options
-rw-r--r-- | src/qml/debugger/qqmlprofilerservice_p.h | 6 | ||||
-rw-r--r-- | src/quick/util/qquickpixmapcache.cpp | 8 |
2 files changed, 5 insertions, 9 deletions
diff --git a/src/qml/debugger/qqmlprofilerservice_p.h b/src/qml/debugger/qqmlprofilerservice_p.h index c2e9eb421a..5959a526bb 100644 --- a/src/qml/debugger/qqmlprofilerservice_p.h +++ b/src/qml/debugger/qqmlprofilerservice_p.h @@ -381,9 +381,9 @@ struct QQmlPixmapProfiler { QQmlProfilerService::instance->pixmapEventImpl(QQmlProfilerService::PixmapReferenceCountChanged, pixmapUrl, referenceCount); } } - void setSize(const QUrl &pixmapUrl, int width, int height) { - if (enabled) { - QQmlProfilerService::instance->pixmapEventImpl(QQmlProfilerService::PixmapSizeKnown, pixmapUrl, width, height); + void setSize(const QUrl &pixmapUrl, const QSize &size) { + if (enabled && size.width() > 0) { + QQmlProfilerService::instance->pixmapEventImpl(QQmlProfilerService::PixmapSizeKnown, pixmapUrl, size.width(), size.height()); } } diff --git a/src/quick/util/qquickpixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp index 5bab131ee6..16ed94f91f 100644 --- a/src/quick/util/qquickpixmapcache.cpp +++ b/src/quick/util/qquickpixmapcache.cpp @@ -900,8 +900,7 @@ bool QQuickPixmapReply::event(QEvent *event) pixmapProfiler.finishLoading(data->url); data->textureFactory = de->textureFactory; data->implicitSize = de->implicitSize; - if (data->implicitSize.width() > 0) - pixmapProfiler.setSize(url, data->implicitSize.width(), data->implicitSize.height()); + pixmapProfiler.setSize(url, data->requestSize.width() > 0 ? data->requestSize : data->implicitSize); } else { pixmapProfiler.errorLoading(data->url); data->errorString = de->errorString; @@ -971,8 +970,6 @@ void QQuickPixmapData::addToCache() inCache = true; QQmlPixmapProfiler pixmapProfiler; pixmapProfiler.cacheCountChanged(url, pixmapStore()->m_cache.count()); - if (implicitSize.width() > 0) - pixmapProfiler.setSize(url, implicitSize.width(), implicitSize.height()); } } @@ -1259,8 +1256,7 @@ void QQuickPixmap::load(QQmlEngine *engine, const QUrl &url, const QSize &reques d = createPixmapDataSync(this, engine, url, requestSize, &ok); if (ok) { pixmapProfiler.finishLoading(url); - if (d->implicitSize.width() > 0) - QQmlPixmapProfiler().setSize(url, d->implicitSize.width(), d->implicitSize.height()); + pixmapProfiler.setSize(url, d->requestSize.width() > 0 ? d->requestSize : d->implicitSize); if (options & QQuickPixmap::Cache) d->addToCache(); return; |