Merge lp:~smspillaz/compiz-core/compiz-core.optimization-inlining into lp:compiz-core
- compiz-core.optimization-inlining
- Merge into 0.9.7
Status: | Superseded |
---|---|
Proposed branch: | lp:~smspillaz/compiz-core/compiz-core.optimization-inlining |
Merge into: | lp:compiz-core |
Diff against target: |
338 lines (+129/-78) 9 files modified
include/core/region.h (+1/-1) include/core/window.h (+11/-7) src/privatewindow.h (+16/-0) src/rect/include/core/rect.h (+19/-0) src/region.cpp (+0/-6) src/window.cpp (+9/-0) src/window/geometry/include/core/windowgeometry.h (+1/-1) src/window/geometry/src/windowgeometry.cpp (+0/-6) src/windowgeometry.cpp (+72/-57) |
To merge this branch: | bzr merge lp:~smspillaz/compiz-core/compiz-core.optimization-inlining |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Daniel van Vugt | Needs Fixing | ||
Alan Griffiths | Approve | ||
Review via email: mp+95094@code.launchpad.net |
This proposal has been superseded by a proposal from 2012-04-19.
Commit message
Description of the change
Optimize and inline some hot-spots in CompWindow.
server*Rect and *Rect were being called quite a lot and unnecessarily being recalculated and copy-constructed (eg XCreateRegion madness). This branch inlines some functions that were being called a ton (compiz:
Daniel van Vugt (vanvugt) wrote : | # |
priv is a void* because in the penultimate revision before that change was merged, priv could represent different types (Region or PrivateRegion). Now that PrivateRegion is gone however you are correct that priv could be simply "Region priv".
Daniel van Vugt (vanvugt) wrote : | # |
I haven't tested it yet, but I'm pretty sure this branch should contain a CORE_ABIVERSION bump.
Alan Griffiths (alan-griffiths) wrote : | # |
> I haven't tested it yet, but I'm pretty sure this branch should contain a
> CORE_ABIVERSION bump.
Good catch
Daniel van Vugt (vanvugt) wrote : | # |
8 - Region handle () const;
9 + Region handle () const { return static_cast<Region> (priv); }
I noticed also that CompRegion::handle is the most commonly called function in compiz. However it is also tiny and only accounts for 1% of compiz CPU usage. Which is why I didn't touch it.
Another problem with changing handle() is that if we change the implementation of CompRegion in future then we will need to change handle() again and that would be another ABI bump.
I think a better solution to solve all of these problems is to keep handle() unchanged, and add a new method:
private:
Region privHandle () const { return static_cast<Region> (priv); }
for use in region.cpp only.
Daniel van Vugt (vanvugt) wrote : | # |
Or simply:
#define REGIONHANDLE (static_
in region.cpp
Daniel van Vugt (vanvugt) wrote : | # |
Also, testing this code I notice another windows-
:(
Daniel van Vugt (vanvugt) wrote : | # |
Though it's possible the shift regression would be fixed by merging the other branch Sam mentions...
Daniel van Vugt (vanvugt) wrote : | # |
Confirmed: The shift regression seen with this branch is fixed if you also merge:
lp:~smspillaz/compiz-core/compiz-core.work_923683
But that branch has its own problems.
Sam Spilsbury (smspillaz) wrote : | # |
> 8 - Region handle () const;
> 9 + Region handle () const { return static_cast<Region> (priv); }
>
> I noticed also that CompRegion::handle is the most commonly called function in
> compiz. However it is also tiny and only accounts for 1% of compiz CPU usage.
> Which is why I didn't touch it.
>
> Another problem with changing handle() is that if we change the implementation
> of CompRegion in future then we will need to change handle() again and that
> would be another ABI bump.
We change the ABI for other reasons too, and I really don't think the implementation of CompRegion is going to change (except, perhaps to cairo_region_t), so this is just a total non-issue.
>
> I think a better solution to solve all of these problems is to keep handle()
> unchanged, and add a new method:
> private:
> Region privHandle () const { return static_cast<Region> (priv); }
> for use in region.cpp only.
Daniel van Vugt (vanvugt) wrote : | # |
CompRegion:
I think this may be worth inlining privately. As mentioned earlier. We shouldn't make handle() inline for external users of the class. FYI, CompRegion:
compiz:
Makes no sense to inline AFAICS. It may well be around the 25th most called function, however it only accounts for 0.07% of the CPU usage.
CompWindow:
Does not need to optimizing at all. Is almost never called and contributes absolutely nothing to the total CPU usage.
*Rect()
Contribute almost nothing measurable to the CPU usage.
All-in-all, these optimizations don't seem to provide any significant benefit. I think CompRegion:
If I'm wrong, then please log a bug with the profile data showing why all this existing code needs optimizing.
Sam Spilsbury (smspillaz) wrote : | # |
On Mon, 5 Mar 2012, Daniel van Vugt wrote:
> Review: Disapprove
>
> CompRegion:
> I think this may be worth inlining privately. As mentioned earlier. We shouldn't make handle() inline for external users of the class. FYI, CompRegion:
>
Ack, although other plugins use the handle directly.
> compiz:
> Makes no sense to inline AFAICS. It may well be around the 25th most called function, however it only accounts for 0.07% of the CPU usage.
>
Why not ? Avoids the JMP
> CompWindow:
> Does not need to optimizing at all. Is almost never called and contributes absolutely nothing to the total CPU usage.
>
> *Rect()
> Contribute almost nothing measurable to the CPU usage.
>
They account for about 5% ish of usage, and are called during paint
functions. There is no reason for them to operate in the way that they
currently do. The constructors also involve XCreateRegion and
XDestroyRegion pairs.
Just because the optimization isn't "significant" that doesn't mean that
it is useless. In fact, the code as it was written makes no sense
whatsoever, and there isn't any reason to keep it as it is.
> All-in-all, these optimizations don't seem to provide any significant benefit. I think CompRegion:
>
The regression is unrelated, see
lp:~smspillaz/compiz-core/compiz-core.backport_2988_work_923683
> If I'm wrong, then please log a bug with the profile data showing why all this existing code needs optimizing.
> --
> https:/
> You are the owner of lp:~smspillaz/compiz-core/compiz-core.optimization-inlining.
>
Daniel van Vugt (vanvugt) wrote : | # |
Still causes the shift regression, despite us thinking it was fixed by:
https:/
It seems that fix has not worked.
Aside from the shift regression which still needs fixing, I strongly recommend not breaking the ABI (now and again in future) by inlining handle() or border(). If anything, I suggest adding new inline functions "inlineHandle" and "inlineBorder". Ideally they should be private. If not private, then they should be documented as "only safe to use in core or core plugins".
CORE_ABIVERSION still needs bumping too.
Daniel van Vugt (vanvugt) wrote : | # |
And yes, when I say "causes the shift regression" I actually mean "triggers the shift regression". I'm pretty sure the bug is not in the below diff, only exploited by it.
Unmerged revisions
- 3027. By Sam Spilsbury
-
Added RecalcRect, a class which has a function to recalculate a rectangle on demand,
currently replaces *Rect () in window and allows them to be const &, soon we will be
able to only recalculate these when necessary and not all the time - 3026. By Sam Spilsbury
-
Inline some heavily called CompRegion and compiz:
:window: :Geometry types
Preview Diff
1 | === modified file 'include/core/region.h' | |||
2 | --- include/core/region.h 2012-02-27 03:41:13 +0000 | |||
3 | +++ include/core/region.h 2012-02-29 03:40:25 +0000 | |||
4 | @@ -71,7 +71,7 @@ | |||
5 | 71 | /** | 71 | /** |
6 | 72 | * Returns the internal XRegion handle | 72 | * Returns the internal XRegion handle |
7 | 73 | */ | 73 | */ |
9 | 74 | Region handle () const; | 74 | Region handle () const { return static_cast<Region> (priv); } |
10 | 75 | 75 | ||
11 | 76 | /** | 76 | /** |
12 | 77 | * Returns true if the specified CompPoint falls within the | 77 | * Returns true if the specified CompPoint falls within the |
13 | 78 | 78 | ||
14 | === modified file 'include/core/window.h' | |||
15 | --- include/core/window.h 2012-02-16 09:55:06 +0000 | |||
16 | +++ include/core/window.h 2012-02-29 03:40:25 +0000 | |||
17 | @@ -317,19 +317,23 @@ | |||
18 | 317 | /* With border */ | 317 | /* With border */ |
19 | 318 | int serverWidth () const; | 318 | int serverWidth () const; |
20 | 319 | int serverHeight () const; | 319 | int serverHeight () const; |
22 | 320 | const CompSize serverSize () const; | 320 | CompSize serverSize () const; |
23 | 321 | 321 | ||
24 | 322 | /* effective decoration extents */ | 322 | /* effective decoration extents */ |
27 | 323 | CompRect borderRect () const; | 323 | const CompRect & borderRect () const; |
28 | 324 | CompRect serverBorderRect () const; | 324 | const CompRect & serverBorderRect () const; |
29 | 325 | 325 | ||
30 | 326 | /* frame window geometry */ | 326 | /* frame window geometry */ |
33 | 327 | CompRect inputRect () const; | 327 | const CompRect & inputRect () const; |
34 | 328 | CompRect serverInputRect () const; | 328 | const CompRect & serverInputRect () const; |
35 | 329 | 329 | ||
36 | 330 | /* includes decorations and shadows */ | 330 | /* includes decorations and shadows */ |
39 | 331 | CompRect outputRect () const; | 331 | const CompRect & outputRect () const; |
40 | 332 | CompRect serverOutputRect () const; | 332 | const CompRect & serverOutputRect () const; |
41 | 333 | |||
42 | 334 | /* only includes X11 borders */ | ||
43 | 335 | const CompRect & geometryBorders () const; | ||
44 | 336 | const CompRect & serverGeometryBorders () const; | ||
45 | 333 | 337 | ||
46 | 334 | Window id (); | 338 | Window id (); |
47 | 335 | Window frame (); | 339 | Window frame (); |
48 | 336 | 340 | ||
49 | === modified file 'src/privatewindow.h' | |||
50 | --- src/privatewindow.h 2012-02-14 14:37:04 +0000 | |||
51 | +++ src/privatewindow.h 2012-02-29 03:40:25 +0000 | |||
52 | @@ -209,6 +209,13 @@ | |||
53 | 209 | 209 | ||
54 | 210 | bool checkClear (); | 210 | bool checkClear (); |
55 | 211 | 211 | ||
56 | 212 | void recalcExtentsRect (CompRect &rect, | ||
57 | 213 | const CompWindow::Geometry *geometry, | ||
58 | 214 | const CompWindowExtents *extents); | ||
59 | 215 | |||
60 | 216 | void recalcGeometryBordersRect (CompRect &rect, | ||
61 | 217 | const CompWindow::Geometry *geometry); | ||
62 | 218 | |||
63 | 212 | public: | 219 | public: |
64 | 213 | 220 | ||
65 | 214 | PrivateWindow *priv; | 221 | PrivateWindow *priv; |
66 | @@ -251,6 +258,15 @@ | |||
67 | 251 | CompRegion inputRegion; | 258 | CompRegion inputRegion; |
68 | 252 | CompRegion frameRegion; | 259 | CompRegion frameRegion; |
69 | 253 | 260 | ||
70 | 261 | compiz::rect::RecalcRect borderRect; | ||
71 | 262 | compiz::rect::RecalcRect serverBorderRect; | ||
72 | 263 | compiz::rect::RecalcRect inputRect; | ||
73 | 264 | compiz::rect::RecalcRect serverInputRect; | ||
74 | 265 | compiz::rect::RecalcRect outputRect; | ||
75 | 266 | compiz::rect::RecalcRect serverOutputRect; | ||
76 | 267 | compiz::rect::RecalcRect geometryBorders; | ||
77 | 268 | compiz::rect::RecalcRect serverGeometryBorders; | ||
78 | 269 | |||
79 | 254 | unsigned int wmType; | 270 | unsigned int wmType; |
80 | 255 | unsigned int type; | 271 | unsigned int type; |
81 | 256 | unsigned int state; | 272 | unsigned int state; |
82 | 257 | 273 | ||
83 | === modified file 'src/rect/include/core/rect.h' | |||
84 | --- src/rect/include/core/rect.h 2012-01-19 19:32:29 +0000 | |||
85 | +++ src/rect/include/core/rect.h 2012-02-29 03:40:25 +0000 | |||
86 | @@ -33,6 +33,8 @@ | |||
87 | 33 | #include <X11/Xlib.h> | 33 | #include <X11/Xlib.h> |
88 | 34 | #include <X11/Xutil.h> | 34 | #include <X11/Xutil.h> |
89 | 35 | #include <X11/Xregion.h> | 35 | #include <X11/Xregion.h> |
90 | 36 | #include <boost/function.hpp> | ||
91 | 37 | #include <boost/bind.hpp> | ||
92 | 36 | #include "core/point.h" | 38 | #include "core/point.h" |
93 | 37 | 39 | ||
94 | 38 | 40 | ||
95 | @@ -144,6 +146,23 @@ | |||
96 | 144 | { | 146 | { |
97 | 145 | CompPoint wraparoundPoint (const CompRect &bounds, | 147 | CompPoint wraparoundPoint (const CompRect &bounds, |
98 | 146 | const CompPoint &p); | 148 | const CompPoint &p); |
99 | 149 | |||
100 | 150 | class RecalcRect | ||
101 | 151 | { | ||
102 | 152 | public: | ||
103 | 153 | |||
104 | 154 | typedef boost::function <void (CompRect &rect)> RecalcFunc; | ||
105 | 155 | |||
106 | 156 | RecalcRect (const RecalcFunc &func); | ||
107 | 157 | |||
108 | 158 | const CompRect & rect () const { return mRect; } | ||
109 | 159 | void refresh () { mRecalcFunc (mRect); } | ||
110 | 160 | |||
111 | 161 | private: | ||
112 | 162 | |||
113 | 163 | CompRect mRect; | ||
114 | 164 | RecalcFunc mRecalcFunc; | ||
115 | 165 | }; | ||
116 | 147 | } | 166 | } |
117 | 148 | } | 167 | } |
118 | 149 | 168 | ||
119 | 150 | 169 | ||
120 | === modified file 'src/region.cpp' | |||
121 | --- src/region.cpp 2012-02-27 08:05:51 +0000 | |||
122 | +++ src/region.cpp 2012-02-29 03:40:25 +0000 | |||
123 | @@ -118,12 +118,6 @@ | |||
124 | 118 | priv = XCreateRegion (); | 118 | priv = XCreateRegion (); |
125 | 119 | } | 119 | } |
126 | 120 | 120 | ||
127 | 121 | Region | ||
128 | 122 | CompRegion::handle () const | ||
129 | 123 | { | ||
130 | 124 | return static_cast<Region> (priv); | ||
131 | 125 | } | ||
132 | 126 | |||
133 | 127 | CompRegion & | 121 | CompRegion & |
134 | 128 | CompRegion::operator= (const CompRegion &c) | 122 | CompRegion::operator= (const CompRegion &c) |
135 | 129 | { | 123 | { |
136 | 130 | 124 | ||
137 | === modified file 'src/window.cpp' | |||
138 | --- src/window.cpp 2012-02-20 02:30:34 +0000 | |||
139 | +++ src/window.cpp 2012-02-29 03:40:25 +0000 | |||
140 | @@ -6589,6 +6589,15 @@ | |||
141 | 6589 | width (0), | 6589 | width (0), |
142 | 6590 | height (0), | 6590 | height (0), |
143 | 6591 | region (), | 6591 | region (), |
144 | 6592 | frameRegion (), | ||
145 | 6593 | borderRect (boost::bind (&PrivateWindow::recalcExtentsRect, this, _1, &geometry, &border)), | ||
146 | 6594 | serverBorderRect (boost::bind (&PrivateWindow::recalcExtentsRect, this, _1, &serverGeometry, &border)), | ||
147 | 6595 | inputRect (boost::bind (&PrivateWindow::recalcExtentsRect, this, _1, &geometry, &input)), | ||
148 | 6596 | serverInputRect (boost::bind (&PrivateWindow::recalcExtentsRect, this, _1, &serverGeometry, &serverInput)), | ||
149 | 6597 | outputRect (boost::bind (&PrivateWindow::recalcExtentsRect, this, _1, &geometry, &output)), | ||
150 | 6598 | serverOutputRect (boost::bind (&PrivateWindow::recalcExtentsRect, this, _1, &serverGeometry, &output)), | ||
151 | 6599 | geometryBorders (boost::bind (&PrivateWindow::recalcGeometryBordersRect, this, _1, &geometry)), | ||
152 | 6600 | serverGeometryBorders (boost::bind (&PrivateWindow::recalcGeometryBordersRect, this, _1, &serverGeometry)), | ||
153 | 6592 | wmType (0), | 6601 | wmType (0), |
154 | 6593 | type (CompWindowTypeUnknownMask), | 6602 | type (CompWindowTypeUnknownMask), |
155 | 6594 | state (0), | 6603 | state (0), |
156 | 6595 | 6604 | ||
157 | === modified file 'src/window/geometry/include/core/windowgeometry.h' | |||
158 | --- src/window/geometry/include/core/windowgeometry.h 2012-01-19 20:08:32 +0000 | |||
159 | +++ src/window/geometry/include/core/windowgeometry.h 2012-02-29 03:40:25 +0000 | |||
160 | @@ -55,7 +55,7 @@ | |||
161 | 55 | Geometry (); | 55 | Geometry (); |
162 | 56 | Geometry (int x, int y, int width, int height, int border); | 56 | Geometry (int x, int y, int width, int height, int border); |
163 | 57 | 57 | ||
165 | 58 | int border () const; | 58 | int border () const { return mBorder; } |
166 | 59 | 59 | ||
167 | 60 | void set (int x, int y, int width, int height, int border); | 60 | void set (int x, int y, int width, int height, int border); |
168 | 61 | void setBorder (int border); | 61 | void setBorder (int border); |
169 | 62 | 62 | ||
170 | === modified file 'src/window/geometry/src/windowgeometry.cpp' | |||
171 | --- src/window/geometry/src/windowgeometry.cpp 2012-01-19 20:08:32 +0000 | |||
172 | +++ src/window/geometry/src/windowgeometry.cpp 2012-02-29 03:40:25 +0000 | |||
173 | @@ -41,12 +41,6 @@ | |||
174 | 41 | { | 41 | { |
175 | 42 | } | 42 | } |
176 | 43 | 43 | ||
177 | 44 | int | ||
178 | 45 | compiz::window::Geometry::border () const | ||
179 | 46 | { | ||
180 | 47 | return mBorder; | ||
181 | 48 | } | ||
182 | 49 | |||
183 | 50 | void | 44 | void |
184 | 51 | compiz::window::Geometry::setBorder (int border) | 45 | compiz::window::Geometry::setBorder (int border) |
185 | 52 | { | 46 | { |
186 | 53 | 47 | ||
187 | === modified file 'src/windowgeometry.cpp' | |||
188 | --- src/windowgeometry.cpp 2012-01-23 05:44:19 +0000 | |||
189 | +++ src/windowgeometry.cpp 2012-02-29 03:40:25 +0000 | |||
190 | @@ -113,7 +113,7 @@ | |||
191 | 113 | 2 * priv->serverGeometry.border (); | 113 | 2 * priv->serverGeometry.border (); |
192 | 114 | } | 114 | } |
193 | 115 | 115 | ||
195 | 116 | const CompSize | 116 | CompSize |
196 | 117 | CompWindow::serverSize () const | 117 | CompWindow::serverSize () const |
197 | 118 | { | 118 | { |
198 | 119 | return CompSize (priv->serverGeometry.width () + | 119 | return CompSize (priv->serverGeometry.width () + |
199 | @@ -122,68 +122,83 @@ | |||
200 | 122 | 2 * priv->serverGeometry.border ()); | 122 | 2 * priv->serverGeometry.border ()); |
201 | 123 | } | 123 | } |
202 | 124 | 124 | ||
204 | 125 | CompRect | 125 | void |
205 | 126 | PrivateWindow::recalcExtentsRect (CompRect &rect, const CompWindow::Geometry *geometry, const CompWindowExtents *extents) | ||
206 | 127 | { | ||
207 | 128 | rect.setGeometry (geometry->x () - geometry->border () - extents->left, | ||
208 | 129 | geometry->y () - geometry->border () - extents->top, | ||
209 | 130 | geometry->width () + geometry->border () * 2 + | ||
210 | 131 | extents->left + extents->right, | ||
211 | 132 | geometry->height () + geometry->border () * 2 + | ||
212 | 133 | extents->top + extents->bottom); | ||
213 | 134 | } | ||
214 | 135 | |||
215 | 136 | void | ||
216 | 137 | PrivateWindow::recalcGeometryBordersRect (CompRect &rect, const CompWindow::Geometry *geometry) | ||
217 | 138 | { | ||
218 | 139 | rect.setGeometry (geometry->x () - geometry->border (), | ||
219 | 140 | geometry->y () - geometry->border (), | ||
220 | 141 | geometry->width () + geometry->border () * 2, | ||
221 | 142 | geometry->height () + geometry->border () * 2); | ||
222 | 143 | } | ||
223 | 144 | |||
224 | 145 | compiz::rect::RecalcRect::RecalcRect (const RecalcFunc &func) : | ||
225 | 146 | mRecalcFunc (func) | ||
226 | 147 | { | ||
227 | 148 | } | ||
228 | 149 | |||
229 | 150 | const CompRect & | ||
230 | 126 | CompWindow::borderRect () const | 151 | CompWindow::borderRect () const |
231 | 127 | { | 152 | { |
241 | 128 | return CompRect (priv->geometry.x () - priv->geometry.border () - priv->border.left, | 153 | priv->borderRect.refresh (); |
242 | 129 | priv->geometry.y () - priv->geometry.border () - priv->border.top, | 154 | return priv->borderRect.rect (); |
243 | 130 | priv->geometry.width () + priv->geometry.border () * 2 + | 155 | } |
244 | 131 | priv->border.left + priv->border.right, | 156 | |
245 | 132 | priv->geometry.height () + priv->geometry.border () * 2 + | 157 | const CompRect & |
246 | 133 | priv->border.top + priv->border.bottom); | 158 | CompWindow::inputRect () const |
247 | 134 | } | 159 | { |
248 | 135 | 160 | priv->inputRect.refresh (); | |
249 | 136 | CompRect | 161 | return priv->inputRect.rect (); |
250 | 162 | } | ||
251 | 163 | |||
252 | 164 | const CompRect & | ||
253 | 165 | CompWindow::outputRect () const | ||
254 | 166 | { | ||
255 | 167 | priv->outputRect.refresh (); | ||
256 | 168 | return priv->outputRect.rect (); | ||
257 | 169 | } | ||
258 | 170 | |||
259 | 171 | const CompRect & | ||
260 | 137 | CompWindow::serverBorderRect () const | 172 | CompWindow::serverBorderRect () const |
261 | 138 | { | 173 | { |
282 | 139 | return CompRect (priv->serverGeometry.x () - priv->geometry.border () - priv->border.left, | 174 | priv->serverBorderRect.refresh (); |
283 | 140 | priv->serverGeometry.y () - priv->geometry.border () - priv->border.top, | 175 | return priv->serverBorderRect.rect (); |
284 | 141 | priv->serverGeometry.width () + priv->geometry.border () * 2 + | 176 | } |
285 | 142 | priv->border.left + priv->border.right, | 177 | |
286 | 143 | priv->serverGeometry.height () + priv->geometry.border () * 2 + | 178 | const CompRect & |
267 | 144 | priv->border.top + priv->border.bottom); | ||
268 | 145 | } | ||
269 | 146 | |||
270 | 147 | CompRect | ||
271 | 148 | CompWindow::inputRect () const | ||
272 | 149 | { | ||
273 | 150 | return CompRect (priv->geometry.x () - priv->geometry.border () - priv->serverInput.left, | ||
274 | 151 | priv->geometry.y () - priv->geometry.border () - priv->serverInput.top, | ||
275 | 152 | priv->geometry.width () + priv->geometry.border () * 2 + | ||
276 | 153 | priv->serverInput.left + priv->serverInput.right, | ||
277 | 154 | priv->geometry.height () +priv->geometry.border () * 2 + | ||
278 | 155 | priv->serverInput.top + priv->serverInput.bottom); | ||
279 | 156 | } | ||
280 | 157 | |||
281 | 158 | CompRect | ||
287 | 159 | CompWindow::serverInputRect () const | 179 | CompWindow::serverInputRect () const |
288 | 160 | { | 180 | { |
309 | 161 | return CompRect (priv->serverGeometry.x () - priv->serverGeometry.border () - priv->serverInput.left, | 181 | priv->serverInputRect.refresh (); |
310 | 162 | priv->serverGeometry.y () - priv->serverGeometry.border () - priv->serverInput.top, | 182 | return priv->serverInputRect.rect (); |
311 | 163 | priv->serverGeometry.width () + priv->serverGeometry.border () * 2 + | 183 | } |
312 | 164 | priv->serverInput.left + priv->serverInput.right, | 184 | |
313 | 165 | priv->serverGeometry.height () + priv->serverGeometry.border () * 2 + | 185 | const CompRect & |
294 | 166 | priv->serverInput.top + priv->serverInput.bottom); | ||
295 | 167 | } | ||
296 | 168 | |||
297 | 169 | CompRect | ||
298 | 170 | CompWindow::outputRect () const | ||
299 | 171 | { | ||
300 | 172 | return CompRect (priv->geometry.x () - priv->serverGeometry.border ()- priv->output.left, | ||
301 | 173 | priv->geometry.y () - priv->serverGeometry.border () - priv->output.top, | ||
302 | 174 | priv->geometry.width () + priv->serverGeometry.border () * 2 + | ||
303 | 175 | priv->output.left + priv->output.right, | ||
304 | 176 | priv->geometry.height () + priv->serverGeometry.border () * 2 + | ||
305 | 177 | priv->output.top + priv->output.bottom); | ||
306 | 178 | } | ||
307 | 179 | |||
308 | 180 | CompRect | ||
314 | 181 | CompWindow::serverOutputRect () const | 186 | CompWindow::serverOutputRect () const |
315 | 182 | { | 187 | { |
322 | 183 | return CompRect (priv->serverGeometry.x () - priv->serverGeometry.border () - priv->output.left, | 188 | priv->serverOutputRect.refresh (); |
323 | 184 | priv->serverGeometry.y () - priv->serverGeometry.border () - priv->output.top, | 189 | return priv->serverOutputRect.rect (); |
324 | 185 | priv->serverGeometry.width () + priv->serverGeometry.border () * 2 + | 190 | } |
325 | 186 | priv->output.left + priv->output.right, | 191 | |
326 | 187 | priv->serverGeometry.height () + priv->serverGeometry.border () * 2 + | 192 | const CompRect & |
327 | 188 | priv->output.top + priv->output.bottom); | 193 | CompWindow::geometryBorders () const |
328 | 194 | { | ||
329 | 195 | priv->geometryBorders.refresh (); | ||
330 | 196 | return priv->geometryBorders.rect (); | ||
331 | 197 | } | ||
332 | 198 | |||
333 | 199 | const CompRect & | ||
334 | 200 | CompWindow::serverGeometryBorders () const | ||
335 | 201 | { | ||
336 | 202 | priv->serverGeometryBorders.refresh (); | ||
337 | 203 | return priv->serverGeometryBorders.rect (); | ||
338 | 189 | } | 204 | } |
Not really relevant to the change, but as "Region handle () const" compiles there's already a declaration of Region visible - so why is priv a "void*" and cast all the while?