Merge lp:~bryanfritt/compiz/more_ezoom_and_100percent_grid into lp:compiz/0.9.12

Proposed by BryanFRitt
Status: Rejected
Rejected by: Sam Spilsbury
Proposed branch: lp:~bryanfritt/compiz/more_ezoom_and_100percent_grid
Merge into: lp:compiz/0.9.12
Diff against target: 2917 lines (+1136/-630)
42 files modified
VERSION (+1/-1)
debian/changelog (+22/-0)
debian/compiz-dev.install (+1/-0)
debian/compiz-gnome.install (+1/-1)
debian/compiz-plugins.install (+2/-0)
debian/compiz-plugins.install.armel (+2/-0)
debian/compiz-plugins.install.armhf (+2/-0)
debian/compizconfig (+5/-0)
debian/unity-lowgfx.ini (+44/-0)
plugins/CMakeLists.txt (+0/-1)
plugins/animation/include/animation/animeffect.h (+5/-2)
plugins/animation/include/animation/grid.h (+0/-1)
plugins/animation/include/animation/multi.h (+19/-9)
plugins/animation/src/animation.cpp (+17/-24)
plugins/animation/src/glide.cpp (+1/-1)
plugins/animation/src/grid.cpp (+0/-6)
plugins/animation/src/private.h (+1/-1)
plugins/animationaddon/CMakeLists.txt (+1/-4)
plugins/animationaddon/include/animationaddon/animationaddon.h (+17/-11)
plugins/animationaddon/src/airplane.cpp (+47/-36)
plugins/animationaddon/src/animationaddon.cpp (+2/-2)
plugins/animationaddon/src/dissolve.cpp (+11/-2)
plugins/animationaddon/src/particle.cpp (+52/-40)
plugins/animationaddon/src/polygon.cpp (+259/-250)
plugins/animationaddon/src/private.h (+3/-2)
plugins/composite/src/privates.h (+2/-9)
plugins/composite/src/window.cpp (+11/-45)
plugins/expo/expo.xml.in (+5/-1)
plugins/expo/src/expo.cpp (+12/-4)
plugins/ezoom/ezoom.xml.in (+191/-22)
plugins/ezoom/src/ezoom.cpp (+110/-20)
plugins/ezoom/src/ezoom.h (+16/-3)
plugins/grid/src/grid.cpp (+112/-93)
plugins/opengl/include/opengl/matrix.h (+27/-0)
plugins/opengl/include/opengl/opengl.h (+6/-0)
plugins/opengl/include/opengl/vertexbuffer.h (+20/-2)
plugins/opengl/src/paint.cpp (+1/-10)
plugins/opengl/src/privatevertexbuffer.h (+6/-2)
plugins/opengl/src/vertexbuffer.cpp (+77/-22)
plugins/opengl/src/window.cpp (+15/-0)
plugins/scale/scale.xml.in (+5/-0)
plugins/scale/src/scale.cpp (+5/-3)
To merge this branch: bzr merge lp:~bryanfritt/compiz/more_ezoom_and_100percent_grid
Reviewer Review Type Date Requested Status
Compiz Maintainers Pending
Review via email: mp+298444@code.launchpad.net

Commit message

Added in 100% to Grid's 'Cycle Through Multiple Sizes' and
Added in more 'Specific Zoom' levels to eZoom

Description of the change

Added in 100% to Grid's 'Cycle Through Multiple Sizes' and
Added in more 'Specific Zoom' levels to eZoom

To post a comment you must log in.
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Please fix indentation (it should be mixed spaces tabs [odd levels 4 spaces, even levels tabs).

As for default values for Zooming, I'd set instead Ctrl+Alt+MouseWheel.
Although I think you can keep them disabled for upstream.

4055. By BryanFRitt

reformated changed lines using the "Compiz Development/ CodingStyle"
http://wiki.compiz.org/Development/CodingStyle

Revision history for this message
BryanFRitt (bryanfritt) wrote :

I changed the code changes to more towards the "Compiz Development/ CodingStyle"; but I started playing with the .bzrignore file and wasn't sure what to do with it to get it back to normal or whatever I should do with it. What should I do with it?

.bzrignore (+0/-1)

4056. By BryanFRitt

set .bzrignore back to saying '.bzr-repo'

4057. By BryanFRitt

added newline to .bzr-repo
to revert it to what it was before I messed with it.

4058. By BryanFRitt

rolled back the .bzrignore file
bzr revert .bzrignore --revision 4053
an attept make it say that I didn't modify the file

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Please resubmit the propsal against lp:compiz (as this is trying to merge on lp:compiz/0.9.12).

4059. By BryanFRitt

ran `bzr merge lp:compiz`

Revision history for this message
BryanFRitt (bryanfritt) wrote :

"Please resubmit the proposal against lp:compiz (as this is trying to merge on lp:compiz/0.9.12)." [corrected spelling of 'proposal']

Ok... done...
From my 'more_ezoom_and_100percent_grid' folder, I ran `bzr merge lp:compiz`, `bzr commit`, and `bzr push`. Then clicked on 'Propose for merging' to 'lp:compiz' for this branch.

Revision history for this message
BryanFRitt (bryanfritt) wrote :

Is there anything else I need to do?

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

I think this has been resubmitted.

Unmerged revisions

4060. By BryanFRitt

implemented some formatting changes suggested by Marco Trevisan (Treviño) (3v1n0)

4059. By BryanFRitt

ran `bzr merge lp:compiz`

4058. By BryanFRitt

rolled back the .bzrignore file
bzr revert .bzrignore --revision 4053
an attept make it say that I didn't modify the file

4057. By BryanFRitt

added newline to .bzr-repo
to revert it to what it was before I messed with it.

4056. By BryanFRitt

set .bzrignore back to saying '.bzr-repo'

4055. By BryanFRitt

reformated changed lines using the "Compiz Development/ CodingStyle"
http://wiki.compiz.org/Development/CodingStyle

4054. By BryanFRitt

indentation changes, and added a comment about relatively prime numbers

4053. By BryanFRitt

new branch with
old 'ezoom' plugin change that added more zoom levels and
new 'grid' plugin change that added 100% to the sizes that 'Cycle Through Multiple Sizes' goes through

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'VERSION'
2--- VERSION 2015-08-19 15:50:54 +0000
3+++ VERSION 2016-07-14 15:55:30 +0000
4@@ -1,1 +1,1 @@
5-0.9.12.2
6+0.9.13.0
7
8=== modified file 'debian/changelog'
9--- debian/changelog 2016-06-21 13:11:16 +0000
10+++ debian/changelog 2016-07-14 15:55:30 +0000
11@@ -1,3 +1,25 @@
12+compiz (1:0.9.13.0+16.10.20160705-0ubuntu1) yakkety; urgency=medium
13+
14+ [ Eleni Maria Stea ]
15+ * Added options for no animation in expo and scale plugins. They skip
16+ the intermediate fading steps that force several redraws.
17+
18+ [ Marco Trevisan (Treviño) ]
19+ * Composite: use C++ goodness for managing damaging rectangles
20+ * debian: add unity-lowgfx profile to compizconfig (LP: #1598770)
21+
22+ -- Marco Trevisan (Treviño) <mail@3v1n0.net> Tue, 05 Jul 2016 01:12:10 +0000
23+
24+compiz (1:0.9.13.0+16.10.20160628-0ubuntu1) yakkety; urgency=medium
25+
26+ [ Marco Trevisan (Treviño) ]
27+ * New upstream release 0.9.13.0
28+
29+ [ Sam Spilsbury smspillaz@gmail.com ]
30+ * animationaddon: Port the animationaddon plugin to use modern GL API.
31+
32+ -- Marco Trevisan (Treviño) <mail@3v1n0.net> Tue, 28 Jun 2016 14:57:42 +0000
33+
34 compiz (1:0.9.12.2+16.10.20160621-0ubuntu1) yakkety; urgency=medium
35
36 [ Alberts Muktupāvels ]
37
38=== modified file 'debian/compiz-dev.install'
39--- debian/compiz-dev.install 2014-11-24 22:25:07 +0000
40+++ debian/compiz-dev.install 2016-07-14 15:55:30 +0000
41@@ -1,6 +1,7 @@
42 debian/tmp/usr/include/compiz/[!d]*
43 debian/tmp/usr/lib/*/libcompiz_core.so
44 debian/tmp/usr/lib/*/pkgconfig/compiz-animation.pc
45+debian/tmp/usr/lib/*/pkgconfig/compiz-animationaddon.pc
46 debian/tmp/usr/lib/*/pkgconfig/compiz-compiztoolbox.pc
47 debian/tmp/usr/lib/*/pkgconfig/compiz-composite.pc
48 debian/tmp/usr/lib/*/pkgconfig/compiz-cube.pc
49
50=== modified file 'debian/compiz-gnome.install'
51--- debian/compiz-gnome.install 2015-12-10 16:34:35 +0000
52+++ debian/compiz-gnome.install 2016-07-14 15:55:30 +0000
53@@ -1,6 +1,6 @@
54 debian/65compiz_profile-on-session /etc/X11/Xsession.d
55 debian/profile_upgrades/*.upgrade usr/share/compizconfig/upgrades
56-debian/unity.ini /etc/compizconfig/
57+debian/unity*.ini /etc/compizconfig/
58 postinst/convert-files/*.convert usr/lib/compiz/migration/
59 usr/bin/gtk-window-decorator
60 usr/lib/*/compizconfig/backends/libgsettings.so
61
62=== modified file 'debian/compiz-plugins.install'
63--- debian/compiz-plugins.install 2016-05-13 09:45:31 +0000
64+++ debian/compiz-plugins.install 2016-07-14 15:55:30 +0000
65@@ -2,6 +2,8 @@
66 usr/share/compiz/*addhelper.*
67 usr/lib/*/compiz/*annotate.*
68 usr/share/compiz/*annotate.*
69+usr/lib/*/compiz/*animationaddon.*
70+usr/share/compiz/*animationaddon.*
71 usr/lib/*/compiz/*bench.*
72 usr/share/compiz/*bench.*
73 usr/lib/*/compiz/*blur.*
74
75=== modified file 'debian/compiz-plugins.install.armel'
76--- debian/compiz-plugins.install.armel 2014-12-02 14:42:34 +0000
77+++ debian/compiz-plugins.install.armel 2016-07-14 15:55:30 +0000
78@@ -2,6 +2,8 @@
79 usr/share/compiz/*addhelper.*
80 usr/lib/*/compiz/*annotate.*
81 usr/share/compiz/*annotate.*
82+usr/lib/*/compiz/*animationaddon.*
83+usr/share/compiz/*animationaddon.*
84 usr/lib/*/compiz/*clone.*
85 usr/share/compiz/*clone.*
86 usr/lib/*/compiz/*crashhandler.*
87
88=== modified file 'debian/compiz-plugins.install.armhf'
89--- debian/compiz-plugins.install.armhf 2014-12-02 14:42:34 +0000
90+++ debian/compiz-plugins.install.armhf 2016-07-14 15:55:30 +0000
91@@ -2,6 +2,8 @@
92 usr/share/compiz/*addhelper.*
93 usr/lib/*/compiz/*annotate.*
94 usr/share/compiz/*annotate.*
95+usr/lib/*/compiz/*animationaddon.*
96+usr/share/compiz/*animationaddon.*
97 usr/lib/*/compiz/*clone.*
98 usr/share/compiz/*clone.*
99 usr/lib/*/compiz/*crashhandler.*
100
101=== modified file 'debian/compizconfig'
102--- debian/compizconfig 2015-02-04 22:20:18 +0000
103+++ debian/compizconfig 2016-07-14 15:55:30 +0000
104@@ -20,3 +20,8 @@
105 plugin_list_autosort = true
106 profile = unity
107
108+[general_ubuntu-lowgfx]
109+backend = gsettings
110+integration = true
111+plugin_list_autosort = true
112+profile = unity-lowgfx
113
114=== added file 'debian/unity-lowgfx.ini'
115--- debian/unity-lowgfx.ini 1970-01-01 00:00:00 +0000
116+++ debian/unity-lowgfx.ini 2016-07-14 15:55:30 +0000
117@@ -0,0 +1,44 @@
118+[core]
119+s0_active_plugins = core;composite;opengl;copytex;compiztoolbox;vpswitch;snap;mousepoll;resize;place;move;wall;grid;regex;imgpng;session;fade;unitymtgrabhandles;workarounds;scale;expo;ezoom;unityshell
120+
121+[ezoom]
122+s0_speed = 100
123+
124+[expo]
125+s0_expo_animation = 3
126+
127+[fade]
128+s0_fade_mode = 1
129+s0_fade_time = 1
130+
131+[grid]
132+s0_animation_duration = 1
133+
134+[resize]
135+s0_mode = 2
136+
137+[opengl]
138+s0_texture_filter = 0
139+
140+[scale]
141+s0_skip_animation = true
142+
143+[unityshell]
144+s0_low_graphics_mode = true
145+s0_dash_blur_experimental = 0
146+
147+s0_override_decoration_theme = true
148+s0_shadow_x_offset = 1
149+s0_shadow_y_offset = 1
150+s0_active_shadow_radius = 3
151+s0_inactive_shadow_radius = 2
152+
153+s0_menus_fadein = 0
154+s0_menus_fadeout = 0
155+s0_menus_discovery_fadein = 0
156+s0_menus_discovery_fadeout = 0
157+
158+s0_autohide_animation = 1
159+
160+[wall]
161+s0_slide_duration = 0
162
163=== modified file 'plugins/CMakeLists.txt'
164--- plugins/CMakeLists.txt 2016-05-13 06:42:58 +0000
165+++ plugins/CMakeLists.txt 2016-07-14 15:55:30 +0000
166@@ -10,7 +10,6 @@
167 include_directories (${COMPIZ_INTERNAL_INCLUDES})
168
169 # temporarily disable plugins that aren't ported yet
170-set (COMPIZ_DISABLE_PLUGIN_ANIMATIONADDON ON)
171 set (COMPIZ_DISABLE_PLUGIN_BICUBIC ON)
172 set (COMPIZ_DISABLE_PLUGIN_COLORFILTER ON)
173 set (COMPIZ_DISABLE_PLUGIN_GROUP ON)
174
175=== modified file 'plugins/animation/include/animation/animeffect.h'
176--- plugins/animation/include/animation/animeffect.h 2015-03-01 21:55:10 +0000
177+++ plugins/animation/include/animation/animeffect.h 2016-07-14 15:55:30 +0000
178@@ -142,7 +142,7 @@
179 virtual void updateAttrib (GLWindowPaintAttrib &) {}
180 virtual void updateTransform (GLMatrix &) {}
181 virtual void prePaintWindow () {}
182- virtual void postPaintWindow () {}
183+ virtual void postPaintWindow (const GLMatrix &) {}
184 virtual bool postPaintWindowUsed () { return false; }
185
186 /// Returns true if the animation is still in progress.
187@@ -174,7 +174,10 @@
188 const CompRegion &clip,
189 unsigned int maxGridWidth,
190 unsigned int maxGridHeight);
191- virtual void drawGeometry ();
192+ virtual void drawGeometry (GLTexture *texture,
193+ const GLMatrix &transform,
194+ const GLWindowPaintAttrib &attrib,
195+ unsigned int mask);
196
197 virtual bool paintWindowUsed () { return false; }
198 virtual bool paintWindow (GLWindow *gWindow,
199
200=== modified file 'plugins/animation/include/animation/grid.h'
201--- plugins/animation/include/animation/grid.h 2012-08-14 06:33:22 +0000
202+++ plugins/animation/include/animation/grid.h 2016-07-14 15:55:30 +0000
203@@ -101,6 +101,5 @@
204 const CompRegion &clip,
205 unsigned int maxGridWidth,
206 unsigned int maxGridHeight);
207- void drawGeometry ();
208 };
209 #endif
210
211=== modified file 'plugins/animation/include/animation/multi.h'
212--- plugins/animation/include/animation/multi.h 2013-04-25 11:07:54 +0000
213+++ plugins/animation/include/animation/multi.h 2016-07-14 15:55:30 +0000
214@@ -1,6 +1,8 @@
215 #ifndef ANIMATION_MULTI_H
216 #define ANIMATION_MULTI_H
217 #include "animation.h"
218+#include <opengl/opengl.h>
219+#include <composite/composite.h>
220 /// Special class, allows multiple copies of an animation to happen
221 /// at any one time. Create your "single copy" animation class first
222 /// and then create a new animation which derives from this template
223@@ -140,9 +142,8 @@
224 foreach (SingleAnim *a, animList)
225 {
226 setCurrAnimNumber (mAWindow, count);
227- GLWindowPaintAttrib attr (attrib);
228- a->updateAttrib (attr);
229- mGlPaintAttribs.at (count) = attr;
230+ mGlPaintAttribs[count] = attrib;
231+ a->updateAttrib (mGlPaintAttribs[count]);
232 ++count;
233 }
234 }
235@@ -172,14 +173,14 @@
236 }
237 }
238
239- void postPaintWindow ()
240+ void postPaintWindow (const GLMatrix &transform)
241 {
242 int count = 0;
243 foreach (SingleAnim *a, animList)
244 {
245 setCurrAnimNumber (mAWindow, count);
246 ++count;
247- a->postPaintWindow ();
248+ a->postPaintWindow (transform);
249 }
250 }
251
252@@ -377,11 +378,20 @@
253 ++count;
254
255 if (animList.at (currentAnim)->paintWindowUsed ())
256- status |= animList.at (currentAnim)->paintWindow
257- (gWindow, wAttrib, wTransform, region, mask);
258+ status |= animList.at (currentAnim)->paintWindow (gWindow,
259+ wAttrib,
260+ wTransform,
261+ region,
262+ mask);
263 else
264- status |= gWindow->glPaint
265- (wAttrib, wTransform, region, mask);
266+ {
267+ unsigned int index = gWindow->glPaintGetCurrentIndex ();
268+ status |= gWindow->glPaint (wAttrib,
269+ wTransform,
270+ region,
271+ mask);
272+ gWindow->glPaintSetCurrentIndex (index);
273+ }
274 }
275
276 return status;
277
278=== modified file 'plugins/animation/src/animation.cpp'
279--- plugins/animation/src/animation.cpp 2015-03-16 18:45:33 +0000
280+++ plugins/animation/src/animation.cpp 2016-07-14 15:55:30 +0000
281@@ -1632,20 +1632,20 @@
282 if (mCurAnimation)
283 mCurAnimation->setCurPaintAttrib (attrib);
284
285- gWindow->glDrawTexture (texture, transform, attrib, mask);
286+ if (mCurAnimation)
287+ {
288+ if (mCurAnimation->initialized ())
289+ mCurAnimation->drawGeometry (texture, transform, attrib, mask);
290+ }
291+ else
292+ gWindow->glDrawTexture (texture, transform, attrib, mask);
293 }
294
295 #if 0 // Not ported yet
296 void
297 PrivateAnimWindow::glDrawGeometry ()
298 {
299- if (mCurAnimation)
300- {
301- if (mCurAnimation->initialized ())
302- mCurAnimation->drawGeometry ();
303- }
304- else
305- gWindow->glDrawGeometry ();
306+
307 }
308 #endif
309
310@@ -1658,11 +1658,15 @@
311 }
312
313 void
314-Animation::drawGeometry ()
315+Animation::drawGeometry (GLTexture *texture,
316+ const GLMatrix &transform,
317+ const GLWindowPaintAttrib &attrib,
318+ unsigned int mask)
319 {
320-#if 0 // Not ported yet
321- mAWindow->priv->gWindow->glDrawGeometry ();
322-#endif
323+ GLWindow::get (mAWindow->mWindow)->glDrawTexture (texture,
324+ transform,
325+ attrib,
326+ mask);
327 }
328
329 bool
330@@ -1731,18 +1735,7 @@
331 status = gWindow->glPaint (wAttrib, wTransform, region, mask);
332
333 if (mCurAnimation->postPaintWindowUsed ())
334- {
335-#if 0 // Not ported yet
336- // Transform to make post-paint coincide with the window
337- glPushMatrix ();
338- glLoadMatrixf (wTransform.getMatrix ());
339-#endif
340- mCurAnimation->postPaintWindow ();
341-
342-#if 0 // Not ported yet
343- glPopMatrix ();
344-#endif
345- }
346+ mCurAnimation->postPaintWindow (wTransform);
347
348 return status;
349 }
350
351=== modified file 'plugins/animation/src/glide.cpp'
352--- plugins/animation/src/glide.cpp 2015-03-02 08:48:27 +0000
353+++ plugins/animation/src/glide.cpp 2016-07-14 15:55:30 +0000
354@@ -167,7 +167,7 @@
355 }
356
357 void
358-GlideAnim::postPaintWindow ()
359+GlideAnim::postPaintWindow (const GLMatrix &transform)
360 {
361 if (90 < glideModRotAngle &&
362 glideModRotAngle < 270)
363
364=== modified file 'plugins/animation/src/grid.cpp'
365--- plugins/animation/src/grid.cpp 2013-07-24 17:36:47 +0000
366+++ plugins/animation/src/grid.cpp 2016-07-14 15:55:30 +0000
367@@ -388,12 +388,6 @@
368 }
369 }
370
371-void
372-GridAnim::drawGeometry ()
373-{
374- // Deprecated
375-}
376-
377 GridTransformAnim::GridTransformAnim (CompWindow *w,
378 WindowEvent curWindowEvent,
379 float duration,
380
381=== modified file 'plugins/animation/src/private.h'
382--- plugins/animation/src/private.h 2013-10-31 15:59:14 +0000
383+++ plugins/animation/src/private.h 2016-07-14 15:55:30 +0000
384@@ -588,7 +588,7 @@
385
386 void prePaintWindow ();
387 inline bool postPaintWindowUsed () { return true; }
388- void postPaintWindow ();
389+ void postPaintWindow (const GLMatrix &);
390 void adjustDuration ();
391 bool zoomToIcon ();
392 void applyTransform ();
393
394=== modified file 'plugins/animationaddon/CMakeLists.txt'
395--- plugins/animationaddon/CMakeLists.txt 2012-05-21 08:50:26 +0000
396+++ plugins/animationaddon/CMakeLists.txt 2016-07-14 15:55:30 +0000
397@@ -1,7 +1,4 @@
398 find_package (Compiz REQUIRED)
399 include (CompizPlugin)
400-include (FindOpenGL)
401
402-if (OPENGL_GLU_FOUND)
403- compiz_plugin (animationaddon PLUGINDEPS composite opengl animation LIBRARIES ${OPENGL_glu_LIBRARY} INCDIRS ${OPENGL_INCLUDE_DIR})
404-endif (OPENGL_GLU_FOUND)
405+compiz_plugin (animationaddon PLUGINDEPS composite opengl animation)
406
407=== modified file 'plugins/animationaddon/include/animationaddon/animationaddon.h'
408--- plugins/animationaddon/include/animationaddon/animationaddon.h 2010-01-27 16:32:40 +0000
409+++ plugins/animationaddon/include/animationaddon/animationaddon.h 2016-07-14 15:55:30 +0000
410@@ -97,7 +97,7 @@
411 GLuint blendMode);
412 ~ParticleSystem ();
413
414- void draw (int offsetX = 0, int offsetY = 0);
415+ void draw (const GLMatrix &transform, int offsetX = 0, int offsetY = 0);
416 void update (float time);
417 vector<Particle> &particles () { return mParticles; }
418 void activate () { mActive = true; }
419@@ -120,8 +120,8 @@
420
421 vector<GLfloat> mVerticesCache;
422 vector<GLfloat> mCoordsCache;
423- vector<GLfloat> mColorsCache;
424- vector<GLfloat> mDColorsCache;
425+ vector<GLushort> mColorsCache;
426+ vector<GLushort> mDColorsCache;
427 };
428
429 class ParticleAnim :
430@@ -135,7 +135,7 @@
431 const AnimEffect info,
432 const CompRect &icon);
433 ~ParticleAnim () {}
434- void postPaintWindow ();
435+ void postPaintWindow (const GLMatrix &);
436 bool postPaintWindowUsed () { return true; }
437 void updateBB (CompOutput &output);
438 bool updateBBUsed () { return true; }
439@@ -259,14 +259,17 @@
440
441 void step ();
442 void prePaintWindow ();
443- void postPaintWindow ();
444+ void postPaintWindow (const GLMatrix &);
445 bool postPaintWindowUsed () { return true; }
446 void addGeometry (const GLTexture::MatrixList &matrix,
447 const CompRegion &region,
448 const CompRegion &clipRegion,
449 unsigned int maxGridWidth,
450 unsigned int maxGridHeight);
451- void drawGeometry ();
452+ void drawGeometry (GLTexture *texture,
453+ const GLMatrix &transform,
454+ const GLWindowPaintAttrib &attrib,
455+ unsigned int mask);
456 virtual void updateBB (CompOutput &output);
457 bool updateBBUsed () { return true; }
458 bool prePreparePaint (int msSinceLastPaint);
459@@ -274,7 +277,8 @@
460
461 virtual void stepPolygon (PolygonObject *p,
462 float forwardProgress);
463- virtual void transformPolygon (const PolygonObject *p) {}
464+ virtual void transformPolygon (GLMatrix &matrix,
465+ const PolygonObject *p) {}
466
467 /// For effects that have decel. motion
468 virtual bool deceleratingMotion () { return false; }
469@@ -301,7 +305,8 @@
470 void processIntersectingPolygons ();
471 virtual void freePolygonObjects ();
472 void freeClipsPolygons ();
473- void prepareDrawingForAttrib (GLFragment::Attrib &attrib);
474+ void prepareDrawingForAttrib (GLWindowPaintAttrib &attrib,
475+ GLVertexBuffer &vertexBuffer);
476
477 int mNumDrawGeometryCalls;
478 int mNumClipsPassed; /**< # of clips passed to animAddWindowGeometry so far
479@@ -327,15 +332,16 @@
480 bool mIncludeShadows; ///< Whether to include shadows in polygon
481
482 private:
483- inline void drawPolygonClipIntersection (const PolygonObject *p,
484+ inline void drawPolygonClipIntersection (GLTexture *texture,
485+ const GLMatrix &transform,
486+ const PolygonObject *p,
487 const Clip4Polygons &c,
488 const GLfloat *vertexTexCoords,
489 int pass,
490 float forwardProgress,
491- GLdouble clipPlane[4][4],
492 const CompOutput &output,
493 float newOpacity,
494 bool decelerates,
495- GLfloat skewMat[16]);
496+ GLMatrix &skewMat);
497 };
498 #endif
499
500=== modified file 'plugins/animationaddon/src/airplane.cpp'
501--- plugins/animationaddon/src/airplane.cpp 2013-02-27 11:33:10 +0000
502+++ plugins/animationaddon/src/airplane.cpp 2016-07-14 15:55:30 +0000
503@@ -271,8 +271,8 @@
504 pv[22] = topLeftY;
505 pv[23] = -halfThick;
506
507- // 16 indices for 4 sides (for quad strip)
508- p->sideIndices = (GLushort *) calloc (4 * 4, sizeof (GLushort));
509+ // 24 indices for 4 sides (for triangle strip)
510+ p->sideIndices = (GLushort *) calloc (6 * 4, sizeof (GLushort));
511 if (!p->sideIndices)
512 {
513 compLogMessage ("animation", CompLogLevelError,
514@@ -287,22 +287,30 @@
515 ind[id++] = 0;
516 ind[id++] = 7;
517 ind[id++] = 6;
518- ind[id++] = 1;
519-
520- ind[id++] = 1;
521- ind[id++] = 6;
522- ind[id++] = 5;
523- ind[id++] = 2;
524-
525- ind[id++] = 2;
526- ind[id++] = 5;
527- ind[id++] = 4;
528- ind[id++] = 3;
529-
530- ind[id++] = 3;
531- ind[id++] = 4;
532- ind[id++] = 7;
533- ind[id++] = 0;
534+ ind[id++] = 0;
535+ ind[id++] = 1;
536+ ind[id++] = 6;
537+
538+ ind[id++] = 1;
539+ ind[id++] = 6;
540+ ind[id++] = 5;
541+ ind[id++] = 1;
542+ ind[id++] = 2;
543+ ind[id++] = 5;
544+
545+ ind[id++] = 2;
546+ ind[id++] = 5;
547+ ind[id++] = 4;
548+ ind[id++] = 2;
549+ ind[id++] = 3;
550+ ind[id++] = 4;
551+
552+ ind[id++] = 3;
553+ ind[id++] = 4;
554+ ind[id++] = 7;
555+ ind[id++] = 3;
556+ ind[id++] = 0;
557+ ind[id++] = 7;
558
559 if (i < 4)
560 {
561@@ -318,6 +326,8 @@
562 p->boundingBox.x2 = ceil (p->centerPos.x () + bottomRightX);
563 p->boundingBox.y2 = ceil (p->centerPos.y () + bottomLeftY);
564 }
565+
566+ p->normals = NULL;
567
568 i++;
569 }
570@@ -692,41 +702,42 @@
571 }
572
573 void
574-AirplaneAnim::transformPolygon (const PolygonObject *pol)
575+AirplaneAnim::transformPolygon (GLMatrix &matrix,
576+ const PolygonObject *pol)
577 {
578 AirplanePolygonObject *p = (AirplanePolygonObject *) pol;
579
580- glRotatef (p->flyRotation.x (), 1, 0, 0); //rotate on axis X
581- glRotatef (-p->flyRotation.y (), 0, 1, 0); // rotate on axis Y
582- glRotatef (p->flyRotation.z (), 0, 0, 1); // rotate on axis Z
583+ matrix.rotate (p->flyRotation.x (), 1, 0, 0); //rotate on axis X
584+ matrix.rotate (-p->flyRotation.y (), 0, 1, 0); // rotate on axis Y
585+ matrix.rotate (p->flyRotation.z (), 0, 0, 1); // rotate on axis Z
586
587- glScalef (1.0 / (1.0 + p->flyScale),
588- 1.0 / (1.0 + p->flyScale), 1.0 / (1.0 + p->flyScale));
589+ matrix.scale (1.0 / (1.0 + p->flyScale),
590+ 1.0 / (1.0 + p->flyScale), 1.0 / (1.0 + p->flyScale));
591
592 // Move by "rotation axis offset A"
593- glTranslatef (p->rotAxisOffsetA.x (), p->rotAxisOffsetA.y (),
594- p->rotAxisOffsetA.z ());
595+ matrix.translate (p->rotAxisOffsetA.x (), p->rotAxisOffsetA.y (),
596+ p->rotAxisOffsetA.z ());
597
598 // Rotate by desired angle A
599- glRotatef (p->rotAngleA, p->rotAxisA.x (), p->rotAxisA.y (),
600- p->rotAxisA.z ());
601+ matrix.rotate (p->rotAngleA, p->rotAxisA.x (), p->rotAxisA.y (),
602+ p->rotAxisA.z ());
603
604 // Move back to center from A
605- glTranslatef (-p->rotAxisOffsetA.x (), -p->rotAxisOffsetA.y (),
606- -p->rotAxisOffsetA.z ());
607+ matrix.translate (-p->rotAxisOffsetA.x (), -p->rotAxisOffsetA.y (),
608+ -p->rotAxisOffsetA.z ());
609
610
611 // Move by "rotation axis offset B"
612- glTranslatef (p->rotAxisOffsetB.x (), p->rotAxisOffsetB.y (),
613- p->rotAxisOffsetB.z ());
614+ matrix.translate (p->rotAxisOffsetB.x (), p->rotAxisOffsetB.y (),
615+ p->rotAxisOffsetB.z ());
616
617 // Rotate by desired angle B
618- glRotatef (p->rotAngleB, p->rotAxisB.x (), p->rotAxisB.y (),
619- p->rotAxisB.z ());
620+ matrix.rotate (p->rotAngleB, p->rotAxisB.x (), p->rotAxisB.y (),
621+ p->rotAxisB.z ());
622
623 // Move back to center from B
624- glTranslatef (-p->rotAxisOffsetB.x (), -p->rotAxisOffsetB.y (),
625- -p->rotAxisOffsetB.z ());
626+ matrix.translate (-p->rotAxisOffsetB.x (), -p->rotAxisOffsetB.y (),
627+ -p->rotAxisOffsetB.z ());
628 }
629
630
631
632=== modified file 'plugins/animationaddon/src/animationaddon.cpp'
633--- plugins/animationaddon/src/animationaddon.cpp 2013-05-09 13:43:07 +0000
634+++ plugins/animationaddon/src/animationaddon.cpp 2016-07-14 15:55:30 +0000
635@@ -81,7 +81,7 @@
636 #include "private.h"
637
638 class AnimAddonPluginVTable :
639- public CompPlugin::VTableForScreenAndWindow<AnimAddonScreen, AnimAddonWindow>
640+ public CompPlugin::VTableForScreenAndWindow<AnimAddonScreen, AnimAddonWindow, ANIMATIONADDON_ABI>
641 {
642 public:
643 bool init ();
644@@ -232,7 +232,7 @@
645 }
646
647 AnimAddonWindow::AnimAddonWindow (CompWindow *w) :
648- PluginClassHandler<AnimAddonWindow, CompWindow> (w),
649+ PluginClassHandler<AnimAddonWindow, CompWindow, ANIMATIONADDON_ABI> (w),
650 mWindow (w),
651 aWindow (AnimWindow::get (w))
652 {
653
654=== modified file 'plugins/animationaddon/src/dissolve.cpp'
655--- plugins/animationaddon/src/dissolve.cpp 2010-08-23 03:24:20 +0000
656+++ plugins/animationaddon/src/dissolve.cpp 2016-07-14 15:55:30 +0000
657@@ -33,7 +33,7 @@
658 float o = 0.2;
659 float factor = (4 - layer) * o;
660
661- attrib.opacity *= o / (1.0 - factor);
662+ attrib.opacity *= (o / (1.0 - factor)) * (1.0 - getDissolveSingleProgress ());
663 }
664
665 void
666@@ -62,5 +62,14 @@
667 void
668 DissolveSingleAnim::updateBB (CompOutput &output)
669 {
670- mAWindow->expandBBWithWindow ();
671+ CompRect outRect (mAWindow->mWindow->outputRect ());
672+
673+ Box windowBox =
674+ {
675+ static_cast <short int> (outRect.x () - 4),
676+ static_cast <short int> (outRect.x () + outRect.width () + 4),
677+ static_cast <short int> (outRect.y () - 4),
678+ static_cast <short int> (outRect.y () + outRect.height () + 4)
679+ };
680+ mAWindow->expandBBWithBox (windowBox);
681 }
682
683=== modified file 'plugins/animationaddon/src/particle.cpp'
684--- plugins/animationaddon/src/particle.cpp 2013-02-27 11:33:10 +0000
685+++ plugins/animationaddon/src/particle.cpp 2016-07-14 15:55:30 +0000
686@@ -81,7 +81,7 @@
687 }
688
689 void
690-ParticleSystem::draw (int offsetX, int offsetY)
691+ParticleSystem::draw (const GLMatrix &transform, int offsetX, int offsetY)
692 {
693 // TODO
694 // The part below should ideally be done in ParticleSystem constructor
695@@ -95,9 +95,8 @@
696 GL_RGBA, GL_UNSIGNED_BYTE, fireTex);
697 glBindTexture (GL_TEXTURE_2D, 0);
698
699-
700- glPushMatrix ();
701- glTranslated (offsetX - mX, offsetY - mY, 0);
702+ GLMatrix translatedMatrix (transform);
703+ //translatedMatrix.translate (offsetX - mX, offsetY - mY, 0);
704
705 glEnable (GL_BLEND);
706 if (mTex)
707@@ -105,26 +104,27 @@
708 glBindTexture (GL_TEXTURE_2D, mTex);
709 glEnable (GL_TEXTURE_2D);
710 }
711- mGScreen->setTexEnvMode (GL_MODULATE);
712
713- mVerticesCache.resize (4 * 3 * mParticles.size ());
714- mCoordsCache.resize (4 * 2 * mParticles.size ());
715- mColorsCache.resize (4 * 4 * mParticles.size ());
716+ mVerticesCache.resize (6 * 3 * mParticles.size ());
717+ mCoordsCache.resize (6 * 2 * mParticles.size ());
718+ mColorsCache.resize (6 * 4 * mParticles.size ());
719 if (mDarkenAmount > 0)
720- mDColorsCache.resize (4 * 4 * mParticles.size ());
721+ mDColorsCache.resize (6 * 4 * mParticles.size ());
722
723- GLfloat *dcolors = &mDColorsCache[0];
724+ GLushort *dcolors = &mDColorsCache[0];
725 GLfloat *vertices = &mVerticesCache[0];
726 GLfloat *coords = &mCoordsCache[0];
727- GLfloat *colors = &mColorsCache[0];
728+ GLushort *colors = &mColorsCache[0];
729
730- int cornersSize = sizeof (GLfloat) * 8;
731+ int cornersSize = sizeof (GLfloat) * 12;
732 int colorSize = sizeof (GLfloat) * 4;
733
734- GLfloat cornerCoords[8] = {0.0, 0.0,
735+ GLfloat cornerCoords[12] = {0.0, 0.0,
736 0.0, 1.0,
737 1.0, 1.0,
738- 1.0, 0.0};
739+ 1.0, 1.0,
740+ 1.0, 0.0,
741+ 0.0, 0.0};
742
743 int numActive = 0;
744
745@@ -133,7 +133,7 @@
746 if (part.life <= 0.0f) // Ignore dead particles
747 continue;
748
749- numActive += 4;
750+ numActive += 6;
751
752 float w = part.width / 2;
753 float h = part.height / 2;
754@@ -154,24 +154,34 @@
755 vertices[8] = part.z;
756
757 vertices[9] = part.x + w;
758- vertices[10] = part.y - h;
759+ vertices[10] = part.y + h;
760 vertices[11] = part.z;
761
762- vertices += 12;
763+ vertices[12] = part.x + w;
764+ vertices[13] = part.y - h;
765+ vertices[14] = part.z;
766+
767+ vertices[15] = part.x - w;
768+ vertices[16] = part.y - h;
769+ vertices[17] = part.z;
770+
771+ vertices += 18;
772
773 memcpy (coords, cornerCoords, cornersSize);
774
775- coords += 8;
776+ coords += 12;
777
778- colors[0] = part.r;
779- colors[1] = part.g;
780- colors[2] = part.b;
781- colors[3] = part.life * part.a;
782+ colors[0] = part.r * COLOR;
783+ colors[1] = part.g * COLOR;
784+ colors[2] = part.b * COLOR;
785+ colors[3] = part.life * part.a * COLOR;
786 memcpy (colors + 4, colors, colorSize);
787 memcpy (colors + 8, colors, colorSize);
788 memcpy (colors + 12, colors, colorSize);
789+ memcpy (colors + 16, colors, colorSize);
790+ memcpy (colors + 20, colors, colorSize);
791
792- colors += 16;
793+ colors += 24;
794
795 if (mDarkenAmount > 0)
796 {
797@@ -182,34 +192,35 @@
798 memcpy (dcolors + 4, dcolors, colorSize);
799 memcpy (dcolors + 8, dcolors, colorSize);
800 memcpy (dcolors + 12, dcolors, colorSize);
801+ memcpy (dcolors + 16, dcolors, colorSize);
802+ memcpy (dcolors + 20, dcolors, colorSize);
803
804- dcolors += 16;
805+ dcolors += 24;
806 }
807 }
808
809- glEnableClientState (GL_COLOR_ARRAY);
810-
811- glTexCoordPointer (2, GL_FLOAT, 2 * sizeof (GLfloat), &mCoordsCache[0]);
812- glVertexPointer (3, GL_FLOAT, 3 * sizeof (GLfloat), &mVerticesCache[0]);
813+ GLVertexBuffer *stream = GLVertexBuffer::streamingBuffer ();
814
815 // darken the background
816 if (mDarkenAmount > 0)
817 {
818 glBlendFunc (GL_ZERO, GL_ONE_MINUS_SRC_ALPHA);
819- glColorPointer (4, GL_FLOAT, 4 * sizeof (GLfloat), &mDColorsCache[0]);
820- glDrawArrays (GL_QUADS, 0, numActive);
821+ stream->begin (GL_TRIANGLES);
822+ stream->addTexCoords (0, numActive, &mCoordsCache[0]);
823+ stream->addVertices (numActive, &mVerticesCache[0]);
824+ stream->addColors (numActive, &mDColorsCache[0]);
825+ if (stream->end ())
826+ stream->render (translatedMatrix);
827 }
828 // draw particles
829 glBlendFunc (GL_SRC_ALPHA, mBlendMode);
830
831- glColorPointer (4, GL_FLOAT, 4 * sizeof (GLfloat), &mColorsCache[0]);
832- glDrawArrays (GL_QUADS, 0, numActive);
833- glDisableClientState (GL_COLOR_ARRAY);
834-
835- glPopMatrix ();
836- glColor4usv (defaultColor);
837-
838- mGScreen->setTexEnvMode (GL_REPLACE);
839+ stream->begin (GL_TRIANGLES);
840+ stream->addTexCoords (0, numActive, &mCoordsCache[0]);
841+ stream->addVertices (numActive, &mVerticesCache[0]);
842+ stream->addColors (numActive, &mColorsCache[0]);
843+ if (stream->end ())
844+ stream->render (translatedMatrix);
845
846 glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
847 glDisable (GL_TEXTURE_2D);
848@@ -217,12 +228,13 @@
849 }
850
851 void
852-ParticleAnim::postPaintWindow ()
853+ParticleAnim::postPaintWindow (const GLMatrix &transform)
854 {
855 foreach (ParticleSystem &ps, mParticleSystems)
856 if (ps.active ())
857 // offset by window pos.
858- ps.draw (mWindow->x () - mWindow->output ().left,
859+ ps.draw (transform,
860+ mWindow->x () - mWindow->output ().left,
861 mWindow->y () - mWindow->output ().top);
862 }
863
864
865=== modified file 'plugins/animationaddon/src/polygon.cpp'
866--- plugins/animationaddon/src/polygon.cpp 2013-02-27 11:33:10 +0000
867+++ plugins/animationaddon/src/polygon.cpp 2016-07-14 15:55:30 +0000
868@@ -34,7 +34,6 @@
869 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
870 */
871
872-#include <GL/glu.h>
873 #include "private.h"
874
875 static const unsigned short MIN_WINDOW_GRID_SIZE = 10;
876@@ -256,8 +255,8 @@
877 pv[22] = -halfH;
878 pv[23] = -halfThick;
879
880- // 16 indices for 4 sides (for quads)
881- p->sideIndices = (GLushort *)calloc (4 * 4, sizeof (GLushort));
882+ // 24 indices for 4 sides (for triangles)
883+ p->sideIndices = (GLushort *)calloc (6 * 4, sizeof (GLushort));
884 if (!p->sideIndices)
885 {
886 compLogMessage ("animationaddon", CompLogLevelError,
887@@ -275,6 +274,8 @@
888 ind[id++] = 6; // First vertex
889 ind[id++] = 1;
890 ind[id++] = 0;
891+ ind[id++] = 6;
892+ ind[id++] = 0;
893 ind[id++] = 7;
894 nor[6 * 3 + 0] = -1; // Flat shading only uses 1st vertex's normal
895 nor[6 * 3 + 1] = 0; // in a polygon, vertex 6 for this face.
896@@ -284,16 +285,20 @@
897 ind[id++] = 1;
898 ind[id++] = 6;
899 ind[id++] = 5;
900+ ind[id++] = 5;
901 ind[id++] = 2;
902+ ind[id++] = 1;
903 nor[1 * 3 + 0] = 0;
904 nor[1 * 3 + 1] = 1;
905 nor[1 * 3 + 2] = 0;
906
907 // Right face
908+ ind[id++] = 5;
909 ind[id++] = 2;
910+ ind[id++] = 3;
911 ind[id++] = 5;
912+ ind[id++] = 3;
913 ind[id++] = 4;
914- ind[id++] = 3;
915 nor[2 * 3 + 0] = 1;
916 nor[2 * 3 + 1] = 0;
917 nor[2 * 3 + 2] = 0;
918@@ -302,7 +307,9 @@
919 ind[id++] = 7;
920 ind[id++] = 0;
921 ind[id++] = 3;
922+ ind[id++] = 3;
923 ind[id++] = 4;
924+ ind[id++] = 7;
925 nor[7 * 3 + 0] = 0;
926 nor[7 * 3 + 1] = -1;
927 nor[7 * 3 + 2] = 0;
928@@ -541,8 +548,8 @@
929 pv[34] = topY;
930 pv[35] = -halfThick;
931
932- // 24 indices per 6 sides (for quads)
933- p->sideIndices = (GLushort *)calloc (4 * 6, sizeof (GLushort));
934+ // 36 indices per 6 sides (for triangles)
935+ p->sideIndices = (GLushort *)calloc (6 * 6, sizeof (GLushort));
936 if (!p->sideIndices)
937 {
938 compLogMessage ("animationaddon", CompLogLevelError,
939@@ -562,7 +569,9 @@
940 ind[id++] = 11; // First vertex
941 ind[id++] = 10;
942 ind[id++] = 1;
943+ ind[id++] = 1;
944 ind[id++] = 0;
945+ ind[id++] = 11;
946 nor[11 * 3 + 0] = -1; // Flat shading only uses 1st vertex's normal
947 nor[11 * 3 + 1] = -1; // in a polygon, vertex 11 for this face.
948 nor[11 * 3 + 2] = 0;
949@@ -573,7 +582,9 @@
950 ind[id++] = 1;
951 ind[id++] = 10;
952 ind[id++] = 9;
953+ ind[id++] = 9;
954 ind[id++] = 2;
955+ ind[id++] = 1;
956 nor[1 * 3 + 0] = -1;
957 nor[1 * 3 + 1] = 0;
958 nor[1 * 3 + 2] = 0;
959@@ -582,7 +593,9 @@
960 ind[id++] = 2;
961 ind[id++] = 9;
962 ind[id++] = 8;
963+ ind[id++] = 8;
964 ind[id++] = 3;
965+ ind[id++] = 2;
966 nor[2 * 3 + 0] = -1;
967 nor[2 * 3 + 1] = 1;
968 nor[2 * 3 + 2] = 0;
969@@ -593,7 +606,9 @@
970 ind[id++] = 3;
971 ind[id++] = 8;
972 ind[id++] = 7;
973+ ind[id++] = 7;
974 ind[id++] = 4;
975+ ind[id++] = 3;
976 nor[3 * 3 + 0] = 1;
977 nor[3 * 3 + 1] = 1;
978 nor[3 * 3 + 2] = 0;
979@@ -604,7 +619,9 @@
980 ind[id++] = 4;
981 ind[id++] = 7;
982 ind[id++] = 6;
983+ ind[id++] = 6;
984 ind[id++] = 5;
985+ ind[id++] = 4;
986 nor[4 * 3 + 0] = 1;
987 nor[4 * 3 + 1] = 0;
988 nor[4 * 3 + 2] = 0;
989@@ -613,7 +630,9 @@
990 ind[id++] = 5;
991 ind[id++] = 6;
992 ind[id++] = 11;
993+ ind[id++] = 11;
994 ind[id++] = 0;
995+ ind[id++] = 5;
996 nor[5 * 3 + 0] = 1;
997 nor[5 * 3 + 1] = -1;
998 nor[5 * 3 + 2] = 0;
999@@ -946,8 +965,8 @@
1000 pv[22] = -shards[yc][xc].centerY + shards[yc][xc].pt3Y;
1001 pv[23] = -halfThick;
1002
1003- // 16 indices for 4 sides (for quads)
1004- p->sideIndices = (GLushort *)calloc (4 * 4, sizeof (GLushort));
1005+ // 24 indices for 4 sides (for triangles)
1006+ p->sideIndices = (GLushort *)calloc (6 * 4, sizeof (GLushort));
1007 if (!p->sideIndices)
1008 {
1009 compLogMessage ("animationaddon",
1010@@ -965,7 +984,9 @@
1011 ind[id++] = 6; // First vertex
1012 ind[id++] = 1;
1013 ind[id++] = 0;
1014+ ind[id++] = 6;
1015 ind[id++] = 7;
1016+ ind[id++] = 0;
1017 nor[6 * 3 + 0] = -1; // Flat shading only uses 1st vertex's normal
1018 nor[6 * 3 + 1] = 0; // in a polygon, vertex 6 for this face.
1019 nor[6 * 3 + 2] = 0;
1020@@ -974,7 +995,9 @@
1021 ind[id++] = 1;
1022 ind[id++] = 6;
1023 ind[id++] = 5;
1024+ ind[id++] = 1;
1025 ind[id++] = 2;
1026+ ind[id++] = 5;
1027 nor[1 * 3 + 0] = 0;
1028 nor[1 * 3 + 1] = 1;
1029 nor[1 * 3 + 2] = 0;
1030@@ -983,7 +1006,9 @@
1031 ind[id++] = 2;
1032 ind[id++] = 5;
1033 ind[id++] = 4;
1034+ ind[id++] = 2;
1035 ind[id++] = 3;
1036+ ind[id++] = 4;
1037 nor[2 * 3 + 0] = 1;
1038 nor[2 * 3 + 1] = 0;
1039 nor[2 * 3 + 2] = 0;
1040@@ -992,7 +1017,9 @@
1041 ind[id++] = 7;
1042 ind[id++] = 0;
1043 ind[id++] = 3;
1044+ ind[id++] = 7;
1045 ind[id++] = 4;
1046+ ind[id++] = 3;
1047 nor[7 * 3 + 0] = 0;
1048 nor[7 * 3 + 1] = -1;
1049 nor[7 * 3 + 2] = 0;
1050@@ -1067,8 +1094,11 @@
1051 if (!matrix.size ())
1052 return;
1053
1054- GLWindow::Geometry &geometry = GLWindow::get (mWindow)->geometry ();
1055- geometry.vCount = 1; // Force glDrawGeometry to be called
1056+ /* Force glDrawTexture to be called by pushing a single vertex into the
1057+ * window's vertex buffer */
1058+ GLWindow *gWindow = GLWindow::get (mWindow);
1059+ GLfloat vertexData[3] = {0.0f, 0.0f, 0.0f};
1060+ gWindow->vertexBuffer ()->addVertices (1, vertexData);
1061
1062 bool dontStoreClips = true;
1063
1064@@ -1298,56 +1328,62 @@
1065 }
1066
1067 void
1068-PolygonAnim::prepareDrawingForAttrib (GLFragment::Attrib &attrib)
1069-{
1070- if (GL::canDoSaturated && attrib.getSaturation () != COLOR)
1071- {
1072- GLfloat constant[4];
1073-
1074- if (GL::canDoSlightlySaturated && attrib.getSaturation () > 0)
1075- {
1076- constant[3] = attrib.getOpacity () / 65535.0f;
1077- constant[0] = constant[1] = constant[2] = constant[3] *
1078- attrib.getBrightness () / 65535.0f;
1079-
1080- glTexEnvfv (GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, constant);
1081- }
1082- else
1083- {
1084- constant[3] = attrib.getOpacity () / 65535.0f;
1085- constant[0] = constant[1] = constant[2] = constant[3] *
1086- attrib.getBrightness () / 65535.0f;
1087-
1088- constant[0] = 0.5f + 0.5f * RED_SATURATION_WEIGHT * constant[0];
1089- constant[1] = 0.5f + 0.5f * GREEN_SATURATION_WEIGHT * constant[1];
1090- constant[2] = 0.5f + 0.5f * BLUE_SATURATION_WEIGHT * constant[2];
1091-
1092- glTexEnvfv (GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, constant);
1093- }
1094- }
1095- else
1096- {
1097- attrib.setBrightness (0.76 * attrib.getBrightness ());
1098-
1099- GLushort color =
1100- (attrib.getOpacity () * attrib.getBrightness ()) >> 16;
1101-
1102- mGScreen->setTexEnvMode (GL_MODULATE);
1103- glColor4us (color, color, color, attrib.getOpacity ());
1104+PolygonAnim::prepareDrawingForAttrib (GLWindowPaintAttrib &attrib,
1105+ GLVertexBuffer &vertexBuffer)
1106+{
1107+ // Disabled for now until lighting can be re-written
1108+ // attrib.brightness *= 0.76;
1109+ GLushort color = (attrib.brightness * attrib.opacity) >> 16;
1110+ GLfloat colorNormalized = color / static_cast <GLfloat> (COLOR);
1111+
1112+ vertexBuffer.color4f (colorNormalized,
1113+ colorNormalized,
1114+ colorNormalized,
1115+ attrib.opacity / static_cast <GLfloat> (COLOR));
1116+}
1117+
1118+namespace
1119+{
1120+ enum class Winding : int
1121+ {
1122+ Clockwise = 0,
1123+ Counterclockwise = 1
1124+ };
1125+
1126+ /* This function assumes that indices is large enough to
1127+ * hold a polygon of nSides sides */
1128+ unsigned int determineIndicesForPolygon (GLushort *indices,
1129+ GLushort nSides,
1130+ Winding direction)
1131+ {
1132+ unsigned int index = 0;
1133+ bool front = direction == Winding::Counterclockwise;
1134+
1135+ for (GLushort i = 2; i < nSides; ++i)
1136+ {
1137+ indices[index] = 0;
1138+ indices[index + 1] = (front ? (i - 1) : i);
1139+ indices[index + 2] = (front ? i : (i - 1));
1140+
1141+ index += 3;
1142+ }
1143+
1144+ return index;
1145 }
1146 }
1147
1148 inline void
1149-PolygonAnim::drawPolygonClipIntersection (const PolygonObject *p,
1150+PolygonAnim::drawPolygonClipIntersection (GLTexture *texture,
1151+ const GLMatrix &transform,
1152+ const PolygonObject *p,
1153 const Clip4Polygons &c,
1154 const GLfloat *vertexTexCoords,
1155 int pass,
1156 float forwardProgress,
1157- GLdouble clipPlanes[4][4],
1158 const CompOutput &output,
1159 float newOpacity,
1160 bool decelerates,
1161- GLfloat skewMat[16])
1162+ GLMatrix &skewMat)
1163 {
1164 int nSides = p->nSides;
1165 float newOpacityPolygon = newOpacity;
1166@@ -1386,52 +1422,56 @@
1167 else if (newOpacityPolygon > 0.9999) // if fully opaque
1168 return; // draw only non-opaque ones in pass 1
1169
1170- glPushMatrix ();
1171+ GLMatrix polygonTransform (transform);
1172
1173 if (mCorrectPerspective == CorrectPerspectivePolygon)
1174- getPerspectiveCorrectionMat (p, skewMat, NULL, output);
1175+ getPerspectiveCorrectionMat (p, NULL, &skewMat, output);
1176
1177 if (mCorrectPerspective != CorrectPerspectiveNone)
1178- glMultMatrixf (skewMat);
1179+ polygonTransform *= skewMat;
1180
1181 // Center
1182- glTranslatef (p->centerPos.x (),
1183- p->centerPos.y (),
1184- p->centerPos.z ());
1185+ polygonTransform.translate (p->centerPos.x (),
1186+ p->centerPos.y (),
1187+ p->centerPos.z ());
1188
1189 // Scale z first
1190- glScalef (1.0f, 1.0f, 1.0f / ::screen->width ());
1191+ polygonTransform.scale (1.0f, 1.0f, 1.0f / ::screen->width ());
1192
1193- transformPolygon (p);
1194+ transformPolygon (polygonTransform, p);
1195
1196 // Move by "rotation axis offset"
1197- glTranslatef (p->rotAxisOffset.x (),
1198- p->rotAxisOffset.y (),
1199- p->rotAxisOffset.z ());
1200+ polygonTransform.translate (p->rotAxisOffset.x (),
1201+ p->rotAxisOffset.y (),
1202+ p->rotAxisOffset.z ());
1203
1204 // Rotate by desired angle
1205- glRotatef (p->rotAngle,
1206- p->rotAxis.x (), p->rotAxis.y (), p->rotAxis.z ());
1207+ polygonTransform.rotate (p->rotAngle,
1208+ p->rotAxis.x (),
1209+ p->rotAxis.y (),
1210+ p->rotAxis.z ());
1211
1212 // Move back to center
1213- glTranslatef (-p->rotAxisOffset.x (),
1214- -p->rotAxisOffset.y (),
1215- -p->rotAxisOffset.z ());
1216+ polygonTransform.translate (-p->rotAxisOffset.x (),
1217+ -p->rotAxisOffset.y (),
1218+ -p->rotAxisOffset.z ());
1219
1220 // Scale back
1221- glScalef (1.0f, 1.0f, ::screen->width ());
1222-
1223- clipPlanes[0][3] = -(c.boxf.x1 - p->centerPosStart.x ());
1224- clipPlanes[1][3] = -(c.boxf.y1 - p->centerPosStart.y ());
1225- clipPlanes[2][3] = (c.boxf.x2 - p->centerPosStart.x ());
1226- clipPlanes[3][3] = (c.boxf.y2 - p->centerPosStart.y ());
1227- glClipPlane (GL_CLIP_PLANE0, clipPlanes[0]);
1228- glClipPlane (GL_CLIP_PLANE1, clipPlanes[1]);
1229- glClipPlane (GL_CLIP_PLANE2, clipPlanes[2]);
1230- glClipPlane (GL_CLIP_PLANE3, clipPlanes[3]);
1231-
1232- for (int k = 0; k < 4; k++)
1233- glEnable (GL_CLIP_PLANE0 + k);
1234+ polygonTransform.scale (1.0f, 1.0f, ::screen->width ());
1235+
1236+ // clipPlanes[0][3] = -(c.boxf.x1 - p->centerPosStart.x ());
1237+ // clipPlanes[1][3] = -(c.boxf.y1 - p->centerPosStart.y ());
1238+ // clipPlanes[2][3] = (c.boxf.x2 - p->centerPosStart.x ());
1239+ // clipPlanes[3][3] = (c.boxf.y2 - p->centerPosStart.y ());
1240+ // Clip planes are not supported on Modern OpenGL
1241+ //
1242+ // glClipPlane (GL_CLIP_PLANE0, clipPlanes[0]);
1243+ // glClipPlane (GL_CLIP_PLANE1, clipPlanes[1]);
1244+ // glClipPlane (GL_CLIP_PLANE2, clipPlanes[2]);
1245+ // glClipPlane (GL_CLIP_PLANE3, clipPlanes[3]);
1246+ // for (int k = 0; k < 4; k++)
1247+ // glEnable (GL_CLIP_PLANE0 + k);
1248+
1249 bool fadeBackAndSides =
1250 mBackAndSidesFadeDur > 0 &&
1251 forwardProgress <= mBackAndSidesFadeDur;
1252@@ -1445,56 +1485,92 @@
1253 (forwardProgress / mBackAndSidesFadeDur);
1254 }
1255
1256- GLFragment::Attrib attrib = mCurPaintAttrib;
1257- attrib.setOpacity (newOpacityPolygon2 * OPAQUE);
1258+ GLWindowPaintAttrib attrib = mCurPaintAttrib;
1259+ attrib.opacity = newOpacityPolygon2 * OPAQUE;
1260
1261- prepareDrawingForAttrib (attrib);
1262+ GLVertexBuffer *streamingVertexBuffer = GLVertexBuffer::streamingBuffer ();
1263
1264 // Draw back face
1265- glVertexPointer (3, GL_FLOAT, 0, p->vertices + 3 * nSides);
1266- if (mThickness > 0)
1267- glNormalPointer (GL_FLOAT, 0, p->normals + 3 * nSides);
1268- else
1269- glNormal3f (0.0f, 0.0f, -1.0f);
1270- glTexCoordPointer (2, GL_FLOAT, 0, &vertexTexCoords[2 * nSides]);
1271- glDrawArrays (GL_POLYGON, 0, nSides);
1272+ glActiveTexture (GL_TEXTURE0);
1273+ texture->enable (GLTexture::Fast);
1274+ streamingVertexBuffer->begin (GL_TRIANGLES);
1275+ streamingVertexBuffer->addVertices (nSides, p->vertices + 3 * nSides);
1276+ if (p->normals)
1277+ streamingVertexBuffer->addNormals (nSides, p->normals + 3 * nSides);
1278+ streamingVertexBuffer->addTexCoords (0, nSides, &vertexTexCoords[2 * nSides]);
1279+ if (streamingVertexBuffer->end ())
1280+ {
1281+ GLushort indices[64];
1282+ unsigned int nIndices = determineIndicesForPolygon (indices,
1283+ nSides,
1284+ Winding::Counterclockwise);
1285+ streamingVertexBuffer->render (polygonTransform,
1286+ attrib,
1287+ indices,
1288+ nIndices);
1289+ }
1290
1291- // Vertex coords
1292- glVertexPointer (3, GL_FLOAT, 0, p->vertices);
1293- if (mThickness > 0)
1294- glNormalPointer (GL_FLOAT, 0, p->normals);
1295- else
1296- glNormal3f (0.0f, 0.0f, 1.0f);
1297- glTexCoordPointer (2, GL_FLOAT, 0, vertexTexCoords);
1298+ // GL_QUADS uses a different vertex normal than the first
1299+ // so I use GL_TRIANGLES to make sure the normals are right.
1300+ texture->disable ();
1301+ streamingVertexBuffer->begin (GL_TRIANGLES);
1302+ streamingVertexBuffer->addVertices (p->nVertices, p->vertices);
1303+ prepareDrawingForAttrib (attrib, *streamingVertexBuffer);
1304+ if (mThickness > 0 && p->normals)
1305+ streamingVertexBuffer->addNormals (nSides, p->normals);
1306
1307 // Draw quads for sides
1308- for (int k = 0; k < nSides; k++)
1309+ if (streamingVertexBuffer->end ())
1310 {
1311- // GL_QUADS uses a different vertex normal than the first
1312- // so I use GL_POLYGON to make sure the normals are right.
1313- glDrawElements (GL_POLYGON, 4,
1314- GL_UNSIGNED_SHORT,
1315- p->sideIndices + k * 4);
1316+ for (int k = 0; k < nSides; k++)
1317+ streamingVertexBuffer->render (polygonTransform,
1318+ attrib,
1319+ p->sideIndices + k * 6,
1320+ 6);
1321 }
1322
1323+ streamingVertexBuffer->colorDefault ();
1324+
1325+ texture->enable (GLTexture::Fast);
1326+ streamingVertexBuffer->begin (GL_TRIANGLES);
1327 // if opacity was changed just above
1328 if (fadeBackAndSides)
1329 {
1330 // Go back to normal opacity for front face
1331 attrib = mCurPaintAttrib;
1332- attrib.setOpacity (newOpacityPolygon * OPAQUE);
1333- prepareDrawingForAttrib (attrib);
1334- }
1335- // Draw front face
1336- glDrawArrays (GL_POLYGON, 0, nSides);
1337- for (int k = 0; k < 4; k++)
1338- glDisable (GL_CLIP_PLANE0 + k);
1339-
1340- glPopMatrix ();
1341+ attrib.opacity = newOpacityPolygon * OPAQUE;
1342+ }
1343+ streamingVertexBuffer->addVertices (nSides, p->vertices);
1344+ if (p->normals)
1345+ streamingVertexBuffer->addNormals (nSides, p->normals);
1346+ streamingVertexBuffer->addTexCoords (0, nSides, vertexTexCoords);
1347+ if (streamingVertexBuffer->end ())
1348+ {
1349+ GLushort indices[64];
1350+ unsigned int nIndices = determineIndicesForPolygon (indices,
1351+ nSides,
1352+ Winding::Counterclockwise);
1353+ streamingVertexBuffer->render (polygonTransform,
1354+ attrib,
1355+ indices,
1356+ nIndices);
1357+ }
1358+
1359+ streamingVertexBuffer->colorDefault ();
1360+
1361+ texture->disable ();
1362+
1363+ // Clip planes are not supported on Modern OpenGL
1364+ //
1365+ // for (int k = 0; k < 4; k++)
1366+ // glDisable (GL_CLIP_PLANE0 + k);
1367 }
1368
1369 void
1370-PolygonAnim::drawGeometry ()
1371+PolygonAnim::drawGeometry (GLTexture *texture,
1372+ const GLMatrix &transform,
1373+ const GLWindowPaintAttrib &attrib,
1374+ unsigned int mask)
1375 {
1376 mNumDrawGeometryCalls++;
1377
1378@@ -1540,96 +1616,52 @@
1379
1380 // OpenGL stuff starts here
1381
1382- GLboolean normalArrayWas = false;
1383-
1384- if (mThickness > 0)
1385- {
1386- glPushAttrib (GL_NORMALIZE);
1387- glEnable (GL_NORMALIZE);
1388-
1389- normalArrayWas = glIsEnabled (GL_NORMAL_ARRAY);
1390- glEnableClientState (GL_NORMAL_ARRAY);
1391- }
1392-
1393- if (mDoLighting)
1394- {
1395- glPushAttrib (GL_SHADE_MODEL);
1396- glShadeModel (GL_FLAT);
1397-
1398- glPushAttrib (GL_LIGHT0);
1399- glPushAttrib (GL_COLOR_MATERIAL);
1400- glPushAttrib (GL_LIGHTING);
1401- glEnable (GL_COLOR_MATERIAL);
1402- glEnable (GL_LIGHTING);
1403-
1404- GLfloat ambientLight[] = { 0.3f, 0.3f, 0.3f, 0.3f };
1405- GLfloat diffuseLight[] = { 0.9f, 0.9f, 0.9f, 0.9f };
1406- GLfloat light0Position[] = { -0.5f, 0.5f, 9.0f, 0.0f };
1407-
1408- glLightfv (GL_LIGHT0, GL_AMBIENT, ambientLight);
1409- glLightfv (GL_LIGHT0, GL_DIFFUSE, diffuseLight);
1410- glLightfv (GL_LIGHT0, GL_POSITION, light0Position);
1411- }
1412-
1413- glPushMatrix ();
1414-
1415- glPushAttrib (GL_STENCIL_BUFFER_BIT);
1416- glDisable (GL_STENCIL_TEST);
1417+ // Lighting will require special shaders, which aren't
1418+ // implemented right now, so disable it.
1419+ //
1420+ // if (mDoLighting)
1421+ // {
1422+ // glPushAttrib (GL_SHADE_MODEL);
1423+ // glShadeModel (GL_FLAT);
1424+ //
1425+ // glPushAttrib (GL_LIGHT0);
1426+ // glPushAttrib (GL_COLOR_MATERIAL);
1427+ // glPushAttrib (GL_LIGHTING);
1428+ // glEnable (GL_COLOR_MATERIAL);
1429+ // glEnable (GL_LIGHTING);
1430+ //
1431+ // GLfloat ambientLight[] = { 0.3f, 0.3f, 0.3f, 0.3f };
1432+ // GLfloat diffuseLight[] = { 0.9f, 0.9f, 0.9f, 0.9f };
1433+ // GLfloat light0Position[] = { -0.5f, 0.5f, 9.0f, 0.0f };
1434+ //
1435+ // glLightfv (GL_LIGHT0, GL_AMBIENT, ambientLight);
1436+ // glLightfv (GL_LIGHT0, GL_DIFFUSE, diffuseLight);
1437+ // glLightfv (GL_LIGHT0, GL_POSITION, light0Position);
1438+ // }
1439
1440 if (mDoDepthTest)
1441 {
1442 // Depth test
1443- glPushAttrib (GL_DEPTH_FUNC);
1444- glPushAttrib (GL_DEPTH_TEST);
1445 glDepthFunc (GL_LEQUAL);
1446+ glDepthMask (GL_TRUE);
1447 glEnable (GL_DEPTH_TEST);
1448 }
1449
1450 // Clip planes
1451- GLdouble clipPlanes[4][4] = {{ 1, 0, 0, 0 },
1452- { 0, 1, 0, 0 },
1453- { -1, 0, 0, 0 },
1454- { 0, -1, 0, 0 }};
1455-
1456- // Save old color values
1457- GLfloat oldColor[4];
1458-
1459- glGetFloatv (GL_CURRENT_COLOR, oldColor);
1460-
1461- // Determine where we are called from in paint.c's drawWindowTexture
1462- // to find out how we should change the opacity
1463- GLint prevActiveTexture = GL_TEXTURE0_ARB;
1464- bool saturationFull = true;
1465-
1466- if (GL::canDoSaturated && mCurPaintAttrib.getSaturation () != COLOR)
1467- {
1468- saturationFull = false;
1469- if (GL::canDoSlightlySaturated &&
1470- mCurPaintAttrib.getSaturation () > 0)
1471- {
1472- if (mCurPaintAttrib.getOpacity () < OPAQUE ||
1473- mCurPaintAttrib.getBrightness () != BRIGHT)
1474- prevActiveTexture = GL_TEXTURE3_ARB;
1475- else
1476- prevActiveTexture = GL_TEXTURE2_ARB;
1477- }
1478- else
1479- prevActiveTexture = GL_TEXTURE1_ARB;
1480- }
1481-
1482- float opacity = mCurPaintAttrib.getOpacity () / 65535.0;
1483+ // GLdouble clipPlanes[4][4] = {{ 1, 0, 0, 0 },
1484+ // { 0, 1, 0, 0 },
1485+ // { -1, 0, 0, 0 },
1486+ // { 0, -1, 0, 0 }};
1487+
1488+ float opacity = mCurPaintAttrib.opacity / 65535.0;
1489
1490 float newOpacity = opacity;
1491 float fadePassedBy;
1492
1493 bool decelerates = deceleratingMotion ();
1494
1495- glPushAttrib (GL_BLEND);
1496 glEnable (GL_BLEND);
1497
1498- if (saturationFull)
1499- mGScreen->setTexEnvMode (GL_MODULATE);
1500-
1501 // if fade-out duration is not specified per polygon
1502 if (mAllFadeDuration > -1.0f)
1503 {
1504@@ -1657,9 +1689,9 @@
1505 static_cast<ExtensionPluginAnimAddon*> (getExtensionPluginInfo ())->
1506 output ();
1507
1508- GLfloat skewMat[16];
1509+ GLMatrix skewMat;
1510 if (mCorrectPerspective == CorrectPerspectiveWindow)
1511- getPerspectiveCorrectionMat (NULL, skewMat, NULL, *output);
1512+ getPerspectiveCorrectionMat (NULL, NULL, &skewMat, *output);
1513
1514 // pass: 0: draw opaque ones
1515 // 1: draw transparent ones
1516@@ -1673,10 +1705,12 @@
1517 const GLfloat *vTexCoords = &c->polygonVertexTexCoords[0];
1518 foreach (const PolygonObject *p, mPolygons)
1519 {
1520- drawPolygonClipIntersection (p, *c,
1521+ drawPolygonClipIntersection (texture,
1522+ transform,
1523+ p, *c,
1524 vTexCoords,
1525 pass, forwardProgress,
1526- clipPlanes, *output,
1527+ *output,
1528 newOpacity,
1529 decelerates,
1530 skewMat);
1531@@ -1688,10 +1722,12 @@
1532 foreach (const PolygonClipInfo *pci,
1533 c->intersectingPolygonInfos)
1534 {
1535- drawPolygonClipIntersection (pci->p, *c,
1536+ drawPolygonClipIntersection (texture,
1537+ transform,
1538+ pci->p, *c,
1539 &pci->vertexTexCoords[0],
1540 pass, forwardProgress,
1541- clipPlanes, *output,
1542+ *output,
1543 newOpacity,
1544 decelerates,
1545 skewMat);
1546@@ -1702,45 +1738,24 @@
1547 // Restore
1548 // -----------------------------------------
1549
1550- // Restore old color values
1551- glColor4f (oldColor[0], oldColor[1], oldColor[2], oldColor[3]);
1552-
1553- glPopAttrib (); // GL_BLEND
1554+ glDisable (GL_BLEND);
1555
1556 if (mDoDepthTest)
1557 {
1558- glPopAttrib (); // GL_DEPTH_TEST
1559- glPopAttrib (); // GL_DEPTH_FUNC
1560- }
1561-
1562- glPopAttrib (); // GL_STENCIL_BUFFER_BIT
1563-
1564- // Restore texture stuff
1565- if (saturationFull)
1566- mGScreen->setTexEnvMode (GL_REPLACE);
1567-
1568- glPopMatrix ();
1569- (GL::activeTexture) (prevActiveTexture);
1570-
1571- if (mDoLighting)
1572- {
1573- glPopAttrib (); // GL_LIGHTING
1574- glPopAttrib (); // GL_COLOR_MATERIAL
1575- glPopAttrib (); // GL_LIGHT0
1576- glPopAttrib (); // GL_SHADE_MODEL
1577- }
1578-
1579- if (mThickness > 0)
1580- {
1581- glPopAttrib (); // GL_NORMALIZE
1582-
1583- if (normalArrayWas)
1584- glEnableClientState (GL_NORMAL_ARRAY);
1585- else
1586- glDisableClientState (GL_NORMAL_ARRAY);
1587- }
1588- else
1589- glNormal3f (0.0f, 0.0f, -1.0f);
1590+ glDisable (GL_DEPTH_TEST);
1591+ glDepthMask (GL_FALSE);
1592+ }
1593+
1594+ // Lighting will require special shaders whcih
1595+ // are not implemented for now.
1596+ //
1597+ // if (mDoLighting)
1598+ // {
1599+ // glPopAttrib (); // GL_LIGHTING
1600+ // glPopAttrib (); // GL_COLOR_MATERIAL
1601+ // glPopAttrib (); // GL_LIGHT0
1602+ // glPopAttrib (); // GL_SHADE_MODEL
1603+ // }
1604
1605 if (mClipsUpdated) // set the end mark for this group of clips
1606 mLastClipInGroup.push_back (lastClip);
1607@@ -1760,7 +1775,7 @@
1608 }
1609
1610 void
1611-PolygonAnim::postPaintWindow ()
1612+PolygonAnim::postPaintWindow (const GLMatrix &)
1613 {
1614 if (mClipsUpdated && // clips should be dropped only in the 1st step
1615 mNumDrawGeometryCalls == 0) // if clips not drawn
1616@@ -1842,20 +1857,7 @@
1617
1618 prepareTransform (output, wTransform, wTransform2);
1619
1620- const float *screenProjection = gScreen->projectionMatrix ();
1621- GLdouble dModel[16];
1622- GLdouble dProjection[16];
1623- for (int i = 0; i < 16; i++)
1624- {
1625- dProjection[i] = screenProjection[i];
1626- }
1627- GLint viewport[4] =
1628- {output.region ()->extents.x1,
1629- output.region ()->extents.y1,
1630- output.width (),
1631- output.height ()};
1632- GLdouble px, py, pz;
1633-
1634+ GLMatrix *screenProjection = gScreen->projectionMatrix ();
1635 GLMatrix *modelViewTransform = &wTransform;
1636
1637 GLMatrix skewMat;
1638@@ -1878,9 +1880,6 @@
1639
1640 // if modelViewTransform == wTransform2, then
1641 // it changes for each polygon
1642- const float *modelViewMatrix = modelViewTransform->getMatrix ();
1643- for (int j = 0; j < 16; j++)
1644- dModel[j] = modelViewMatrix[j];
1645
1646 Point3d center = p->centerPos;
1647 float radius = p->boundSphereRadius + 2;
1648@@ -1924,13 +1923,16 @@
1649 Point3d *pnt = cubeCorners;
1650 for (int j = 0; j < N_POINTS; j++, pnt++)
1651 {
1652- if (!gluProject (pnt->x (), pnt->y (), pnt->z (),
1653- dModel, dProjection, viewport,
1654- &px, &py, &pz))
1655- return;
1656+ namespace com = compiz::opengl::matrix;
1657+ CompPoint p (com::projectIntoViewport(*screenProjection,
1658+ *modelViewTransform,
1659+ output,
1660+ GLVector (pnt->x (),
1661+ pnt->y (),
1662+ pnt->z ())));
1663
1664- py = ::screen->height () - py;
1665- mAWindow->expandBBWithPoint (px + 0.5, py + 0.5);
1666+ p.setY (::screen->height () - p.y ());
1667+ mAWindow->expandBBWithPoint (p.x () + 0.5, p.y () + 0.5);
1668 }
1669 #undef N_POINTS
1670 }
1671@@ -1988,9 +1990,16 @@
1672 }
1673 }
1674 }
1675+
1676 if (depthUsed)
1677 {
1678+#ifdef USE_GLES
1679+ glClearDepthf (1000.0f);
1680+#else
1681 glClearDepth (1000.0f);
1682+#endif
1683+ glDepthMask (GL_TRUE);
1684 glClear (GL_DEPTH_BUFFER_BIT);
1685+ glDepthMask (GL_FALSE);
1686 }
1687 }
1688
1689=== modified file 'plugins/animationaddon/src/private.h'
1690--- plugins/animationaddon/src/private.h 2013-10-31 15:59:14 +0000
1691+++ plugins/animationaddon/src/private.h 2016-07-14 15:55:30 +0000
1692@@ -70,7 +70,7 @@
1693 };
1694
1695 class AnimAddonWindow :
1696- public PluginClassHandler<AnimAddonWindow, CompWindow>
1697+ public PluginClassHandler<AnimAddonWindow, CompWindow, ANIMATIONADDON_ABI>
1698 {
1699 public:
1700 AnimAddonWindow (CompWindow *);
1701@@ -224,7 +224,8 @@
1702 init ();
1703
1704 void
1705- transformPolygon (const PolygonObject *p);
1706+ transformPolygon (GLMatrix &matrix,
1707+ const PolygonObject *p);
1708
1709 bool
1710 tesselateIntoAirplane ();
1711
1712=== modified file 'plugins/composite/src/privates.h'
1713--- plugins/composite/src/privates.h 2013-02-28 03:39:31 +0000
1714+++ plugins/composite/src/privates.h 2016-07-14 15:55:30 +0000
1715@@ -142,7 +142,6 @@
1716 {
1717 public:
1718 PrivateCompositeWindow (CompWindow *w, CompositeWindow *cw);
1719- ~PrivateCompositeWindow ();
1720
1721 void windowNotify (CompWindowNotify n);
1722 void resizeNotify (int dx, int dy, int dwidth, int dheight);
1723@@ -156,11 +155,7 @@
1724 void allowFurtherRebindAttempts ();
1725 bool frozen ();
1726
1727- static void handleDamageRect (CompositeWindow *w,
1728- int x,
1729- int y,
1730- int width,
1731- int height);
1732+ static void handleDamageRect (CompositeWindow *w, XRectangle const& rect);
1733
1734 public:
1735 CompWindow *window;
1736@@ -179,9 +174,7 @@
1737 unsigned short brightness;
1738 unsigned short saturation;
1739
1740- XRectangle *damageRects;
1741- int sizeDamage;
1742- int nDamage;
1743+ std::vector<XRectangle> damageRects;
1744
1745 private:
1746
1747
1748=== modified file 'plugins/composite/src/window.cpp'
1749--- plugins/composite/src/window.cpp 2013-04-13 13:53:39 +0000
1750+++ plugins/composite/src/window.cpp 2016-07-14 15:55:30 +0000
1751@@ -115,20 +115,11 @@
1752 overlayWindow (false),
1753 opacity (OPAQUE),
1754 brightness (BRIGHT),
1755- saturation (COLOR),
1756- damageRects (0),
1757- sizeDamage (0),
1758- nDamage (0)
1759+ saturation (COLOR)
1760 {
1761 WindowInterface::setHandler (w);
1762 }
1763
1764-PrivateCompositeWindow::~PrivateCompositeWindow ()
1765-{
1766- if (sizeDamage)
1767- free (damageRects);
1768-}
1769-
1770 bool
1771 PrivateCompositeWindow::bind ()
1772 {
1773@@ -405,32 +396,14 @@
1774 CompositeWindow::processDamage (XDamageNotifyEvent *de)
1775 {
1776 if (priv->window->syncWait ())
1777- {
1778- if (priv->nDamage == priv->sizeDamage)
1779- {
1780- priv->damageRects = (XRectangle *) realloc (priv->damageRects,
1781- (priv->sizeDamage + 1) *
1782- sizeof (XRectangle));
1783- priv->sizeDamage += 1;
1784- }
1785-
1786- priv->damageRects[priv->nDamage].x = de->area.x;
1787- priv->damageRects[priv->nDamage].y = de->area.y;
1788- priv->damageRects[priv->nDamage].width = de->area.width;
1789- priv->damageRects[priv->nDamage].height = de->area.height;
1790- priv->nDamage++;
1791- }
1792+ priv->damageRects.push_back (de->area);
1793 else
1794- priv->handleDamageRect (this, de->area.x, de->area.y,
1795- de->area.width, de->area.height);
1796+ priv->handleDamageRect (this, de->area);
1797 }
1798
1799 void
1800 PrivateCompositeWindow::handleDamageRect (CompositeWindow *w,
1801- int x,
1802- int y,
1803- int width,
1804- int height)
1805+ XRectangle const& rect)
1806 {
1807 if (!w->priv->redirected)
1808 return;
1809@@ -440,15 +413,15 @@
1810 if (!w->priv->damaged)
1811 w->priv->damaged = initial = true;
1812
1813- if (!w->damageRect (initial, CompRect (x, y, width, height)))
1814+ if (!w->damageRect (initial, CompRect (rect.x, rect.y, rect.width, rect.height)))
1815 {
1816 const CompWindow::Geometry &geom = w->priv->window->geometry ();
1817
1818- x += geom.x () + geom.border ();
1819- y += geom.y () + geom.border ();
1820+ int x = rect.x + geom.x () + geom.border ();
1821+ int y = rect.y + geom.y () + geom.border ();
1822
1823 w->priv->cScreen->damageRegion (CompRegion (CompRect
1824- (x, y, width, height)));
1825+ (x, y, rect.width, rect.height)));
1826 }
1827
1828 if (initial)
1829@@ -565,17 +538,10 @@
1830
1831 case CompWindowNotifySyncAlarm:
1832 {
1833- XRectangle *rects;
1834+ for (XRectangle const& rect : damageRects)
1835+ PrivateCompositeWindow::handleDamageRect (cWindow, rect);
1836
1837- rects = damageRects;
1838- while (nDamage--)
1839- {
1840- PrivateCompositeWindow::handleDamageRect (cWindow,
1841- rects[nDamage].x,
1842- rects[nDamage].y,
1843- rects[nDamage].width,
1844- rects[nDamage].height);
1845- }
1846+ damageRects.clear();
1847 break;
1848 }
1849
1850
1851=== modified file 'plugins/expo/expo.xml.in'
1852--- plugins/expo/expo.xml.in 2016-05-10 07:21:00 +0000
1853+++ plugins/expo/expo.xml.in 2016-07-14 15:55:30 +0000
1854@@ -95,7 +95,7 @@
1855 <_long>The animation used when initiating or leaving Expo.</_long>
1856 <default>0</default>
1857 <min>0</min>
1858- <max>2</max>
1859+ <max>3</max>
1860 <desc>
1861 <value>0</value>
1862 <_name>Zoom</_name>
1863@@ -108,6 +108,10 @@
1864 <value>2</value>
1865 <_name>Vortex</_name>
1866 </desc>
1867+ <desc>
1868+ <value>3</value>
1869+ <_name>None</_name>
1870+ </desc>
1871 </option>
1872 </group>
1873 <group>
1874
1875=== modified file 'plugins/expo/src/expo.cpp'
1876--- plugins/expo/src/expo.cpp 2016-05-16 06:23:55 +0000
1877+++ plugins/expo/src/expo.cpp 2016-07-14 15:55:30 +0000
1878@@ -402,10 +402,18 @@
1879 float val = (static_cast <float> (msSinceLastPaint) / 1000.0f) /
1880 optionGetZoomTime ();
1881
1882- if (expoMode)
1883- expoCam = MIN (1.0, expoCam + val);
1884- else
1885- expoCam = MAX (0.0, expoCam - val);
1886+ if (optionGetExpoAnimation() != ExpoScreen::ExpoAnimationNone) {
1887+ if (expoMode)
1888+ expoCam = MIN (1.0, expoCam + val);
1889+ else
1890+ expoCam = MAX (0.0, expoCam - val);
1891+ }
1892+ else {
1893+ if (expoMode)
1894+ expoCam = 1;
1895+ else
1896+ expoCam = 0;
1897+ }
1898
1899 if (expoCam)
1900 {
1901
1902=== modified file 'plugins/ezoom/ezoom.xml.in' (properties changed: -x to +x)
1903--- plugins/ezoom/ezoom.xml.in 2015-10-26 17:15:43 +0000
1904+++ plugins/ezoom/ezoom.xml.in 2016-07-14 15:55:30 +0000
1905@@ -81,49 +81,218 @@
1906 </group>
1907 <group>
1908 <_short>Specific Zoom</_short>
1909+ <option type="bool" name="spec_target_focus">
1910+ <_short>Target Focused Window on Specific Zoom</_short>
1911+ <_long>Check this to target the focused window when jumping to a specific zoom level. Uncheck this to target the mouse.</_long>
1912+ <default>true</default>
1913+ </option>
1914+ <option type="float" name="zoom_specific_1">
1915+ <_short>Specific Zoom 1</_short>
1916+ <_long>Zoom level to go to when triggering hotkey 1</_long>
1917+ <default>1.0</default>
1918+ <min>0.1</min>
1919+ <max>1.0</max>
1920+ <precision>0.01</precision>
1921+ </option>
1922 <option type="key" name="zoom_specific_1_key">
1923- <_short>Zoom Specific Level 1</_short>
1924+ <_short>Zoom to Specific Zoom 1</_short>
1925 <_long>Zoom to the specific zoom level 1</_long>
1926 <default></default>
1927 </option>
1928- <option type="float" name="zoom_spec1">
1929- <_short>Specific zoom factor 1</_short>
1930- <_long>Zoom level to go to when triggering hotkey 1</_long>
1931+ <option type="float" name="zoom_specific_2">
1932+ <_short>Specific Zoom 2</_short>
1933+ <_long>Zoom level to go to when triggering hotkey 2</_long>
1934 <default>1.0</default>
1935 <min>0.1</min>
1936 <max>1.0</max>
1937 <precision>0.01</precision>
1938 </option>
1939 <option type="key" name="zoom_specific_2_key">
1940- <_short>Zoom Specific Level 2</_short>
1941+ <_short>Zoom to Specific Zoom 2</_short>
1942 <_long>Zoom to the specific zoom level 2</_long>
1943 <default></default>
1944 </option>
1945- <option type="float" name="zoom_spec2">
1946- <_short>Specific zoom factor 2</_short>
1947- <_long>Zoom level to go to when triggering hotkey 2</_long>
1948- <default>0.5</default>
1949+ <option type="float" name="zoom_specific_3">
1950+ <_short>Specific Zoom 3</_short>
1951+ <_long>Zoom level to go to when triggering hotkey 3</_long>
1952+ <default>1.0</default>
1953 <min>0.1</min>
1954 <max>1.0</max>
1955 <precision>0.01</precision>
1956 </option>
1957 <option type="key" name="zoom_specific_3_key">
1958- <_short>Zoom Specific Level 3</_short>
1959+ <_short>Zoom to Specific Zoom 3</_short>
1960 <_long>Zoom to the specific zoom level 3</_long>
1961 <default></default>
1962 </option>
1963- <option type="float" name="zoom_spec3">
1964- <_short>Specific zoom factor 3</_short>
1965- <_long>Zoom level to go to when triggering hotkey 3</_long>
1966- <default>0.2</default>
1967- <min>0.1</min>
1968- <max>1.0</max>
1969- <precision>0.01</precision>
1970- </option>
1971- <option type="bool" name="spec_target_focus">
1972- <_short>Target Focused Window on Specific level</_short>
1973- <_long>Enable this to target the focused window when jumping to a specific zoom level. Disable to target mouse.</_long>
1974- <default>true</default>
1975+ <option type="float" name="zoom_specific_4">
1976+ <_short>Specific Zoom 4</_short>
1977+ <_long>Zoom level to go to when triggering hotkey 4</_long>
1978+ <default>1.0</default>
1979+ <min>0.1</min>
1980+ <max>1.0</max>
1981+ <precision>0.01</precision>
1982+ </option>
1983+ <option type="key" name="zoom_specific_4_key">
1984+ <_short>Zoom to Specific Zoom 4</_short>
1985+ <_long>Zoom to the specific zoom level 4</_long>
1986+ <default></default>
1987+ </option>
1988+ <option type="float" name="zoom_specific_5">
1989+ <_short>Specific Zoom 5</_short>
1990+ <_long>Zoom level to go to when triggering hotkey 5</_long>
1991+ <default>1.0</default>
1992+ <min>0.1</min>
1993+ <max>1.0</max>
1994+ <precision>0.01</precision>
1995+ </option>
1996+ <option type="key" name="zoom_specific_5_key">
1997+ <_short>Zoom to Specific Zoom 5</_short>
1998+ <_long>Zoom to the specific zoom level 5</_long>
1999+ <default></default>
2000+ </option>
2001+ <option type="float" name="zoom_specific_6">
2002+ <_short>Specific Zoom 6</_short>
2003+ <_long>Zoom level to go to when triggering hotkey 6</_long>
2004+ <default>1.0</default>
2005+ <min>0.1</min>
2006+ <max>1.0</max>
2007+ <precision>0.01</precision>
2008+ </option>
2009+ <option type="key" name="zoom_specific_6_key">
2010+ <_short>Zoom to Specific Zoom 6</_short>
2011+ <_long>Zoom to the specific zoom level 6</_long>
2012+ <default></default>
2013+ </option>
2014+ <option type="float" name="zoom_specific_7">
2015+ <_short>Specific Zoom 7</_short>
2016+ <_long>Zoom level to go to when triggering hotkey 7</_long>
2017+ <default>1.0</default>
2018+ <min>0.1</min>
2019+ <max>1.0</max>
2020+ <precision>0.01</precision>
2021+ </option>
2022+ <option type="key" name="zoom_specific_7_key">
2023+ <_short>Zoom to Specific Zoom 7</_short>
2024+ <_long>Zoom to the specific zoom level 7</_long>
2025+ <default></default>
2026+ </option>
2027+ <option type="float" name="zoom_specific_8">
2028+ <_short>Specific Zoom 8</_short>
2029+ <_long>Zoom level to go to when triggering hotkey 8</_long>
2030+ <default>1.0</default>
2031+ <min>0.1</min>
2032+ <max>1.0</max>
2033+ <precision>0.01</precision>
2034+ </option>
2035+ <option type="key" name="zoom_specific_8_key">
2036+ <_short>Zoom to Specific Zoom 8</_short>
2037+ <_long>Zoom to the specific zoom level 8</_long>
2038+ <default></default>
2039+ </option>
2040+ <option type="float" name="zoom_specific_9">
2041+ <_short>Specific Zoom 9</_short>
2042+ <_long>Zoom level to go to when triggering hotkey 9</_long>
2043+ <default>1.0</default>
2044+ <min>0.1</min>
2045+ <max>1.0</max>
2046+ <precision>0.01</precision>
2047+ </option>
2048+ <option type="key" name="zoom_specific_9_key">
2049+ <_short>Zoom to Specific Zoom 9</_short>
2050+ <_long>Zoom to the specific zoom level 9</_long>
2051+ <default></default>
2052+ </option>
2053+ <option type="float" name="zoom_specific_10">
2054+ <_short>Specific Zoom 10</_short>
2055+ <_long>Zoom level to go to when triggering hotkey 10</_long>
2056+ <default>1.0</default>
2057+ <min>0.1</min>
2058+ <max>1.0</max>
2059+ <precision>0.01</precision>
2060+ </option>
2061+ <option type="key" name="zoom_specific_10_key">
2062+ <_short>Zoom to Specific Zoom 10</_short>
2063+ <_long>Zoom to the specific zoom level 10</_long>
2064+ <default></default>
2065+ </option>
2066+ <option type="float" name="zoom_specific_11">
2067+ <_short>Specific Zoom 11</_short>
2068+ <_long>Zoom level to go to when triggering hotkey 11</_long>
2069+ <default>1.0</default>
2070+ <min>0.1</min>
2071+ <max>1.0</max>
2072+ <precision>0.01</precision>
2073+ </option>
2074+ <option type="key" name="zoom_specific_11_key">
2075+ <_short>Zoom to Specific Zoom 11</_short>
2076+ <_long>Zoom to the specific zoom level 11</_long>
2077+ <default></default>
2078+ </option>
2079+ <option type="float" name="zoom_specific_12">
2080+ <_short>Specific Zoom 12</_short>
2081+ <_long>Zoom level to go to when triggering hotkey 12</_long>
2082+ <default>1.0</default>
2083+ <min>0.1</min>
2084+ <max>1.0</max>
2085+ <precision>0.01</precision>
2086+ </option>
2087+ <option type="key" name="zoom_specific_12_key">
2088+ <_short>Zoom to Specific Zoom 12</_short>
2089+ <_long>Zoom to the specific zoom level 12</_long>
2090+ <default></default>
2091+ </option>
2092+ <option type="float" name="zoom_specific_13">
2093+ <_short>Specific Zoom 13</_short>
2094+ <_long>Zoom level to go to when triggering hotkey 13</_long>
2095+ <default>1.0</default>
2096+ <min>0.1</min>
2097+ <max>1.0</max>
2098+ <precision>0.01</precision>
2099+ </option>
2100+ <option type="key" name="zoom_specific_13_key">
2101+ <_short>Zoom to Specific Zoom 13</_short>
2102+ <_long>Zoom to the specific zoom level 13</_long>
2103+ <default></default>
2104+ </option>
2105+ <option type="float" name="zoom_specific_14">
2106+ <_short>Specific Zoom 14</_short>
2107+ <_long>Zoom level to go to when triggering hotkey 14</_long>
2108+ <default>1.0</default>
2109+ <min>0.1</min>
2110+ <max>1.0</max>
2111+ <precision>0.01</precision>
2112+ </option>
2113+ <option type="key" name="zoom_specific_14_key">
2114+ <_short>Zoom to Specific Zoom 14</_short>
2115+ <_long>Zoom to the specific zoom level 14</_long>
2116+ <default></default>
2117+ </option>
2118+ <option type="float" name="zoom_specific_15">
2119+ <_short>Specific Zoom 15</_short>
2120+ <_long>Zoom level to go to when triggering hotkey 15</_long>
2121+ <default>1.0</default>
2122+ <min>0.1</min>
2123+ <max>1.0</max>
2124+ <precision>0.01</precision>
2125+ </option>
2126+ <option type="key" name="zoom_specific_15_key">
2127+ <_short>Zoom to Specific Zoom 15</_short>
2128+ <_long>Zoom to the specific zoom level 15</_long>
2129+ <default></default>
2130+ </option>
2131+ <option type="float" name="zoom_specific_16">
2132+ <_short>Specific Zoom 16</_short>
2133+ <_long>Zoom level to go to when triggering hotkey 16</_long>
2134+ <default>1.0</default>
2135+ <min>0.1</min>
2136+ <max>1.0</max>
2137+ <precision>0.01</precision>
2138+ </option>
2139+ <option type="key" name="zoom_specific_16_key">
2140+ <_short>Zoom to Specific Zoom 16</_short>
2141+ <_long>Zoom to the specific zoom level 16</_long>
2142+ <default></default>
2143 </option>
2144 </group>
2145 <group>
2146
2147=== modified file 'plugins/ezoom/src/ezoom.cpp' (properties changed: -x to +x)
2148--- plugins/ezoom/src/ezoom.cpp 2014-10-22 16:01:27 +0000
2149+++ plugins/ezoom/src/ezoom.cpp 2016-07-14 15:55:30 +0000
2150@@ -1591,16 +1591,68 @@
2151
2152 switch (target)
2153 {
2154- case ZoomTargetFirst:
2155- zoom_level = optionGetZoomSpec1 ();
2156- break;
2157-
2158- case ZoomTargetSecond:
2159- zoom_level = optionGetZoomSpec2 ();
2160- break;
2161-
2162- case ZoomTargetThird:
2163- zoom_level = optionGetZoomSpec3 ();
2164+ case ZoomTarget1:
2165+ zoom_level = optionGetZoomSpecific1 ();
2166+ break;
2167+
2168+ case ZoomTarget2:
2169+ zoom_level = optionGetZoomSpecific2 ();
2170+ break;
2171+
2172+ case ZoomTarget3:
2173+ zoom_level = optionGetZoomSpecific3 ();
2174+ break;
2175+
2176+ case ZoomTarget4:
2177+ zoom_level = optionGetZoomSpecific4 ();
2178+ break;
2179+
2180+ case ZoomTarget5:
2181+ zoom_level = optionGetZoomSpecific5 ();
2182+ break;
2183+
2184+ case ZoomTarget6:
2185+ zoom_level = optionGetZoomSpecific6 ();
2186+ break;
2187+
2188+ case ZoomTarget7:
2189+ zoom_level = optionGetZoomSpecific7 ();
2190+ break;
2191+
2192+ case ZoomTarget8:
2193+ zoom_level = optionGetZoomSpecific8 ();
2194+ break;
2195+
2196+ case ZoomTarget9:
2197+ zoom_level = optionGetZoomSpecific9 ();
2198+ break;
2199+
2200+ case ZoomTarget10:
2201+ zoom_level = optionGetZoomSpecific10 ();
2202+ break;
2203+
2204+ case ZoomTarget11:
2205+ zoom_level = optionGetZoomSpecific11 ();
2206+ break;
2207+
2208+ case ZoomTarget12:
2209+ zoom_level = optionGetZoomSpecific12 ();
2210+ break;
2211+
2212+ case ZoomTarget13:
2213+ zoom_level = optionGetZoomSpecific13 ();
2214+ break;
2215+
2216+ case ZoomTarget14:
2217+ zoom_level = optionGetZoomSpecific14 ();
2218+ break;
2219+
2220+ case ZoomTarget15:
2221+ zoom_level = optionGetZoomSpecific15 ();
2222+ break;
2223+
2224+ case ZoomTarget16:
2225+ zoom_level = optionGetZoomSpecific16 ();
2226 break;
2227
2228 default:
2229@@ -1966,16 +2018,54 @@
2230 optionSetZoomOutKeyInitiate (boost::bind (&EZoomScreen::zoomOut, this, _1,
2231 _2, _3));
2232
2233- optionSetZoomSpecific1KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,
2234- this, _1, _2, _3,
2235- ZoomTargetFirst));
2236- optionSetZoomSpecific2KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,
2237- this, _1, _2, _3,
2238- ZoomTargetSecond));
2239- optionSetZoomSpecific3KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,
2240- this, _1, _2, _3,
2241- ZoomTargetThird));
2242-
2243+ optionSetZoomSpecific1KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,
2244+ this, _1, _2, _3,
2245+ ZoomTarget1));
2246+ optionSetZoomSpecific2KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,
2247+ this, _1, _2, _3,
2248+ ZoomTarget2));
2249+ optionSetZoomSpecific3KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,
2250+ this, _1, _2, _3,
2251+ ZoomTarget3));
2252+ optionSetZoomSpecific4KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,
2253+ this, _1, _2, _3,
2254+ ZoomTarget4));
2255+ optionSetZoomSpecific5KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,
2256+ this, _1, _2, _3,
2257+ ZoomTarget5));
2258+ optionSetZoomSpecific6KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,
2259+ this, _1, _2, _3,
2260+ ZoomTarget6));
2261+ optionSetZoomSpecific7KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,
2262+ this, _1, _2, _3,
2263+ ZoomTarget7));
2264+ optionSetZoomSpecific8KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,
2265+ this, _1, _2, _3,
2266+ ZoomTarget8));
2267+ optionSetZoomSpecific9KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,
2268+ this, _1, _2, _3,
2269+ ZoomTarget9));
2270+ optionSetZoomSpecific10KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,
2271+ this, _1, _2, _3,
2272+ ZoomTarget10));
2273+ optionSetZoomSpecific11KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,
2274+ this, _1, _2, _3,
2275+ ZoomTarget11));
2276+ optionSetZoomSpecific12KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,
2277+ this, _1, _2, _3,
2278+ ZoomTarget12));
2279+ optionSetZoomSpecific13KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,
2280+ this, _1, _2, _3,
2281+ ZoomTarget13));
2282+ optionSetZoomSpecific14KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,
2283+ this, _1, _2, _3,
2284+ ZoomTarget14));
2285+ optionSetZoomSpecific15KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,
2286+ this, _1, _2, _3,
2287+ ZoomTarget15));
2288+ optionSetZoomSpecific16KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,
2289+ this, _1, _2, _3,
2290+ ZoomTarget16));
2291 optionSetPanLeftKeyInitiate (boost::bind (&EZoomScreen::zoomPan, this, _1,
2292 _2, _3, -1, 0));
2293 optionSetPanRightKeyInitiate (boost::bind (&EZoomScreen::zoomPan, this, _1,
2294
2295=== modified file 'plugins/ezoom/src/ezoom.h' (properties changed: -x to +x)
2296--- plugins/ezoom/src/ezoom.h 2013-05-15 15:44:02 +0000
2297+++ plugins/ezoom/src/ezoom.h 2016-07-14 15:55:30 +0000
2298@@ -51,9 +51,22 @@
2299
2300 enum SpecificZoomTarget
2301 {
2302- ZoomTargetFirst = 0,
2303- ZoomTargetSecond,
2304- ZoomTargetThird
2305+ ZoomTarget1 = 0,
2306+ ZoomTarget2,
2307+ ZoomTarget3,
2308+ ZoomTarget4,
2309+ ZoomTarget5,
2310+ ZoomTarget6,
2311+ ZoomTarget7,
2312+ ZoomTarget8,
2313+ ZoomTarget9,
2314+ ZoomTarget10,
2315+ ZoomTarget11,
2316+ ZoomTarget12,
2317+ ZoomTarget13,
2318+ ZoomTarget14,
2319+ ZoomTarget15,
2320+ ZoomTarget16
2321 };
2322
2323 class EZoomScreen :
2324
2325=== modified file 'plugins/grid/src/grid.cpp' (properties changed: -x to +x)
2326--- plugins/grid/src/grid.cpp 2015-04-06 13:14:51 +0000
2327+++ plugins/grid/src/grid.cpp 2016-07-14 15:55:30 +0000
2328@@ -250,110 +250,129 @@
2329 !optionGetCycleSizes ())) &&
2330 gw->lastTarget & where)
2331 {
2332+ /* TODO:
2333+ * instead of just using what was here
2334+ * decide on how to deal with rounding/truncating/off by one,
2335+ * might be helpful in cases like using a windowed virtual machine
2336+ * with a relatively prime number for width,
2337+ * examples 631, 797, 1021, 1279, 1439, 1913, 2039, 2557, 3833, ... NextPrime[{N}, -1]
2338+ */
2339+ int slotWidth12 = workarea.width () / 8;
2340+ int slotWidth17 = (workarea.width () / 6);
2341 int slotWidth25 = workarea.width () / 4;
2342 int slotWidth33 = (workarea.width () / 3) + cw->border ().left;
2343- int slotWidth17 = slotWidth33 - slotWidth25;
2344+ int slotWidth50 = (workarea.width () / 2);
2345 int slotWidth66 = workarea.width () - slotWidth33;
2346 int slotWidth75 = workarea.width () - slotWidth25;
2347+ int slotWidth100 = workarea.width ();
2348+ int slotWidth37 = slotWidth75 / 2;
2349
2350 if (props.numCellsX == 2) /* keys (1, 4, 7, 3, 6, 9) */
2351 {
2352- if ((currentRect.width () == desiredRect.width () &&
2353- currentRect.x () == desiredRect.x ()) ||
2354- (gw->resizeCount < 1) || (gw->resizeCount > 5))
2355- gw->resizeCount = 3;
2356-
2357- /* tricky, have to allow for window constraints when
2358- * computing what the 33% and 66% offsets would be
2359- */
2360- switch (gw->resizeCount)
2361- {
2362- case 1:
2363- desiredSlot.setWidth (slotWidth66);
2364- desiredSlot.setX (workarea.x () +
2365- props.gravityRight * slotWidth33);
2366- ++gw->resizeCount;
2367- break;
2368-
2369- case 2:
2370- ++gw->resizeCount;
2371- break;
2372-
2373- case 3:
2374- desiredSlot.setWidth (slotWidth33);
2375- desiredSlot.setX (workarea.x () +
2376- props.gravityRight * slotWidth66);
2377- ++gw->resizeCount;
2378- break;
2379-
2380- case 4:
2381- desiredSlot.setWidth (slotWidth25);
2382- desiredSlot.setX (workarea.x () +
2383- props.gravityRight * slotWidth75);
2384- ++gw->resizeCount;
2385- break;
2386-
2387- case 5:
2388- desiredSlot.setWidth (slotWidth75);
2389- desiredSlot.setX (workarea.x () +
2390- props.gravityRight * slotWidth25);
2391- ++gw->resizeCount;
2392- break;
2393-
2394- default:
2395- break;
2396- }
2397+ if ((currentRect.width () == desiredRect.width () &&
2398+ currentRect.x () == desiredRect.x ()) ||
2399+ (gw->resizeCount < 1) || (gw->resizeCount > 6))
2400+ {
2401+ gw->resizeCount = 2;
2402+ }
2403+ /* tricky, have to allow for window constraints when
2404+ * computing what the 33% and 66% offsets would be
2405+ */
2406+ switch (gw->resizeCount)
2407+ {
2408+ case 1:
2409+ desiredSlot.setWidth (slotWidth50);
2410+ desiredSlot.setX (workarea.x () + props.gravityRight * slotWidth50);
2411+ ++gw->resizeCount;
2412+ break;
2413+
2414+ case 2:
2415+ desiredSlot.setWidth (slotWidth33);
2416+ desiredSlot.setX (workarea.x () + props.gravityRight * slotWidth66);
2417+ ++gw->resizeCount;
2418+ break;
2419+
2420+ case 3:
2421+ desiredSlot.setWidth (slotWidth25);
2422+ desiredSlot.setX (workarea.x () + props.gravityRight * slotWidth75);
2423+ ++gw->resizeCount;
2424+ break;
2425+
2426+ case 4:
2427+ desiredSlot.setWidth (slotWidth100);
2428+ desiredSlot.setX (workarea.x ());
2429+ ++gw->resizeCount;
2430+ break;
2431+
2432+ case 5:
2433+ desiredSlot.setWidth (slotWidth75);
2434+ desiredSlot.setX (workarea.x () + props.gravityRight * slotWidth25);
2435+ ++gw->resizeCount;
2436+ break;
2437+
2438+ case 6:
2439+ desiredSlot.setWidth (slotWidth66);
2440+ desiredSlot.setX (workarea.x () + props.gravityRight * slotWidth33);
2441+ ++gw->resizeCount;
2442+ break;
2443+
2444+ default:
2445+ break;
2446+ }
2447 }
2448 else /* keys (2, 5, 8) */
2449 {
2450- if ((currentRect.width () == desiredRect.width () &&
2451- currentRect.x () == desiredRect.x ()) ||
2452- (gw->resizeCount < 1) || (gw->resizeCount > 5))
2453+ if ((currentRect.width () == desiredRect.width () &&
2454+ currentRect.x () == desiredRect.x ()) ||
2455+ (gw->resizeCount < 1) || (gw->resizeCount > 6))
2456+ {
2457+ gw->resizeCount = 2;
2458+ }
2459+ switch (gw->resizeCount)
2460+ {
2461+ case 1:
2462+ desiredSlot.setWidth (slotWidth100);
2463+ desiredSlot.setX (workarea.x ());
2464+ ++gw->resizeCount;
2465+ break;
2466+
2467+ case 2:
2468+ desiredSlot.setWidth (slotWidth75);
2469+ desiredSlot.setX (workarea.x () + slotWidth12);
2470+ ++gw->resizeCount;
2471+ break;
2472+
2473+ case 3:
2474+ desiredSlot.setWidth (slotWidth66);
2475+ desiredSlot.setX (workarea.x () + slotWidth17);
2476+ ++gw->resizeCount;
2477+ break;
2478+
2479+ case 4:
2480+ desiredSlot.setWidth ((slotWidth50));
2481+ desiredSlot.setX (workarea.x () + slotWidth25);
2482+ ++gw->resizeCount;
2483+ break;
2484+
2485+ case 5:
2486+ desiredSlot.setWidth (slotWidth33 - (cw->border ().left + cw->border ().right));
2487+ desiredSlot.setX (workarea.x () + slotWidth33);
2488+ ++gw->resizeCount;
2489+ break;
2490+
2491+ case 6:
2492+ desiredSlot.setWidth ((slotWidth25));
2493+ desiredSlot.setX (workarea.x () + slotWidth37);
2494+ ++gw->resizeCount;
2495+ break;
2496+
2497+ default:
2498+ break;
2499+ }
2500+ }
2501+ if (gw->resizeCount > 6){
2502 gw->resizeCount = 1;
2503-
2504- switch (gw->resizeCount)
2505- {
2506- case 1:
2507- desiredSlot.setWidth (workarea.width () -
2508- (slotWidth17 * 2));
2509- desiredSlot.setX (workarea.x () + slotWidth17);
2510- ++gw->resizeCount;
2511- break;
2512-
2513- case 2:
2514- desiredSlot.setWidth ((slotWidth25 * 2) +
2515- (slotWidth17 * 2));
2516- desiredSlot.setX (workarea.x () +
2517- (slotWidth25 - slotWidth17));
2518- ++gw->resizeCount;
2519- break;
2520-
2521- case 3:
2522- desiredSlot.setWidth ((slotWidth25 * 2));
2523- desiredSlot.setX (workarea.x () + slotWidth25);
2524- ++gw->resizeCount;
2525- break;
2526-
2527- case 4:
2528- desiredSlot.setWidth (slotWidth33 -
2529- (cw->border ().left +
2530- cw->border ().right));
2531- desiredSlot.setX (workarea.x () + slotWidth33);
2532- ++gw->resizeCount;
2533- break;
2534-
2535- case 5:
2536- ++gw->resizeCount;
2537- break;
2538-
2539- default:
2540- break;
2541- }
2542- }
2543-
2544- if (gw->resizeCount == 6)
2545- gw->resizeCount = 1;
2546-
2547+ }
2548 desiredRect = constrainSize (cw, desiredSlot);
2549 }
2550
2551
2552=== modified file 'plugins/opengl/include/opengl/matrix.h'
2553--- plugins/opengl/include/opengl/matrix.h 2012-08-02 11:57:41 +0000
2554+++ plugins/opengl/include/opengl/matrix.h 2016-07-14 15:55:30 +0000
2555@@ -26,6 +26,8 @@
2556 #ifndef _GLMATRIX_H
2557 #define _GLMATRIX_H
2558
2559+#include <core/point.h>
2560+#include <core/rect.h>
2561 #include <opengl/vector.h>
2562
2563 class CompOutput;
2564@@ -65,4 +67,29 @@
2565 float m[16];
2566 };
2567
2568+namespace compiz
2569+{
2570+ namespace opengl
2571+ {
2572+ namespace matrix
2573+ {
2574+ /* This function returns co-ordinates into viewport space. In order
2575+ * to convert into something like damage rectangles please remember
2576+ * to flip on the y axis. */
2577+ inline CompPoint projectIntoViewport (const GLMatrix &modelview,
2578+ const GLMatrix &projection,
2579+ const CompRect &vp,
2580+ const GLVector &vector)
2581+ {
2582+ GLVector projected (projection * modelview * vector);
2583+ projected.homogenize ();
2584+ projected[0] = projected[0] * 0.5 + 0.5;
2585+ projected[1] = projected[1] * 0.5 + 0.5;
2586+ return CompPoint (projected[0] * vp.width () + vp.x (),
2587+ projected[1] * vp.height () + vp.y ());
2588+ }
2589+ }
2590+ }
2591+}
2592+
2593 #endif
2594
2595=== modified file 'plugins/opengl/include/opengl/opengl.h'
2596--- plugins/opengl/include/opengl/opengl.h 2016-05-13 07:57:01 +0000
2597+++ plugins/opengl/include/opengl/opengl.h 2016-07-14 15:55:30 +0000
2598@@ -1036,6 +1036,12 @@
2599 std::string vertex_shader,
2600 std::string fragment_shader);
2601
2602+ /**
2603+ * Use this if overriding glDrawTexture completely - used to clear
2604+ * out any internal shader caches.
2605+ */
2606+ void clearShaders ();
2607+
2608 GLTexture *getIcon (int width, int height);
2609
2610 WRAPABLE_HND (0, GLWindowInterface, bool, glPaint,
2611
2612=== modified file 'plugins/opengl/include/opengl/vertexbuffer.h'
2613--- plugins/opengl/include/opengl/vertexbuffer.h 2016-05-12 06:16:56 +0000
2614+++ plugins/opengl/include/opengl/vertexbuffer.h 2016-07-14 15:55:30 +0000
2615@@ -113,12 +113,30 @@
2616
2617 int render (const GLMatrix &modelview);
2618
2619+ int render (const GLushort *indices,
2620+ GLuint nIndices);
2621+
2622+ int render (const GLMatrix &modelview,
2623+ const GLushort *indices,
2624+ GLuint nIndices);
2625+
2626 int render (const GLMatrix &modelview,
2627 const GLWindowPaintAttrib &attrib);
2628
2629+ int render (const GLMatrix &modelview,
2630+ const GLWindowPaintAttrib &attrib,
2631+ const GLushort *indices,
2632+ GLuint nIndices);
2633+
2634 int render (const GLMatrix &projection,
2635- const GLMatrix &modelview,
2636- const GLWindowPaintAttrib &attrib);
2637+ const GLMatrix &modelview,
2638+ const GLWindowPaintAttrib &attrib);
2639+
2640+ int render (const GLMatrix &projection,
2641+ const GLMatrix &modelview,
2642+ const GLWindowPaintAttrib &attrib,
2643+ const GLushort *indices,
2644+ GLuint nIndices);
2645
2646 void setVertexOffset (GLuint vOffset);
2647 void setMaxVertices (GLint vMax);
2648
2649=== modified file 'plugins/opengl/src/paint.cpp'
2650--- plugins/opengl/src/paint.cpp 2016-05-17 02:52:47 +0000
2651+++ plugins/opengl/src/paint.cpp 2016-07-14 15:55:30 +0000
2652@@ -1298,16 +1298,7 @@
2653 priv->vertexBuffer->render (transform, attrib);
2654 #endif
2655
2656- for (std::list<const GLShaderData*>::const_iterator it = priv->shaders.begin();
2657- it != priv->shaders.end();
2658- ++it)
2659- {
2660- if ((*it)->isCached != true)
2661- {
2662- delete *it;
2663- }
2664- }
2665- priv->shaders.clear ();
2666+ clearShaders ();
2667 texture->disable ();
2668
2669 if (mask & PAINT_WINDOW_BLEND_MASK)
2670
2671=== modified file 'plugins/opengl/src/privatevertexbuffer.h'
2672--- plugins/opengl/src/privatevertexbuffer.h 2013-10-31 15:59:14 +0000
2673+++ plugins/opengl/src/privatevertexbuffer.h 2016-07-14 15:55:30 +0000
2674@@ -109,10 +109,14 @@
2675
2676 int render (const GLMatrix *projection,
2677 const GLMatrix *modelview,
2678- const GLWindowPaintAttrib *attrib);
2679+ const GLWindowPaintAttrib *attrib,
2680+ const GLushort *indices,
2681+ GLuint nIndices);
2682 int legacyRender (const GLMatrix &projection,
2683 const GLMatrix &modelview,
2684- const GLWindowPaintAttrib &attrib);
2685+ const GLWindowPaintAttrib &attrib,
2686+ const GLushort *indices,
2687+ GLuint nIndices);
2688
2689 public:
2690 static GLVertexBuffer *streamingBuffer;
2691
2692=== modified file 'plugins/opengl/src/vertexbuffer.cpp'
2693--- plugins/opengl/src/vertexbuffer.cpp 2016-05-12 05:17:55 +0000
2694+++ plugins/opengl/src/vertexbuffer.cpp 2016-07-14 15:55:30 +0000
2695@@ -343,7 +343,16 @@
2696 int GLVertexBuffer::render ()
2697 {
2698 if (enabled ())
2699- return priv->render (NULL, NULL, NULL);
2700+ return priv->render (NULL, NULL, NULL, NULL, 0);
2701+ else
2702+ return -1;
2703+}
2704+
2705+int GLVertexBuffer::render (const GLushort *indices,
2706+ GLuint nIndices)
2707+{
2708+ if (enabled ())
2709+ return priv->render (NULL, NULL, NULL, indices, nIndices);
2710 else
2711 return -1;
2712 }
2713@@ -355,15 +364,42 @@
2714 return render (modelview, attrib);
2715 }
2716
2717+int GLVertexBuffer::render (const GLMatrix &modelview,
2718+ const GLushort *indices,
2719+ GLuint nIndices)
2720+{
2721+ const GLWindowPaintAttrib attrib = { OPAQUE, BRIGHT, COLOR, 0, 0, 0, 0 };
2722+
2723+ return render (modelview, attrib, indices, nIndices);
2724+}
2725+
2726 int GLVertexBuffer::render (const GLMatrix &modelview,
2727 const GLWindowPaintAttrib &attrib)
2728 {
2729 GLScreen *gScreen = GLScreen::get (screen);
2730 GLMatrix *projection = gScreen->projectionMatrix ();
2731
2732- return render (*projection, modelview, attrib);
2733-}
2734-
2735+ return render (*projection, modelview, attrib, NULL, 0);
2736+}
2737+
2738+
2739+int GLVertexBuffer::render (const GLMatrix &modelview,
2740+ const GLWindowPaintAttrib &attrib,
2741+ const GLushort *indices,
2742+ GLuint nIndices)
2743+{
2744+ GLScreen *gScreen = GLScreen::get (screen);
2745+ GLMatrix *projection = gScreen->projectionMatrix ();
2746+
2747+ return render (*projection, modelview, attrib, indices, nIndices);
2748+}
2749+
2750+int GLVertexBuffer::render (const GLMatrix &projection,
2751+ const GLMatrix &modelview,
2752+ const GLWindowPaintAttrib &attrib)
2753+{
2754+ return render (projection, modelview, attrib, NULL, 0);
2755+}
2756
2757 #if 0
2758 #define PRINT_MATRIX(m) printMatrix ((m), #m)
2759@@ -378,9 +414,11 @@
2760 #define PRINT_MATRIX(m)
2761 #endif
2762
2763-int GLVertexBuffer::render (const GLMatrix &projection,
2764- const GLMatrix &modelview,
2765- const GLWindowPaintAttrib &attrib)
2766+int GLVertexBuffer::render (const GLMatrix &projection,
2767+ const GLMatrix &modelview,
2768+ const GLWindowPaintAttrib &attrib,
2769+ const GLushort *indices,
2770+ GLuint nIndices)
2771 {
2772 if (!priv->vertexData.size ())
2773 return -1;
2774@@ -389,9 +427,9 @@
2775 PRINT_MATRIX(projection);
2776
2777 if (enabled ())
2778- return priv->render (&projection, &modelview, &attrib);
2779+ return priv->render (&projection, &modelview, &attrib, indices, nIndices);
2780 else
2781- return priv->legacyRender (projection, modelview, attrib);
2782+ return priv->legacyRender (projection, modelview, attrib, indices, nIndices);
2783 }
2784
2785 PrivateVertexBuffer::PrivateVertexBuffer () :
2786@@ -431,9 +469,11 @@
2787 }
2788 }
2789
2790-int PrivateVertexBuffer::render (const GLMatrix *projection,
2791- const GLMatrix *modelview,
2792- const GLWindowPaintAttrib *attrib)
2793+int PrivateVertexBuffer::render (const GLMatrix *projection,
2794+ const GLMatrix *modelview,
2795+ const GLWindowPaintAttrib *attrib,
2796+ const GLushort *indices,
2797+ GLuint nIndices)
2798 {
2799 GLfloat attribs[3] = {1, 1, 1};
2800 GLint positionIndex = -1;
2801@@ -552,11 +592,16 @@
2802 tmpProgram->setUniform3f ("paintAttrib", attribs[0], attribs[1], attribs[2]);
2803 }
2804
2805-
2806- glDrawArrays (primitiveType, vertexOffset, maxVertices > 0 ?
2807- std::min (static_cast <int> (vertexData.size () / 3),
2808- maxVertices) :
2809- vertexData.size () / 3);
2810+ const GLuint nVerticesToDraw = maxVertices > 0 ?
2811+ std::min (static_cast <int> (vertexData.size () / 3),
2812+ maxVertices) :
2813+ vertexData.size () / 3;
2814+
2815+ if (nIndices && indices)
2816+ glDrawElements (primitiveType, nIndices, GL_UNSIGNED_SHORT, indices);
2817+ else
2818+ glDrawArrays (primitiveType, vertexOffset, nVerticesToDraw);
2819+
2820 for (int i = 0; i < 4; ++i)
2821 {
2822 if (texCoordIndex[i] != -1)
2823@@ -578,7 +623,9 @@
2824
2825 int PrivateVertexBuffer::legacyRender (const GLMatrix &projection,
2826 const GLMatrix &modelview,
2827- const GLWindowPaintAttrib &attrib)
2828+ const GLWindowPaintAttrib &attrib,
2829+ const GLushort *indices,
2830+ GLuint nIndices)
2831 {
2832 #ifndef USE_GLES
2833 glMatrixMode (GL_PROJECTION);
2834@@ -626,10 +673,18 @@
2835 glTexCoordPointer (2, GL_FLOAT, 0, &textureData[i][0]);
2836 }
2837
2838- glDrawArrays (primitiveType, vertexOffset, maxVertices > 0 ?
2839- std::min (static_cast <int> (vertexData.size () / 3),
2840- maxVertices) :
2841- vertexData.size () / 3);
2842+ const GLuint nVerticesToDraw = maxVertices > 0 ?
2843+ std::min (static_cast <int> (vertexData.size () / 3),
2844+ maxVertices) :
2845+ vertexData.size () / 3;
2846+
2847+ if (indices && nIndices)
2848+ glDrawElements (primitiveType,
2849+ nIndices,
2850+ GL_UNSIGNED_SHORT,
2851+ indices);
2852+ else
2853+ glDrawArrays (primitiveType, vertexOffset, nVerticesToDraw);
2854
2855 glDisableClientState (GL_VERTEX_ARRAY);
2856 glDisableClientState (GL_NORMAL_ARRAY);
2857
2858=== modified file 'plugins/opengl/src/window.cpp'
2859--- plugins/opengl/src/window.cpp 2016-05-13 06:41:03 +0000
2860+++ plugins/opengl/src/window.cpp 2016-07-14 15:55:30 +0000
2861@@ -375,6 +375,21 @@
2862 }
2863
2864 void
2865+GLWindow::clearShaders ()
2866+{
2867+ for (std::list<const GLShaderData*>::const_iterator it = priv->shaders.begin();
2868+ it != priv->shaders.end();
2869+ ++it)
2870+ {
2871+ if ((*it)->isCached != true)
2872+ {
2873+ delete *it;
2874+ }
2875+ }
2876+ priv->shaders.clear ();
2877+}
2878+
2879+void
2880 PrivateGLWindow::updateFrameRegion (CompRegion &region)
2881 {
2882 window->updateFrameRegion (region);
2883
2884=== modified file 'plugins/scale/scale.xml.in'
2885--- plugins/scale/scale.xml.in 2016-04-27 15:47:55 +0000
2886+++ plugins/scale/scale.xml.in 2016-07-14 15:55:30 +0000
2887@@ -139,6 +139,11 @@
2888 <_name>On all output devices</_name>
2889 </desc>
2890 </option>
2891+ <option name="skip_animation" type="bool">
2892+ <_short>Skip Animation</_short>
2893+ <_long>Skips the scale plugin animation.</_long>
2894+ <default>false</default>
2895+ </option>
2896 </group>
2897 <group>
2898 <_short>Bindings</_short>
2899
2900=== modified file 'plugins/scale/src/scale.cpp'
2901--- plugins/scale/src/scale.cpp 2016-05-17 02:53:00 +0000
2902+++ plugins/scale/src/scale.cpp 2016-07-14 15:55:30 +0000
2903@@ -932,9 +932,11 @@
2904 if (state != ScaleScreen::Idle && state != ScaleScreen::Wait)
2905 {
2906 int steps;
2907- float amount, chunk;
2908-
2909- amount = msSinceLastPaint * 0.05f * optionGetSpeed ();
2910+ float amount, chunk, speed;
2911+
2912+ speed = optionGetSkipAnimation() ? USHRT_MAX : optionGetSpeed();
2913+
2914+ amount = msSinceLastPaint * 0.05f * speed;
2915 steps = amount / (0.5f * optionGetTimestep ());
2916
2917 if (!steps)

Subscribers

People subscribed via source and target branches