Merge lp://staging/~dbarth/unity-2d/defer-composite into lp://staging/unity-2d

Proposed by David Barth
Status: Merged
Approved by: Gerry Boland
Approved revision: 1162
Merged at revision: 1157
Proposed branch: lp://staging/~dbarth/unity-2d/defer-composite
Merge into: lp://staging/unity-2d
Diff against target: 380 lines (+202/-52)
10 files modified
config.h.in (+6/-0)
data/com.canonical.Unity2d.gschema.xml (+9/-0)
libunity-2d-private/src/CMakeLists.txt (+1/-0)
libunity-2d-private/src/compositorhelper.cpp (+106/-0)
libunity-2d-private/src/compositorhelper.h (+43/-0)
libunity-2d-private/src/windowimageprovider.cpp (+1/-50)
libunity-2d-private/src/windowimageprovider.h (+0/-1)
spread/Workspaces.qml (+2/-0)
spread/app/spreadview.cpp (+31/-0)
spread/app/spreadview.h (+3/-1)
To merge this branch: bzr merge lp://staging/~dbarth/unity-2d/defer-composite
Reviewer Review Type Date Requested Status
Gerry Boland (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+157602@code.staging.launchpad.net

Commit message

Add an option to adjust the use of the composite extension to generate window previews for the spread.

Enable the 'jit-composite' in com.canonical.Unity2d.Spread to use the composite mode just-in-time.

By default this option is set to false, to keep the same behaviour as before. This maintains window previews continuously, with the advantage of an immediate availability when the spread feature is called and displayed. The disadvantage is that memory usage is higher in the X server and can result in sub-optimal performances on low-end systems.

Turn the option to true on low-end systems where memory is limited and/or the video driver is less performant.

Description of the change

1. defer the activation of the composite mode; this way, windows are not redirected until necessary, saving resources on the server side
2. only activate composite for the parent window of the window previews requested (in practice this is the root window, I couldn't make that better)
3. activate compositing on all root and screens only if the workspace switcher view is requested
4. deactivate compositing after 5s, hopefully when the spread effect is already displayed; again saving resources on the server side

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:1157
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~dbarth/unity-2d/defer-composite/+merge/157602/+edit-commit-message

http://s-jenkins:8080/job/unity-2d-ci/31/
Executed test runs:
    SUCCESS: http://s-jenkins:8080/job/unity-2d-ci/./distribution=precise,flavor=amd64/31
    SUCCESS: http://s-jenkins:8080/job/unity-2d-ci/./distribution=precise,flavor=i386/31

Click here to trigger a rebuild:
http://s-jenkins:8080/job/unity-2d-ci/31/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Gerry Boland (gerboland) wrote :

Functional testing underway, but I notice in your code you are mixing tabs & spaces. Please set your editor to use 4spaces instead of a tab, and apply that change to this MR.

review: Needs Fixing
Revision history for this message
David Barth (dbarth) wrote :

I just pushed a new rev. to fix the indention issues

Revision history for this message
Gerry Boland (gerboland) wrote :

I think you forgot to push!

What concerns me about this change is you are adding the deferred-composite mode for all unity-2d users. I need to test natively, but I suspect this adds a spread activation slowdown for those users.

What I'd prefer is adding an option to unity-2d for this deferred-composite mode - an option which is usually disabled. The normal always-on-composite should remain the default. This will effectively leave an unchanged code-path for the majority of the unity-2d users, considerably reducing the risk of breakage.

Enabling the deferred-composite mode then is only done when necessary and can be tested carefully.

I'm also not a fan of activating compositing in requestImage, and disabling after a 5 second timeout. Makes more sense to activate it before spread starts to show, and disable it immediately after the window images have all been retrieved (but re-enable if window appears while spread open). Slightly easier would be this but to disable when the spread starts to hide. You should look into spread/Workspaces.qml, the show() and cancelAndExit() functions especially.

Some comments on the code:
CompositorHelper should be a singleton class.

+/* Do NOT activate the composite mode: this disables live windows previews,
+ as used in the spread and workspace switcher views
+*/
+#define DISABLE_COMPOSITE_MODE 0
The comment confuses me, and I'm not convinced why this #define is needed here. It also confuses the API of CompositorHelper if turned on, as x11supportsComposite will be true, but activateComposite() will silently do nothing. Please rethink this, at least having activateComposite returning a bool showing success/failure.

+++ libunity-2d-private/src/windowimageprovider.h
+ static bool activateComposite(Window windowId);
This function is not defined in the class.

review: Needs Fixing
1158. By David Barth

hopefully fix indention issues

1159. By David Barth

configuration option added; integration of the composite optimization in the spread and qml layer; changed helper to proper singleton

Revision history for this message
David Barth (dbarth) wrote :

Here is a new version with:
- a configuration option for the feature
- integration within the stricter scope of the spread feature
- adjusted at the qml level
- with a proper singleton implementation

In short, less of a hack ;)

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:1159
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~dbarth/unity-2d/defer-composite/+merge/157602/+edit-commit-message

http://s-jenkins:8080/job/unity-2d-ci/32/
Executed test runs:
    FAILURE: http://s-jenkins:8080/job/unity-2d-ci/./distribution=precise,flavor=amd64/32/console
    FAILURE: http://s-jenkins:8080/job/unity-2d-ci/./distribution=precise,flavor=i386/32/console

Click here to trigger a rebuild:
http://s-jenkins:8080/job/unity-2d-ci/32/rebuild

review: Needs Fixing (continuous-integration)
1160. By David Barth

indention fixes

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Gerry Boland (gerboland) wrote :

Compile error:
spread/app/spreadview.cpp: In constructor ‘SpreadView::SpreadView(int)’:
spread/app/spreadview.cpp:37:47: error: ‘spread2dConfiguration’ was not declared in this scope
spread/app/spreadview.cpp: In member function ‘void SpreadView::unloadPreviews()’:
spread/app/spreadview.cpp:70:47: error: ‘spread2dConfiguration’ was not declared in this scope

+#include <QTimer>
not needed any more.

+++ libunity-2d-private/src/compositorhelper.h
You have some indentation problems in this header file.

+++ libunity-2d-private/src/windowimageprovider.h
+ static bool activateComposite(Window windowId);
As before, this is not defined, nor needed.

+++ spread/app/spreadview.h
You're not using the previewsAvailable property anywhere, so do you need it at all?

You remove the blank line at the end of the file, please restore.

Logic looks fine, but compile error means I cannot test.

review: Needs Fixing
1161. By David Barth

missing schema accessor spread2Configuration

1162. By David Barth

fix more indentation issues and remove unused code

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Gerry Boland (gerboland) wrote :

Functionally is working perfectly, very good.

Code is fine now too, approving

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches