Merge lp:~vanvugt/compiz/fix-1014986 into lp:compiz/0.9.8

Proposed by Daniel van Vugt
Status: Merged
Approved by: Sam Spilsbury
Approved revision: 3322
Merged at revision: 3325
Proposed branch: lp:~vanvugt/compiz/fix-1014986
Merge into: lp:compiz/0.9.8
Diff against target: 13 lines (+2/-1)
1 file modified
plugins/opengl/src/paint.cpp (+2/-1)
To merge this branch: bzr merge lp:~vanvugt/compiz/fix-1014986
Reviewer Review Type Date Requested Status
Sam Spilsbury Approve
Review via email: mp+121132@code.launchpad.net

Commit message

Don't waste CPU looping through and looking at all the windows if you're
rendering an output that has no damage on it. (LP: #1014986)

Description of the change

Don't waste CPU looping through and looking at all the windows if you're
rendering an output that has no damage on it. (LP: #1014986)

The point at which we do the isEmpty check is a code path that is only reachable if PAINT_SCREEN_REGION_MASK and not PAINT_SCREEN_TRANSFORMED_MASK.

I did try to do the check at the top of glPaintOutput instead. But that caused problems with plugins like rotate which don't set PAINT_SCREEN_TRANSFORMED_MASK early enough. So windows would sometimes freeze during cube rotation.

Checking for isEmpty right before priv->paintOutputRegion seems safest.

To post a comment you must log in.
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Yep that's fine. We should always invoke a paint in the transformed case anyways.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/opengl/src/paint.cpp'
2--- plugins/opengl/src/paint.cpp 2012-08-14 06:33:22 +0000
3+++ plugins/opengl/src/paint.cpp 2012-08-24 08:43:20 +0000
4@@ -590,7 +590,8 @@
5
6 sTransform.toScreenSpace (output, -DEFAULT_Z_CAMERA);
7
8- priv->paintOutputRegion (sTransform, region, output, mask);
9+ if (!region.isEmpty ())
10+ priv->paintOutputRegion (sTransform, region, output, mask);
11
12 return true;
13 }

Subscribers

People subscribed via source and target branches