hein created this revision. hein added reviewers: Plasma, davidedmundson, broulik. Restricted Application added projects: Plasma, Frameworks. Restricted Application added a subscriber: Frameworks.
REVISION SUMMARY Plasma::Svg initializes SvgPrivate::scaleFactor to 1.0. On systems with a higher value for Units:devicePixelRatio, that means Svg::setScaleFactor gets called with a different value right after instanciation and a fair amount of work is done twice. This patch introduces a static SvgPrivate::s_lastScaleFactor, initialized to 1.0 but updated in Svg::setScaleFactor. SvgPrivate::scaleFactor is then initialized to the static every time its instanciated. That means after the first time Svg::setScaleFactor is called with e.g. 2.0, subsequent Svg instances get initialized with 2.0. This ends up shaving a decent amount of time off of startup on scaled systems. REPOSITORY R242 Plasma Framework (Library) BRANCH master REVISION DETAIL https://phabricator.kde.org/D9119 AFFECTED FILES src/plasma/private/svg_p.h src/plasma/svg.cpp To: hein, #plasma, davidedmundson, broulik Cc: plasma-devel, #frameworks, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart