D9119: Initialize scale factor to the last scale factor set on any instance

Eike Hein noreply at phabricator.kde.org
Sat Dec 2 22:18:20 UTC 2017


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20171202/e9513462/attachment-0001.html>


More information about the Plasma-devel mailing list