Merge lp:~sil2100/compiz-core/decor_bindtexture into lp:compiz-core

Proposed by Łukasz Zemczak
Status: Merged
Merged at revision: 3098
Proposed branch: lp:~sil2100/compiz-core/decor_bindtexture
Merge into: lp:compiz-core
Diff against target: 102 lines (+43/-19)
2 files modified
plugins/decor/src/decor.cpp (+41/-19)
plugins/decor/src/decor.h (+2/-0)
To merge this branch: bzr merge lp:~sil2100/compiz-core/decor_bindtexture
Reviewer Review Type Date Requested Status
Daniel van Vugt Approve
Sam Spilsbury Approve
Review via email: mp+102509@code.launchpad.net

Commit message

Export the process of DecorTexture pixmap binding to a separate method.

This way we can call DecorTexture::bindTexture whenever we want to explicitly bind/rebind the texture (needed, for instance, for a possible fglrx texture bug workaround - LP: #770283).

Description of the change

Problem:

As described in LP: #770283, since long window decorations just don't update correctly for fglrx users. This is happening since oneiric or even earlier. The problem is quite severe, since it affects all users and really makes the Ubuntu experience troublesome.
The problem lies in fglrx (most probably) not being able to correctly pass changes made to a Pixmap to the underlying GLXPixmap created out of it. I already informed ATI about the problem and we're analyzing it in more detail.

The fix:

It's a hacky workaround, but all that is needed is forcing the decor plugin to just rebind the texture on damage events regarding decoration textures. This merge request only introduces the creation of the bindTexture () method, which allows explicit binding/rebinding of textures from a DecorTexture.

The actual usage of the bindTexture method which fixes the fglrx problem will be included as a distro-patch (as we decided with Sam and Didier).

Test coverage:

None.

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

Technically it's an ABI change. But it's a "compatible" ABI change to be adding a non-virtual function.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/decor/src/decor.cpp'
2--- plugins/decor/src/decor.cpp 2012-04-17 04:05:07 +0000
3+++ plugins/decor/src/decor.cpp 2012-04-18 12:59:19 +0000
4@@ -320,44 +320,66 @@
5 pixmap (pixmap),
6 damage (None)
7 {
8+ if (!bindTexture (pixmap))
9+ return;
10+
11+ damage = XDamageCreate (screen->dpy (), pixmap,
12+ XDamageReportRawRectangles);
13+}
14+
15+/*
16+ * DecorTexture::~DecorTexture
17+ *
18+ * Remove damage handle on texture
19+ *
20+ */
21+
22+DecorTexture::~DecorTexture ()
23+{
24+ if (damage)
25+ XDamageDestroy (screen->dpy (), damage);
26+}
27+
28+/*
29+ * DecorTexture::indTexture
30+ *
31+ * This function actually takes and binds/rebinds the given Pixmap
32+ * to a texture (i.e. calls GLTexture::bindPixmapToTexture)
33+ *
34+ */
35+
36+bool
37+DecorTexture::bindTexture (Pixmap src)
38+{
39 unsigned int width, height, depth, ui;
40 Window root;
41 int i;
42
43+ pixmap = src;
44+
45 if (!XGetGeometry (screen->dpy (), pixmap, &root,
46 &i, &i, &width, &height, &ui, &depth))
47 {
48- status = false;
49- return;
50+ status = false;
51+ return false;
52 }
53
54+ // Explicitly clear the texture list before binding/rebinding
55+ textures.clear ();
56+
57 bindFailed = false;
58 textures = GLTexture::bindPixmapToTexture (pixmap, width, height, depth);
59 if (textures.size () != 1)
60 {
61 bindFailed = true;
62- status = false;
63- return;
64+ status = false;
65+ return false;
66 }
67
68 if (!DecorScreen::get (screen)->optionGetMipmap ())
69 textures[0]->setMipmap (false);
70
71- damage = XDamageCreate (screen->dpy (), pixmap,
72- XDamageReportRawRectangles);
73-}
74-
75-/*
76- * DecorTexture::~DecorTexture
77- *
78- * Remove damage handle on texture
79- *
80- */
81-
82-DecorTexture::~DecorTexture ()
83-{
84- if (damage)
85- XDamageDestroy (screen->dpy (), damage);
86+ return true;
87 }
88
89 /*
90
91=== modified file 'plugins/decor/src/decor.h'
92--- plugins/decor/src/decor.h 2012-03-30 14:29:18 +0000
93+++ plugins/decor/src/decor.h 2012-04-18 12:59:19 +0000
94@@ -79,6 +79,8 @@
95 DecorTexture (Pixmap pixmap);
96 ~DecorTexture ();
97
98+ bool bindTexture (Pixmap src);
99+
100 public:
101 bool status;
102 int refCount;

Subscribers

People subscribed via source and target branches