QQuickImageBase: Use QUrl::path() instead of QUrl::toString().
authorRobin Burchell <robin.burchell@viroteck.net>
Fri, 26 Jun 2015 09:56:05 +0000 (11:56 +0200)
committerRobin Burchell <robin.burchell@viroteck.net>
Wed, 19 Aug 2015 22:29:26 +0000 (22:29 +0000)
This copies less data, which is faster. Increases creation/delegates_image from
560 ops/frame to 600 ops/frame for me.

Change-Id: I9c230bb9fa82fd631020881fb741857285589bca
Suggested-by: Michael Brasser <michael.brasser@live.com>
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
src/quick/items/qquickimagebase.cpp

index e54f5bb..1ad37ef 100644 (file)
@@ -222,7 +222,7 @@ void QQuickImageBase::load()
             if (loadUrl.scheme() == QStringLiteral("image")) {
                 setDevicePixelRatio = true;
             } else {
-                QString stringUrl = loadUrl.toString();
+                QString stringUrl = loadUrl.path(QUrl::PrettyDecoded);
                 if (stringUrl.endsWith(QLatin1String("svg")) ||
                     stringUrl.endsWith(QLatin1String("svgz"))) {
                     setDevicePixelRatio = true;