From 3297ccddf5f5234de5691f073507a5d88ccfeb04 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 6 Dec 2013 13:57:36 +0100 Subject: Correctly profile the size of loaded pixmaps Only set the sizes when they're known, prefer request size to implicit size (as the request size is what ends up in the cache), and don't set the size twice. Task-number: QTBUG-35337 Change-Id: Ie516a1cae2d9050f61362ee99cf8a6a9dd8ea3bb Reviewed-by: Gunnar Sletta --- src/qml/debugger/qqmlprofilerservice_p.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/qml/debugger') 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()); } } -- cgit v1.2.3