Merge lp:~3v1n0/unity/massif-textures-sharing into lp:unity
Status: | Merged |
---|---|
Approved by: | Brandon Schaefer |
Approved revision: | no longer in the source branch. |
Merged at revision: | 3289 |
Proposed branch: | lp:~3v1n0/unity/massif-textures-sharing |
Merge into: | lp:unity |
Diff against target: |
672 lines (+133/-150) 12 files modified
launcher/Launcher.cpp (+2/-6) panel/PanelView.cpp (+21/-24) panel/PanelView.h (+1/-1) plugins/unityshell/src/unityshell.cpp (+32/-53) plugins/unityshell/src/unityshell.h (+2/-6) tests/test_texture_cache.cpp (+3/-3) unity-shared/DashStyle.cpp (+3/-13) unity-shared/PanelStyle.cpp (+41/-19) unity-shared/PanelStyle.h (+2/-1) unity-shared/TextureCache.cpp (+17/-18) unity-shared/TextureCache.h (+6/-4) unity-shared/WindowButtons.cpp (+3/-2) |
To merge this branch: | bzr merge lp:~3v1n0/unity/massif-textures-sharing |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Brandon Schaefer (community) | Approve | ||
Review via email: mp+157774@code.launchpad.net |
Commit message
Unity: share textures whenever possible, optimize memory usage.
And some code improvements in TextureCache, PanelStyle, PanelView and unityshell
Description of the change
I've run unity under valgrind's massif, and I've noticed (as expected) that the most of the unity memory is used by textures. However, massif also underlined that we were allocating some resources many times (especially when in multi-monitor).
So, I've moved many components to use TextureCache, including PanelView, DashStyle, WindowButtons.
Improved a little the code of TextureCache that now has a default factory function to fetch textures from the default unity location.
Improvements in the PanelView background texture (that was used also by unityshell to paint the "fake" panel under the dash, in case of maximized windows): before we were generating real-size textures (and in case of unityshell big as the entire screen, a problem especially in case of multi-monitor), now we only generate 1x24 px texture that is repeated when drawing.
A not-scientific comparison of massif: http://
In that tests I've ran unity for 5 minutes in my machine performing some basic unity operations using AP tests. It underlines ~5MB saving, it won't change the world but it's still a win! :)
494 glib::Object< GtkStyleContext > _style_context; GSettings> _gsettings;
495 glib::Object<
496 + BaseTexturePtr _bg_texture;
497 std::string _theme_name;
498 nux::Color _text_color;
Someday the naming of these variables will have to be fixed :)