Merge lp:~smspillaz/unity/unity.fix_1016789 into lp:unity

Proposed by Sam Spilsbury
Status: Merged
Approved by: Daniel van Vugt
Approved revision: no longer in the source branch.
Merged at revision: 2497
Proposed branch: lp:~smspillaz/unity/unity.fix_1016789
Merge into: lp:unity
Diff against target: 21 lines (+2/-2)
1 file modified
plugins/unityshell/src/unityshell.cpp (+2/-2)
To merge this branch: bzr merge lp:~smspillaz/unity/unity.fix_1016789
Reviewer Review Type Date Requested Status
Daniel van Vugt Approve
Sam Spilsbury (community) Abstain
jenkins (community) continuous-integration Approve
Review via email: mp+111704@code.launchpad.net

Commit message

Scale the generated fbo tex by the screen dimentions as its screen size
and ensure nux sets the reference viewport back to output size.

(LP: #1016789)

Description of the change

== Problem ==
See (LP: #1016789)

Output from the scratch fbo is scaled incorrectly in the multimonitor case when the items in question are above the shell - in this case, by a factor of screen size / output size. And also incorrectly in the blurs too, by the inverse. (built using USE_MODERN_COMPIZ_GL)

== Solution ==
Scale the generated fbo tex by the screen dimentions as its screen size
and ensure nux sets the reference viewport back to output size.

== Test ==
There is ongoing work to get the paint code under unit test (see lp:~smspillaz/unity/unity.less-paint-insanity). Until that's done, duplicating that here would effectively be redundant and as such there are no unit tests.

This work can be verified simply through manual testing the branch and ensuring blur and windows are "normally" scaled.

== Errata ==
When building lp:unity, I noticed that there are tons of very unrelated linker errors generated when turning USE_MODERN_COMPIZ_GL on. For some reason, when replacing those with the appropriate #if 1 / #if 0, they all went away. This needs to be looked into.

To post a comment you must log in.
Revision history for this message
jenkins (martin-mrazik+qa) wrote :

PASSED: Continuous integration, rev:2439
http://s-jenkins:8080/job/unity-ci/5/

review: Approve (continuous-integration)
Revision history for this message
Sam Spilsbury (smspillaz) :
review: Abstain
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Why is the first part for the whole screen (all outputs) but the second part for a single output (oGeo)? Looks like one of the chunks might be wrong.

review: Needs Information
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

> Why is the first part for the whole screen (all outputs) but the second part
> for a single output (oGeo)? Looks like one of the chunks might be wrong.

The second argument to SetReferenceFramebuffer is the viewport dimentions. The viewport dimentions need to be reset to the size of the output.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

So long as it's not a mistake then all good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/unityshell/src/unityshell.cpp'
2--- plugins/unityshell/src/unityshell.cpp 2012-06-15 02:03:31 +0000
3+++ plugins/unityshell/src/unityshell.cpp 2012-06-23 02:27:19 +0000
4@@ -799,7 +799,7 @@
5 #else
6 nux::ObjectPtr<nux::IOpenGLTexture2D> device_texture =
7 nux::GetGraphicsDisplay()->GetGpuDevice()->CreateTexture2DFromID(gScreen->fbo ()->tex ()->name (),
8- output->width(), output->height(), 1, nux::BITFMT_R8G8B8A8);
9+ screen->width(), screen->height(), 1, nux::BITFMT_R8G8B8A8);
10 #endif
11
12 nux::GetGraphicsDisplay()->GetGpuDevice()->backup_texture0_ = device_texture;
13@@ -812,7 +812,7 @@
14 GLint fboID;
15 // Nux renders to the referenceFramebuffer when it's embedded.
16 glGetIntegerv(GL_FRAMEBUFFER_BINDING, &fboID);
17- wt->GetWindowCompositor().SetReferenceFramebuffer(fboID, geo);
18+ wt->GetWindowCompositor().SetReferenceFramebuffer(fboID, oGeo);
19 #endif
20
21 nuxPrologue();