Merge lp:~vanvugt/compiz/fix-1028809 into lp:compiz/0.9.9

Proposed by Daniel van Vugt
Status: Merged
Approved by: Sam Spilsbury
Approved revision: 3480
Merged at revision: 3479
Proposed branch: lp:~vanvugt/compiz/fix-1028809
Merge into: lp:compiz/0.9.9
Diff against target: 76 lines (+15/-14)
3 files modified
plugins/obs/obs.xml.in (+0/-1)
plugins/obs/src/obs.cpp (+11/-11)
plugins/obs/src/obs.h (+4/-2)
To merge this branch: bzr merge lp:~vanvugt/compiz/fix-1028809
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Sam Spilsbury Approve
Daniel van Vugt Abstain
Review via email: mp+135329@code.launchpad.net

Commit message

Move opacity/brightness/saturation setting from glDraw into glDrawTexture
where it won't care about the plugin load order relative to decor any more.
This ensures the obs setting will always apply to the whole window including
decorations (LP: #1028809)

To post a comment you must log in.
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I think the primary cause of this regression can be seen in r3320 (GLES merge). The glDraw parameters got const'ified properly, so obs could no longer modify the global window paint attrib and could only pass its changes down the call chain. So it became more sensitive to the plugin load order.

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

It might be better to wrap glDrawTexture here and apply the opacity, brightness and saturation in the GLWindowPaintAttrib.

That will be guaranteed to run on every texture that is drawn for some window, unless the plugin short circuits glDrawTexture, which they usually never do.

I'm just noting the comment here:

42 -/* Note: Normally plugins should wrap into glPaintWindow to modify opacity,
43 - brightness and saturation. As some plugins bypass glPaintWindow when
44 - they draw windows and our custom values always need to be applied,
45 - we wrap into glDrawWindow here */

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

I think it's more correct (and efficient) to only set the o/b/s of a window once per plugin per frame. That means in glPaint whereas glDrawTexture would do it many times per window per frame.

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

I agree, but the problem is that as the comment above said, plugins
can just unintentionally bypass the o/b/s settings.

Unless that's not an issue?

On Wed, Nov 21, 2012 at 4:55 PM, Daniel van Vugt
<email address hidden> wrote:
> I think it's more correct (and efficient) to only set the o/b/s of a window once per plugin per frame. That means in glPaint whereas glDrawTexture would do it many times per window per frame.
> --
> https://code.launchpad.net/~vanvugt/compiz/fix-1028809/+merge/135329
> Your team Compiz Maintainers is requested to review the proposed merge of lp:~vanvugt/compiz/fix-1028809 into lp:compiz.

--
Sam Spilsbury

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

That comment is old and I'm not yet aware of any use case where it applies any more. Certainly I would not move the o/b/s setting into DrawTexture unless I really-really had to. It gets called too many times per frame.

Maybe as part of this review we should all test for plugins where o/b/s used to work and doesn't any more. If no one can find a combination that's broken then it's probably not an issue.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

The only ones would be switcher, staticswitcher, shift, ring.

Those call glDraw directly, so the o/b/s settings won't be applied to
those previews.

On Wed, Nov 21, 2012 at 5:32 PM, Daniel van Vugt
<email address hidden> wrote:
> That comment is old and I'm not yet aware of any use case where it applies any more. Certainly I would not move the o/b/s setting into DrawTexture unless I really-really had to. It gets called too many times per frame.
>
> Maybe as part of this review we should all test for plugins where o/b/s used to work and doesn't any more. If no one can find a combination that's broken then it's probably not an issue.
> --
> https://code.launchpad.net/~vanvugt/compiz/fix-1028809/+merge/135329
> Your team Compiz Maintainers is requested to review the proposed merge of lp:~vanvugt/compiz/fix-1028809 into lp:compiz.

--
Sam Spilsbury

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

Confirmed regressions in switcher and staticswitcher.

shift and ring still work fine.

review: Needs Fixing
lp:~vanvugt/compiz/fix-1028809 updated
3479. By Daniel van Vugt

Revert previous revision. Needs a better approach.

3480. By Daniel van Vugt

Same fix as before but now in glDrawTexture so it works with switcher plugins
etc that never glPaint.

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

+1 although there's a weird whitespace change here

29 -/* Note: Normally plugins should wrap into glPaintWindow to modify opacity,
30 - brightness and saturation. As some plugins bypass glPaintWindow when
31 - they draw windows and our custom values always need to be applied,
32 - we wrap into glDrawWindow here */
33 +/* Note: Normally plugins should wrap into glPaint to modify opacity,
34 + brightness and saturation. As some plugins bypass glPaint when
35 + they draw windows and our custom values always need to be applied,
36 + we wrap into glDrawTexture here */

Also is this still necessary?

8 - <plugin>decor</plugin>
9 <plugin>blur</plugin>

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

The whitespace change is intentional. I switched tabs to spaces to guarantee the text lines up with "/* Note: " regardless of the tab size. Code should always look correct and properly aligned regardless of the tab size you're using. But I admit that's not true for most of compiz.

Yes the XML change is technically correct. However I think only CCSM ever pays attention to it.

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

Ok then :)

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/obs/obs.xml.in'
2--- plugins/obs/obs.xml.in 2011-09-09 09:54:02 +0000
3+++ plugins/obs/obs.xml.in 2012-11-22 06:49:18 +0000
4@@ -9,7 +9,6 @@
5 <plugin>opengl</plugin>
6 </requirement>
7 <relation type="after">
8- <plugin>decor</plugin>
9 <plugin>blur</plugin>
10 </relation>
11 </deps>
12
13=== modified file 'plugins/obs/src/obs.cpp'
14--- plugins/obs/src/obs.cpp 2012-09-07 23:29:42 +0000
15+++ plugins/obs/src/obs.cpp 2012-11-22 06:49:18 +0000
16@@ -115,7 +115,7 @@
17 break;
18 }
19
20- gWindow->glDrawSetEnabled (this, hasCustom);
21+ gWindow->glDrawTextureSetEnabled (this, hasCustom);
22 cWindow->addDamage ();
23 }
24
25@@ -149,16 +149,16 @@
26 return gWindow->glPaint (attrib, transform, region, mask);
27 }
28
29-/* Note: Normally plugins should wrap into glPaintWindow to modify opacity,
30- brightness and saturation. As some plugins bypass glPaintWindow when
31- they draw windows and our custom values always need to be applied,
32- we wrap into glDrawWindow here */
33+/* Note: Normally plugins should wrap into glPaint to modify opacity,
34+ brightness and saturation. As some plugins bypass glPaint when
35+ they draw windows and our custom values always need to be applied,
36+ we wrap into glDrawTexture here */
37
38-bool
39-ObsWindow::glDraw (const GLMatrix &transform,
40- const GLWindowPaintAttrib &attrib,
41- const CompRegion &region,
42- unsigned int mask)
43+void
44+ObsWindow::glDrawTexture (GLTexture *texture,
45+ const GLMatrix &transform,
46+ const GLWindowPaintAttrib &attrib,
47+ unsigned int mask)
48 {
49 GLWindowPaintAttrib wAttrib (attrib);
50 int factor;
51@@ -178,7 +178,7 @@
52 if (factor != 100)
53 wAttrib.saturation = factor * wAttrib.saturation / 100;
54
55- return gWindow->glDraw (transform, wAttrib, region, mask);
56+ return gWindow->glDrawTexture (texture, transform, wAttrib, mask);
57 }
58
59 void
60
61=== modified file 'plugins/obs/src/obs.h'
62--- plugins/obs/src/obs.h 2012-09-07 23:29:42 +0000
63+++ plugins/obs/src/obs.h 2012-11-22 06:49:18 +0000
64@@ -64,8 +64,10 @@
65
66 bool glPaint (const GLWindowPaintAttrib &, const GLMatrix &,
67 const CompRegion &, unsigned int);
68- bool glDraw (const GLMatrix &, const GLWindowPaintAttrib &,
69- const CompRegion &, unsigned int);
70+ void glDrawTexture (GLTexture *texture,
71+ const GLMatrix &transform,
72+ const GLWindowPaintAttrib &attrib,
73+ unsigned int mask);
74
75 void changePaintModifier (unsigned int, int);
76 void updatePaintModifier (unsigned int);

Subscribers

People subscribed via source and target branches