give frameSvg the concept of repaintBlocked(), that enables and
disables the regeneration of the frame data when a property is set.
the use case is when often, a lot of properties are set one after
the other (such as prefix, enabled borders, size)
collapse the formely similar, but a bit different logic of frame
regeneration is a single function for better maintanability.
QML FrameSvgItem sets repaintblocked when it starts and releases it just on oncomponentCompleted
Details
- Reviewers
- None
- Group Reviewers
Plasma - Commits
- R242:d8a1a9eb084b: don't regenerate frames when setting every property
plasmashell still starts, autotests still work, all frames are rendered correctly
the destruction of old frames is cutted by 50%. in the qml profiler
the creation time of a framesvgitem slightly improved, on this machine from around 26 msecs to around 21, can still be improved, but at least the code is a bit simpler
Diff Detail
- Repository
- R242 Plasma Framework (Library)
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
src/plasma/framesvg.cpp | ||
---|---|---|
135–136 | I'm lost on why we have the pendingEnabledBorders you have some bugs if you do: setRepaintBlocked(false); it'll get updated later but after the changed signal on the FrameSvgItem. Do we need to know the old borders when we update? If so can we revert this logic to have a d->oldBorders that gets set at the end of the update method? |
src/plasma/framesvg.cpp | ||
---|---|---|
135–136 | it has pendingEnabledBorders because right now the borders are saved only n the frame, that we don't know if we can keep it or we'll have to throw it away ( or just dereference because some other framesvg instance still needs it) |
src/plasma/framesvg.cpp | ||
---|---|---|
135–136 | That part makes sense now. We still need to do something, otherwise if I have a Binding on a FrameSVGItem it's going to be broken. I think we can just return d->pendingEnabledBorders rather than frame->enabledBorders (possibly renaming it) the frame will never be different and it solves that problem simply. |
I now get tons of binding loop errors from FrameSvgItem, it also breaks delegates in networkmanager and bluetooth applets. On the screenshot you can see that the last 3 delegates (HUAWEI, UPC and Internet) are slightly moved to the left and hovering over them will correctly align them (as are the first 2 delegates on the screenshot).
I have Qt 5.8.