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

Proposed by Daniel van Vugt on 2012-07-18
Status: Merged
Approved by: Daniel van Vugt on 2012-07-20
Approved revision: 3289
Merged at revision: 3288
Proposed branch: lp:~vanvugt/compiz/fix-1021104
Merge into: lp:compiz/0.9.8
Diff against target: 62 lines (+18/-2)
2 files modified
plugins/opengl/src/privates.h (+1/-0)
plugins/opengl/src/screen.cpp (+17/-2)
To merge this branch: bzr merge lp:~vanvugt/compiz/fix-1021104
Reviewer Review Type Date Requested Status
Sam Spilsbury 2012-07-18 Approve on 2012-07-18
Compiz Maintainers 2012-07-18 Pending
Review via email: mp+115466@code.launchpad.net

This proposal supersedes a proposal from 2012-07-17.

Commit Message

Avoid severe artifacts and flickering when using LLVMpipe (LP: #1021104)

Description of the Change

Avoid severe artifacts and flickering when using LLVMpipe (LP: #1021104)

To post a comment you must log in.
Sam Spilsbury (smspillaz) wrote : Posted in a previous version of this proposal

57 + if (mask & COMPOSITE_SCREEN_DAMAGE_ALL_MASK)
58 + tmpRegion = screen->region ();
59 +
60 BoxPtr pBox = const_cast <Region> (tmpRegion.handle ())->rects;
61 int nBox = const_cast <Region> (tmpRegion.handle ())->numRects;
62 int y;

I feel like this is in a bit of a weird place - I initially thought we could add a callback for into GLScreen to query this, but that could be even more awkward.

I'd like to see some tests for this behaviour if possible.

Otherwise, looks fine (even if I don't personally like driver detection based workarounds).

review: Approve
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

Actually that might be redundant. On COMPOSITE_SCREEN_DAMAGE_ALL_MASK, tmpRegion should match the screen already.

Sam Spilsbury (smspillaz) wrote :

Would still like to see tests, but they can come later as this is kinda important.

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/privates.h'
2--- plugins/opengl/src/privates.h 2012-05-25 03:54:23 +0000
3+++ plugins/opengl/src/privates.h 2012-07-18 04:09:18 +0000
4@@ -120,6 +120,7 @@
5
6 std::vector<GLTexture::BindPixmapProc> bindPixmap;
7 bool hasCompositing;
8+ bool commonFrontbuffer;
9
10 GLIcon defaultIcon;
11
12
13=== modified file 'plugins/opengl/src/screen.cpp'
14--- plugins/opengl/src/screen.cpp 2012-04-20 07:35:20 +0000
15+++ plugins/opengl/src/screen.cpp 2012-07-18 04:09:18 +0000
16@@ -143,6 +143,19 @@
17 return false;
18 }
19
20+ priv->commonFrontbuffer = true;
21+ if (glRenderer != NULL && strstr (glRenderer, "on llvmpipe"))
22+ {
23+ /*
24+ * Most drivers use the same frontbuffer infrastructure for
25+ * swapbuffers as well as subbuffer copying. However there are some
26+ * odd exceptions like LLVMpipe (and SGX-something?) that use separate
27+ * buffers, so we can't dynamically switch between buffer swapping and
28+ * copying in those cases.
29+ */
30+ priv->commonFrontbuffer = false;
31+ }
32+
33 if (strstr (glExtensions, "GL_ARB_texture_non_power_of_two"))
34 GL::textureNonPowerOfTwo = true;
35
36@@ -579,6 +592,7 @@
37 outputRegion (),
38 bindPixmap (),
39 hasCompositing (false),
40+ commonFrontbuffer (true),
41 rootPixmapCopy (None),
42 rootPixmapSize ()
43 {
44@@ -1133,7 +1147,8 @@
45 glClear (GL_COLOR_BUFFER_BIT);
46 }
47
48- CompRegion tmpRegion (region);
49+ CompRegion tmpRegion = (mask & COMPOSITE_SCREEN_DAMAGE_ALL_MASK) ?
50+ screen->region () : region;
51
52 foreach (CompOutput *output, outputs)
53 {
54@@ -1189,7 +1204,7 @@
55
56 targetOutput = &screen->outputDevs ()[0];
57
58- if (mask & COMPOSITE_SCREEN_DAMAGE_ALL_MASK)
59+ if ((mask & COMPOSITE_SCREEN_DAMAGE_ALL_MASK) && commonFrontbuffer)
60 {
61 /*
62 * controlSwapVideoSync is much faster than waitForVideoSync because

Subscribers

People subscribed via source and target branches