<table><tr><td style="">hein created this revision.<br />hein added reviewers: Plasma, davidedmundson, broulik.<br />Restricted Application added projects: Plasma, Frameworks.<br />Restricted Application added a subscriber: Frameworks.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D9119" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>Plasma::Svg initializes SvgPrivate::scaleFactor to 1.0. On systems with<br />
a higher value for Units:devicePixelRatio, that means Svg::setScaleFactor<br />
gets called with a different value right after instanciation and a fair<br />
amount of work is done twice.</p>

<p>This patch introduces a static SvgPrivate::s_lastScaleFactor,<br />
initialized to 1.0 but updated in Svg::setScaleFactor.<br />
SvgPrivate::scaleFactor is then initialized to the static every time<br />
its instanciated. That means after the first time Svg::setScaleFactor<br />
is called with e.g. 2.0, subsequent Svg instances get initialized<br />
with 2.0.</p>

<p>This ends up shaving a decent amount of time off of startup on scaled<br />
systems.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R242 Plasma Framework (Library)</div></div></div><br /><div><strong>BRANCH</strong><div><div>master</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D9119" rel="noreferrer">https://phabricator.kde.org/D9119</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/plasma/private/svg_p.h<br />
src/plasma/svg.cpp</div></div></div><br /><div><strong>To: </strong>hein, Plasma, davidedmundson, broulik<br /><strong>Cc: </strong>plasma-devel, Frameworks, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart<br /></div>