Merge lp:~smspillaz/compiz-core/compiz-core.fix_882531 into lp:compiz-core/0.9.5

Proposed by Sam Spilsbury
Status: Merged
Approved by: Alan Griffiths
Approved revision: 2972
Merged at revision: 2975
Proposed branch: lp:~smspillaz/compiz-core/compiz-core.fix_882531
Merge into: lp:compiz-core/0.9.5
Diff against target: 98 lines (+30/-7)
2 files modified
plugins/composite/include/composite/composite.h (+13/-7)
plugins/composite/src/screen.cpp (+17/-0)
To merge this branch: bzr merge lp:~smspillaz/compiz-core/compiz-core.fix_882531
Reviewer Review Type Date Requested Status
Alan Griffiths Approve
Jason Smith Pending
Review via email: mp+90681@code.launchpad.net

This proposal supersedes a proposal from 2012-01-30.

Description of the change

Adds a wrapable damageRegion function

To post a comment you must log in.
Revision history for this message
Jason Smith (jassmith) wrote : Posted in a previous version of this proposal

Merge errors in diff

review: Needs Fixing
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

ok

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/composite/include/composite/composite.h'
2--- plugins/composite/include/composite/composite.h 2012-01-20 09:05:56 +0000
3+++ plugins/composite/include/composite/composite.h 2012-01-30 12:02:27 +0000
4@@ -30,7 +30,7 @@
5
6 #include <X11/extensions/Xcomposite.h>
7
8-#define COMPIZ_COMPOSITE_ABI 3
9+#define COMPIZ_COMPOSITE_ABI 4
10
11 #include "core/pluginclasshandler.h"
12 #include "core/timer.h"
13@@ -161,11 +161,16 @@
14 *
15 */
16 virtual void unregisterPaintHandler ();
17+
18+ /**
19+ * Hookable function to damage regions directly
20+ */
21+ virtual void damageRegion (const CompRegion &r);
22 };
23
24
25 class CompositeScreen :
26- public WrapableHandler<CompositeScreenInterface, 6>,
27+ public WrapableHandler<CompositeScreenInterface, 7>,
28 public PluginClassHandler<CompositeScreen, CompScreen, COMPIZ_COMPOSITE_ABI>,
29 public CompOption::Class
30 {
31@@ -189,11 +194,6 @@
32 */
33 void damageScreen ();
34
35- /**
36- * Adds a specific region to be redrawn on the next
37- * event loop
38- */
39- void damageRegion (const CompRegion &);
40 void damagePending ();
41
42
43@@ -234,6 +234,12 @@
44 WRAPABLE_HND (4, CompositeScreenInterface, bool, registerPaintHandler, compiz::composite::PaintHandler *);
45 WRAPABLE_HND (5, CompositeScreenInterface, void, unregisterPaintHandler);
46
47+ /**
48+ * Adds a specific region to be redrawn on the next
49+ * event loop
50+ */
51+ WRAPABLE_HND (6, CompositeScreenInterface, void, damageRegion, const CompRegion &);
52+
53 friend class PrivateCompositeDisplay;
54
55 private:
56
57=== modified file 'plugins/composite/src/screen.cpp'
58--- plugins/composite/src/screen.cpp 2012-01-23 18:41:06 +0000
59+++ plugins/composite/src/screen.cpp 2012-01-30 12:02:27 +0000
60@@ -441,14 +441,27 @@
61 void
62 CompositeScreen::damageScreen ()
63 {
64+ bool alreadyDamaged = priv->damageMask & COMPOSITE_SCREEN_DAMAGE_ALL_MASK;
65+
66 priv->damageMask |= COMPOSITE_SCREEN_DAMAGE_ALL_MASK;
67 priv->damageMask &= ~COMPOSITE_SCREEN_DAMAGE_REGION_MASK;
68+
69 priv->scheduler.schedule ();
70+
71+ /*
72+ * Call through damageRegion since plugins listening for incoming damage
73+ * may need to know that the whole screen was redrawn
74+ */
75+
76+ if (!alreadyDamaged)
77+ damageRegion (CompRegion (0, 0, screen->width (), screen->height ()));
78 }
79
80 void
81 CompositeScreen::damageRegion (const CompRegion &region)
82 {
83+ WRAPABLE_HND_FUNCTN (damageRegion, region);
84+
85 if (priv->damageMask & COMPOSITE_SCREEN_DAMAGE_ALL_MASK)
86 return;
87
88@@ -864,6 +877,10 @@
89 CompositeScreenInterface::unregisterPaintHandler ()
90 WRAPABLE_DEF (unregisterPaintHandler);
91
92+void
93+CompositeScreenInterface::damageRegion (const CompRegion &r)
94+ WRAPABLE_DEF (damageRegion, r);
95+
96 const CompRegion &
97 CompositeScreen::currentDamage () const
98 {

Subscribers

People subscribed via source and target branches