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
=== modified file 'VERSION'
--- VERSION 2015-08-19 15:50:54 +0000
+++ VERSION 2016-07-14 15:55:30 +0000
@@ -1,1 +1,1 @@
10.9.12.210.9.13.0
22
=== modified file 'debian/changelog'
--- debian/changelog 2016-06-21 13:11:16 +0000
+++ debian/changelog 2016-07-14 15:55:30 +0000
@@ -1,3 +1,25 @@
1compiz (1:0.9.13.0+16.10.20160705-0ubuntu1) yakkety; urgency=medium
2
3 [ Eleni Maria Stea ]
4 * Added options for no animation in expo and scale plugins. They skip
5 the intermediate fading steps that force several redraws.
6
7 [ Marco Trevisan (Treviño) ]
8 * Composite: use C++ goodness for managing damaging rectangles
9 * debian: add unity-lowgfx profile to compizconfig (LP: #1598770)
10
11 -- Marco Trevisan (Treviño) <mail@3v1n0.net> Tue, 05 Jul 2016 01:12:10 +0000
12
13compiz (1:0.9.13.0+16.10.20160628-0ubuntu1) yakkety; urgency=medium
14
15 [ Marco Trevisan (Treviño) ]
16 * New upstream release 0.9.13.0
17
18 [ Sam Spilsbury smspillaz@gmail.com ]
19 * animationaddon: Port the animationaddon plugin to use modern GL API.
20
21 -- Marco Trevisan (Treviño) <mail@3v1n0.net> Tue, 28 Jun 2016 14:57:42 +0000
22
1compiz (1:0.9.12.2+16.10.20160621-0ubuntu1) yakkety; urgency=medium23compiz (1:0.9.12.2+16.10.20160621-0ubuntu1) yakkety; urgency=medium
224
3 [ Alberts Muktupāvels ]25 [ Alberts Muktupāvels ]
426
=== modified file 'debian/compiz-dev.install'
--- debian/compiz-dev.install 2014-11-24 22:25:07 +0000
+++ debian/compiz-dev.install 2016-07-14 15:55:30 +0000
@@ -1,6 +1,7 @@
1debian/tmp/usr/include/compiz/[!d]*1debian/tmp/usr/include/compiz/[!d]*
2debian/tmp/usr/lib/*/libcompiz_core.so2debian/tmp/usr/lib/*/libcompiz_core.so
3debian/tmp/usr/lib/*/pkgconfig/compiz-animation.pc3debian/tmp/usr/lib/*/pkgconfig/compiz-animation.pc
4debian/tmp/usr/lib/*/pkgconfig/compiz-animationaddon.pc
4debian/tmp/usr/lib/*/pkgconfig/compiz-compiztoolbox.pc5debian/tmp/usr/lib/*/pkgconfig/compiz-compiztoolbox.pc
5debian/tmp/usr/lib/*/pkgconfig/compiz-composite.pc6debian/tmp/usr/lib/*/pkgconfig/compiz-composite.pc
6debian/tmp/usr/lib/*/pkgconfig/compiz-cube.pc7debian/tmp/usr/lib/*/pkgconfig/compiz-cube.pc
78
=== modified file 'debian/compiz-gnome.install'
--- debian/compiz-gnome.install 2015-12-10 16:34:35 +0000
+++ debian/compiz-gnome.install 2016-07-14 15:55:30 +0000
@@ -1,6 +1,6 @@
1debian/65compiz_profile-on-session /etc/X11/Xsession.d1debian/65compiz_profile-on-session /etc/X11/Xsession.d
2debian/profile_upgrades/*.upgrade usr/share/compizconfig/upgrades2debian/profile_upgrades/*.upgrade usr/share/compizconfig/upgrades
3debian/unity.ini /etc/compizconfig/3debian/unity*.ini /etc/compizconfig/
4postinst/convert-files/*.convert usr/lib/compiz/migration/4postinst/convert-files/*.convert usr/lib/compiz/migration/
5usr/bin/gtk-window-decorator5usr/bin/gtk-window-decorator
6usr/lib/*/compizconfig/backends/libgsettings.so6usr/lib/*/compizconfig/backends/libgsettings.so
77
=== modified file 'debian/compiz-plugins.install'
--- debian/compiz-plugins.install 2016-05-13 09:45:31 +0000
+++ debian/compiz-plugins.install 2016-07-14 15:55:30 +0000
@@ -2,6 +2,8 @@
2usr/share/compiz/*addhelper.*2usr/share/compiz/*addhelper.*
3usr/lib/*/compiz/*annotate.*3usr/lib/*/compiz/*annotate.*
4usr/share/compiz/*annotate.*4usr/share/compiz/*annotate.*
5usr/lib/*/compiz/*animationaddon.*
6usr/share/compiz/*animationaddon.*
5usr/lib/*/compiz/*bench.*7usr/lib/*/compiz/*bench.*
6usr/share/compiz/*bench.*8usr/share/compiz/*bench.*
7usr/lib/*/compiz/*blur.*9usr/lib/*/compiz/*blur.*
810
=== modified file 'debian/compiz-plugins.install.armel'
--- debian/compiz-plugins.install.armel 2014-12-02 14:42:34 +0000
+++ debian/compiz-plugins.install.armel 2016-07-14 15:55:30 +0000
@@ -2,6 +2,8 @@
2usr/share/compiz/*addhelper.*2usr/share/compiz/*addhelper.*
3usr/lib/*/compiz/*annotate.*3usr/lib/*/compiz/*annotate.*
4usr/share/compiz/*annotate.*4usr/share/compiz/*annotate.*
5usr/lib/*/compiz/*animationaddon.*
6usr/share/compiz/*animationaddon.*
5usr/lib/*/compiz/*clone.*7usr/lib/*/compiz/*clone.*
6usr/share/compiz/*clone.*8usr/share/compiz/*clone.*
7usr/lib/*/compiz/*crashhandler.*9usr/lib/*/compiz/*crashhandler.*
810
=== modified file 'debian/compiz-plugins.install.armhf'
--- debian/compiz-plugins.install.armhf 2014-12-02 14:42:34 +0000
+++ debian/compiz-plugins.install.armhf 2016-07-14 15:55:30 +0000
@@ -2,6 +2,8 @@
2usr/share/compiz/*addhelper.*2usr/share/compiz/*addhelper.*
3usr/lib/*/compiz/*annotate.*3usr/lib/*/compiz/*annotate.*
4usr/share/compiz/*annotate.*4usr/share/compiz/*annotate.*
5usr/lib/*/compiz/*animationaddon.*
6usr/share/compiz/*animationaddon.*
5usr/lib/*/compiz/*clone.*7usr/lib/*/compiz/*clone.*
6usr/share/compiz/*clone.*8usr/share/compiz/*clone.*
7usr/lib/*/compiz/*crashhandler.*9usr/lib/*/compiz/*crashhandler.*
810
=== modified file 'debian/compizconfig'
--- debian/compizconfig 2015-02-04 22:20:18 +0000
+++ debian/compizconfig 2016-07-14 15:55:30 +0000
@@ -20,3 +20,8 @@
20plugin_list_autosort = true20plugin_list_autosort = true
21profile = unity21profile = unity
2222
23[general_ubuntu-lowgfx]
24backend = gsettings
25integration = true
26plugin_list_autosort = true
27profile = unity-lowgfx
2328
=== added file 'debian/unity-lowgfx.ini'
--- debian/unity-lowgfx.ini 1970-01-01 00:00:00 +0000
+++ debian/unity-lowgfx.ini 2016-07-14 15:55:30 +0000
@@ -0,0 +1,44 @@
1[core]
2s0_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
3
4[ezoom]
5s0_speed = 100
6
7[expo]
8s0_expo_animation = 3
9
10[fade]
11s0_fade_mode = 1
12s0_fade_time = 1
13
14[grid]
15s0_animation_duration = 1
16
17[resize]
18s0_mode = 2
19
20[opengl]
21s0_texture_filter = 0
22
23[scale]
24s0_skip_animation = true
25
26[unityshell]
27s0_low_graphics_mode = true
28s0_dash_blur_experimental = 0
29
30s0_override_decoration_theme = true
31s0_shadow_x_offset = 1
32s0_shadow_y_offset = 1
33s0_active_shadow_radius = 3
34s0_inactive_shadow_radius = 2
35
36s0_menus_fadein = 0
37s0_menus_fadeout = 0
38s0_menus_discovery_fadein = 0
39s0_menus_discovery_fadeout = 0
40
41s0_autohide_animation = 1
42
43[wall]
44s0_slide_duration = 0
045
=== modified file 'plugins/CMakeLists.txt'
--- plugins/CMakeLists.txt 2016-05-13 06:42:58 +0000
+++ plugins/CMakeLists.txt 2016-07-14 15:55:30 +0000
@@ -10,7 +10,6 @@
10include_directories (${COMPIZ_INTERNAL_INCLUDES})10include_directories (${COMPIZ_INTERNAL_INCLUDES})
1111
12# temporarily disable plugins that aren't ported yet12# temporarily disable plugins that aren't ported yet
13set (COMPIZ_DISABLE_PLUGIN_ANIMATIONADDON ON)
14set (COMPIZ_DISABLE_PLUGIN_BICUBIC ON)13set (COMPIZ_DISABLE_PLUGIN_BICUBIC ON)
15set (COMPIZ_DISABLE_PLUGIN_COLORFILTER ON)14set (COMPIZ_DISABLE_PLUGIN_COLORFILTER ON)
16set (COMPIZ_DISABLE_PLUGIN_GROUP ON)15set (COMPIZ_DISABLE_PLUGIN_GROUP ON)
1716
=== modified file 'plugins/animation/include/animation/animeffect.h'
--- plugins/animation/include/animation/animeffect.h 2015-03-01 21:55:10 +0000
+++ plugins/animation/include/animation/animeffect.h 2016-07-14 15:55:30 +0000
@@ -142,7 +142,7 @@
142 virtual void updateAttrib (GLWindowPaintAttrib &) {}142 virtual void updateAttrib (GLWindowPaintAttrib &) {}
143 virtual void updateTransform (GLMatrix &) {}143 virtual void updateTransform (GLMatrix &) {}
144 virtual void prePaintWindow () {}144 virtual void prePaintWindow () {}
145 virtual void postPaintWindow () {}145 virtual void postPaintWindow (const GLMatrix &) {}
146 virtual bool postPaintWindowUsed () { return false; }146 virtual bool postPaintWindowUsed () { return false; }
147147
148 /// Returns true if the animation is still in progress.148 /// Returns true if the animation is still in progress.
@@ -174,7 +174,10 @@
174 const CompRegion &clip,174 const CompRegion &clip,
175 unsigned int maxGridWidth,175 unsigned int maxGridWidth,
176 unsigned int maxGridHeight);176 unsigned int maxGridHeight);
177 virtual void drawGeometry ();177 virtual void drawGeometry (GLTexture *texture,
178 const GLMatrix &transform,
179 const GLWindowPaintAttrib &attrib,
180 unsigned int mask);
178181
179 virtual bool paintWindowUsed () { return false; }182 virtual bool paintWindowUsed () { return false; }
180 virtual bool paintWindow (GLWindow *gWindow,183 virtual bool paintWindow (GLWindow *gWindow,
181184
=== modified file 'plugins/animation/include/animation/grid.h'
--- plugins/animation/include/animation/grid.h 2012-08-14 06:33:22 +0000
+++ plugins/animation/include/animation/grid.h 2016-07-14 15:55:30 +0000
@@ -101,6 +101,5 @@
101 const CompRegion &clip,101 const CompRegion &clip,
102 unsigned int maxGridWidth,102 unsigned int maxGridWidth,
103 unsigned int maxGridHeight);103 unsigned int maxGridHeight);
104 void drawGeometry ();
105};104};
106#endif105#endif
107106
=== modified file 'plugins/animation/include/animation/multi.h'
--- plugins/animation/include/animation/multi.h 2013-04-25 11:07:54 +0000
+++ plugins/animation/include/animation/multi.h 2016-07-14 15:55:30 +0000
@@ -1,6 +1,8 @@
1#ifndef ANIMATION_MULTI_H1#ifndef ANIMATION_MULTI_H
2#define ANIMATION_MULTI_H2#define ANIMATION_MULTI_H
3#include "animation.h"3#include "animation.h"
4#include <opengl/opengl.h>
5#include <composite/composite.h>
4/// Special class, allows multiple copies of an animation to happen6/// Special class, allows multiple copies of an animation to happen
5/// at any one time. Create your "single copy" animation class first7/// at any one time. Create your "single copy" animation class first
6/// and then create a new animation which derives from this template8/// and then create a new animation which derives from this template
@@ -140,9 +142,8 @@
140 foreach (SingleAnim *a, animList)142 foreach (SingleAnim *a, animList)
141 {143 {
142 setCurrAnimNumber (mAWindow, count);144 setCurrAnimNumber (mAWindow, count);
143 GLWindowPaintAttrib attr (attrib);145 mGlPaintAttribs[count] = attrib;
144 a->updateAttrib (attr);146 a->updateAttrib (mGlPaintAttribs[count]);
145 mGlPaintAttribs.at (count) = attr;
146 ++count;147 ++count;
147 }148 }
148 }149 }
@@ -172,14 +173,14 @@
172 }173 }
173 }174 }
174175
175 void postPaintWindow ()176 void postPaintWindow (const GLMatrix &transform)
176 {177 {
177 int count = 0;178 int count = 0;
178 foreach (SingleAnim *a, animList)179 foreach (SingleAnim *a, animList)
179 {180 {
180 setCurrAnimNumber (mAWindow, count);181 setCurrAnimNumber (mAWindow, count);
181 ++count;182 ++count;
182 a->postPaintWindow ();183 a->postPaintWindow (transform);
183 }184 }
184 }185 }
185186
@@ -377,11 +378,20 @@
377 ++count;378 ++count;
378379
379 if (animList.at (currentAnim)->paintWindowUsed ())380 if (animList.at (currentAnim)->paintWindowUsed ())
380 status |= animList.at (currentAnim)->paintWindow381 status |= animList.at (currentAnim)->paintWindow (gWindow,
381 (gWindow, wAttrib, wTransform, region, mask);382 wAttrib,
383 wTransform,
384 region,
385 mask);
382 else386 else
383 status |= gWindow->glPaint387 {
384 (wAttrib, wTransform, region, mask);388 unsigned int index = gWindow->glPaintGetCurrentIndex ();
389 status |= gWindow->glPaint (wAttrib,
390 wTransform,
391 region,
392 mask);
393 gWindow->glPaintSetCurrentIndex (index);
394 }
385 }395 }
386396
387 return status;397 return status;
388398
=== modified file 'plugins/animation/src/animation.cpp'
--- plugins/animation/src/animation.cpp 2015-03-16 18:45:33 +0000
+++ plugins/animation/src/animation.cpp 2016-07-14 15:55:30 +0000
@@ -1632,20 +1632,20 @@
1632 if (mCurAnimation)1632 if (mCurAnimation)
1633 mCurAnimation->setCurPaintAttrib (attrib);1633 mCurAnimation->setCurPaintAttrib (attrib);
16341634
1635 gWindow->glDrawTexture (texture, transform, attrib, mask);1635 if (mCurAnimation)
1636 {
1637 if (mCurAnimation->initialized ())
1638 mCurAnimation->drawGeometry (texture, transform, attrib, mask);
1639 }
1640 else
1641 gWindow->glDrawTexture (texture, transform, attrib, mask);
1636}1642}
16371643
1638#if 0 // Not ported yet1644#if 0 // Not ported yet
1639void1645void
1640PrivateAnimWindow::glDrawGeometry ()1646PrivateAnimWindow::glDrawGeometry ()
1641{1647{
1642 if (mCurAnimation)1648
1643 {
1644 if (mCurAnimation->initialized ())
1645 mCurAnimation->drawGeometry ();
1646 }
1647 else
1648 gWindow->glDrawGeometry ();
1649}1649}
1650#endif1650#endif
16511651
@@ -1658,11 +1658,15 @@
1658}1658}
16591659
1660void1660void
1661Animation::drawGeometry ()1661Animation::drawGeometry (GLTexture *texture,
1662 const GLMatrix &transform,
1663 const GLWindowPaintAttrib &attrib,
1664 unsigned int mask)
1662{1665{
1663#if 0 // Not ported yet1666 GLWindow::get (mAWindow->mWindow)->glDrawTexture (texture,
1664 mAWindow->priv->gWindow->glDrawGeometry ();1667 transform,
1665#endif1668 attrib,
1669 mask);
1666}1670}
16671671
1668bool1672bool
@@ -1731,18 +1735,7 @@
1731 status = gWindow->glPaint (wAttrib, wTransform, region, mask);1735 status = gWindow->glPaint (wAttrib, wTransform, region, mask);
17321736
1733 if (mCurAnimation->postPaintWindowUsed ())1737 if (mCurAnimation->postPaintWindowUsed ())
1734 {1738 mCurAnimation->postPaintWindow (wTransform);
1735#if 0 // Not ported yet
1736 // Transform to make post-paint coincide with the window
1737 glPushMatrix ();
1738 glLoadMatrixf (wTransform.getMatrix ());
1739#endif
1740 mCurAnimation->postPaintWindow ();
1741
1742#if 0 // Not ported yet
1743 glPopMatrix ();
1744#endif
1745 }
17461739
1747 return status;1740 return status;
1748}1741}
17491742
=== modified file 'plugins/animation/src/glide.cpp'
--- plugins/animation/src/glide.cpp 2015-03-02 08:48:27 +0000
+++ plugins/animation/src/glide.cpp 2016-07-14 15:55:30 +0000
@@ -167,7 +167,7 @@
167}167}
168168
169void169void
170GlideAnim::postPaintWindow ()170GlideAnim::postPaintWindow (const GLMatrix &transform)
171{171{
172 if (90 < glideModRotAngle &&172 if (90 < glideModRotAngle &&
173 glideModRotAngle < 270)173 glideModRotAngle < 270)
174174
=== modified file 'plugins/animation/src/grid.cpp'
--- plugins/animation/src/grid.cpp 2013-07-24 17:36:47 +0000
+++ plugins/animation/src/grid.cpp 2016-07-14 15:55:30 +0000
@@ -388,12 +388,6 @@
388 }388 }
389}389}
390390
391void
392GridAnim::drawGeometry ()
393{
394 // Deprecated
395}
396
397GridTransformAnim::GridTransformAnim (CompWindow *w,391GridTransformAnim::GridTransformAnim (CompWindow *w,
398 WindowEvent curWindowEvent,392 WindowEvent curWindowEvent,
399 float duration,393 float duration,
400394
=== modified file 'plugins/animation/src/private.h'
--- plugins/animation/src/private.h 2013-10-31 15:59:14 +0000
+++ plugins/animation/src/private.h 2016-07-14 15:55:30 +0000
@@ -588,7 +588,7 @@
588588
589 void prePaintWindow ();589 void prePaintWindow ();
590 inline bool postPaintWindowUsed () { return true; }590 inline bool postPaintWindowUsed () { return true; }
591 void postPaintWindow ();591 void postPaintWindow (const GLMatrix &);
592 void adjustDuration ();592 void adjustDuration ();
593 bool zoomToIcon ();593 bool zoomToIcon ();
594 void applyTransform ();594 void applyTransform ();
595595
=== modified file 'plugins/animationaddon/CMakeLists.txt'
--- plugins/animationaddon/CMakeLists.txt 2012-05-21 08:50:26 +0000
+++ plugins/animationaddon/CMakeLists.txt 2016-07-14 15:55:30 +0000
@@ -1,7 +1,4 @@
1find_package (Compiz REQUIRED)1find_package (Compiz REQUIRED)
2include (CompizPlugin)2include (CompizPlugin)
3include (FindOpenGL)
43
5if (OPENGL_GLU_FOUND)4compiz_plugin (animationaddon PLUGINDEPS composite opengl animation)
6 compiz_plugin (animationaddon PLUGINDEPS composite opengl animation LIBRARIES ${OPENGL_glu_LIBRARY} INCDIRS ${OPENGL_INCLUDE_DIR})
7endif (OPENGL_GLU_FOUND)
85
=== modified file 'plugins/animationaddon/include/animationaddon/animationaddon.h'
--- plugins/animationaddon/include/animationaddon/animationaddon.h 2010-01-27 16:32:40 +0000
+++ plugins/animationaddon/include/animationaddon/animationaddon.h 2016-07-14 15:55:30 +0000
@@ -97,7 +97,7 @@
97 GLuint blendMode);97 GLuint blendMode);
98 ~ParticleSystem ();98 ~ParticleSystem ();
9999
100 void draw (int offsetX = 0, int offsetY = 0);100 void draw (const GLMatrix &transform, int offsetX = 0, int offsetY = 0);
101 void update (float time);101 void update (float time);
102 vector<Particle> &particles () { return mParticles; }102 vector<Particle> &particles () { return mParticles; }
103 void activate () { mActive = true; }103 void activate () { mActive = true; }
@@ -120,8 +120,8 @@
120120
121 vector<GLfloat> mVerticesCache;121 vector<GLfloat> mVerticesCache;
122 vector<GLfloat> mCoordsCache;122 vector<GLfloat> mCoordsCache;
123 vector<GLfloat> mColorsCache;123 vector<GLushort> mColorsCache;
124 vector<GLfloat> mDColorsCache;124 vector<GLushort> mDColorsCache;
125};125};
126126
127class ParticleAnim :127class ParticleAnim :
@@ -135,7 +135,7 @@
135 const AnimEffect info,135 const AnimEffect info,
136 const CompRect &icon);136 const CompRect &icon);
137 ~ParticleAnim () {}137 ~ParticleAnim () {}
138 void postPaintWindow ();138 void postPaintWindow (const GLMatrix &);
139 bool postPaintWindowUsed () { return true; }139 bool postPaintWindowUsed () { return true; }
140 void updateBB (CompOutput &output);140 void updateBB (CompOutput &output);
141 bool updateBBUsed () { return true; }141 bool updateBBUsed () { return true; }
@@ -259,14 +259,17 @@
259259
260 void step ();260 void step ();
261 void prePaintWindow ();261 void prePaintWindow ();
262 void postPaintWindow ();262 void postPaintWindow (const GLMatrix &);
263 bool postPaintWindowUsed () { return true; }263 bool postPaintWindowUsed () { return true; }
264 void addGeometry (const GLTexture::MatrixList &matrix,264 void addGeometry (const GLTexture::MatrixList &matrix,
265 const CompRegion &region,265 const CompRegion &region,
266 const CompRegion &clipRegion,266 const CompRegion &clipRegion,
267 unsigned int maxGridWidth,267 unsigned int maxGridWidth,
268 unsigned int maxGridHeight);268 unsigned int maxGridHeight);
269 void drawGeometry ();269 void drawGeometry (GLTexture *texture,
270 const GLMatrix &transform,
271 const GLWindowPaintAttrib &attrib,
272 unsigned int mask);
270 virtual void updateBB (CompOutput &output);273 virtual void updateBB (CompOutput &output);
271 bool updateBBUsed () { return true; }274 bool updateBBUsed () { return true; }
272 bool prePreparePaint (int msSinceLastPaint);275 bool prePreparePaint (int msSinceLastPaint);
@@ -274,7 +277,8 @@
274277
275 virtual void stepPolygon (PolygonObject *p,278 virtual void stepPolygon (PolygonObject *p,
276 float forwardProgress);279 float forwardProgress);
277 virtual void transformPolygon (const PolygonObject *p) {}280 virtual void transformPolygon (GLMatrix &matrix,
281 const PolygonObject *p) {}
278282
279 /// For effects that have decel. motion283 /// For effects that have decel. motion
280 virtual bool deceleratingMotion () { return false; }284 virtual bool deceleratingMotion () { return false; }
@@ -301,7 +305,8 @@
301 void processIntersectingPolygons ();305 void processIntersectingPolygons ();
302 virtual void freePolygonObjects ();306 virtual void freePolygonObjects ();
303 void freeClipsPolygons ();307 void freeClipsPolygons ();
304 void prepareDrawingForAttrib (GLFragment::Attrib &attrib);308 void prepareDrawingForAttrib (GLWindowPaintAttrib &attrib,
309 GLVertexBuffer &vertexBuffer);
305310
306 int mNumDrawGeometryCalls;311 int mNumDrawGeometryCalls;
307 int mNumClipsPassed; /**< # of clips passed to animAddWindowGeometry so far312 int mNumClipsPassed; /**< # of clips passed to animAddWindowGeometry so far
@@ -327,15 +332,16 @@
327 bool mIncludeShadows; ///< Whether to include shadows in polygon332 bool mIncludeShadows; ///< Whether to include shadows in polygon
328333
329private:334private:
330 inline void drawPolygonClipIntersection (const PolygonObject *p,335 inline void drawPolygonClipIntersection (GLTexture *texture,
336 const GLMatrix &transform,
337 const PolygonObject *p,
331 const Clip4Polygons &c,338 const Clip4Polygons &c,
332 const GLfloat *vertexTexCoords,339 const GLfloat *vertexTexCoords,
333 int pass,340 int pass,
334 float forwardProgress,341 float forwardProgress,
335 GLdouble clipPlane[4][4],
336 const CompOutput &output,342 const CompOutput &output,
337 float newOpacity,343 float newOpacity,
338 bool decelerates,344 bool decelerates,
339 GLfloat skewMat[16]);345 GLMatrix &skewMat);
340};346};
341#endif347#endif
342348
=== modified file 'plugins/animationaddon/src/airplane.cpp'
--- plugins/animationaddon/src/airplane.cpp 2013-02-27 11:33:10 +0000
+++ plugins/animationaddon/src/airplane.cpp 2016-07-14 15:55:30 +0000
@@ -271,8 +271,8 @@
271 pv[22] = topLeftY;271 pv[22] = topLeftY;
272 pv[23] = -halfThick;272 pv[23] = -halfThick;
273273
274 // 16 indices for 4 sides (for quad strip)274 // 24 indices for 4 sides (for triangle strip)
275 p->sideIndices = (GLushort *) calloc (4 * 4, sizeof (GLushort));275 p->sideIndices = (GLushort *) calloc (6 * 4, sizeof (GLushort));
276 if (!p->sideIndices)276 if (!p->sideIndices)
277 {277 {
278 compLogMessage ("animation", CompLogLevelError,278 compLogMessage ("animation", CompLogLevelError,
@@ -287,22 +287,30 @@
287 ind[id++] = 0;287 ind[id++] = 0;
288 ind[id++] = 7;288 ind[id++] = 7;
289 ind[id++] = 6;289 ind[id++] = 6;
290 ind[id++] = 1;290 ind[id++] = 0;
291291 ind[id++] = 1;
292 ind[id++] = 1;292 ind[id++] = 6;
293 ind[id++] = 6;293
294 ind[id++] = 5;294 ind[id++] = 1;
295 ind[id++] = 2;295 ind[id++] = 6;
296296 ind[id++] = 5;
297 ind[id++] = 2;297 ind[id++] = 1;
298 ind[id++] = 5;298 ind[id++] = 2;
299 ind[id++] = 4;299 ind[id++] = 5;
300 ind[id++] = 3;300
301301 ind[id++] = 2;
302 ind[id++] = 3;302 ind[id++] = 5;
303 ind[id++] = 4;303 ind[id++] = 4;
304 ind[id++] = 7;304 ind[id++] = 2;
305 ind[id++] = 0;305 ind[id++] = 3;
306 ind[id++] = 4;
307
308 ind[id++] = 3;
309 ind[id++] = 4;
310 ind[id++] = 7;
311 ind[id++] = 3;
312 ind[id++] = 0;
313 ind[id++] = 7;
306314
307 if (i < 4)315 if (i < 4)
308 {316 {
@@ -318,6 +326,8 @@
318 p->boundingBox.x2 = ceil (p->centerPos.x () + bottomRightX);326 p->boundingBox.x2 = ceil (p->centerPos.x () + bottomRightX);
319 p->boundingBox.y2 = ceil (p->centerPos.y () + bottomLeftY);327 p->boundingBox.y2 = ceil (p->centerPos.y () + bottomLeftY);
320 }328 }
329
330 p->normals = NULL;
321 331
322 i++;332 i++;
323 }333 }
@@ -692,41 +702,42 @@
692}702}
693703
694void704void
695AirplaneAnim::transformPolygon (const PolygonObject *pol)705AirplaneAnim::transformPolygon (GLMatrix &matrix,
706 const PolygonObject *pol)
696{707{
697 AirplanePolygonObject *p = (AirplanePolygonObject *) pol;708 AirplanePolygonObject *p = (AirplanePolygonObject *) pol;
698709
699 glRotatef (p->flyRotation.x (), 1, 0, 0); //rotate on axis X710 matrix.rotate (p->flyRotation.x (), 1, 0, 0); //rotate on axis X
700 glRotatef (-p->flyRotation.y (), 0, 1, 0); // rotate on axis Y711 matrix.rotate (-p->flyRotation.y (), 0, 1, 0); // rotate on axis Y
701 glRotatef (p->flyRotation.z (), 0, 0, 1); // rotate on axis Z712 matrix.rotate (p->flyRotation.z (), 0, 0, 1); // rotate on axis Z
702713
703 glScalef (1.0 / (1.0 + p->flyScale),714 matrix.scale (1.0 / (1.0 + p->flyScale),
704 1.0 / (1.0 + p->flyScale), 1.0 / (1.0 + p->flyScale));715 1.0 / (1.0 + p->flyScale), 1.0 / (1.0 + p->flyScale));
705716
706 // Move by "rotation axis offset A"717 // Move by "rotation axis offset A"
707 glTranslatef (p->rotAxisOffsetA.x (), p->rotAxisOffsetA.y (),718 matrix.translate (p->rotAxisOffsetA.x (), p->rotAxisOffsetA.y (),
708 p->rotAxisOffsetA.z ());719 p->rotAxisOffsetA.z ());
709720
710 // Rotate by desired angle A721 // Rotate by desired angle A
711 glRotatef (p->rotAngleA, p->rotAxisA.x (), p->rotAxisA.y (),722 matrix.rotate (p->rotAngleA, p->rotAxisA.x (), p->rotAxisA.y (),
712 p->rotAxisA.z ());723 p->rotAxisA.z ());
713724
714 // Move back to center from A725 // Move back to center from A
715 glTranslatef (-p->rotAxisOffsetA.x (), -p->rotAxisOffsetA.y (),726 matrix.translate (-p->rotAxisOffsetA.x (), -p->rotAxisOffsetA.y (),
716 -p->rotAxisOffsetA.z ());727 -p->rotAxisOffsetA.z ());
717728
718729
719 // Move by "rotation axis offset B"730 // Move by "rotation axis offset B"
720 glTranslatef (p->rotAxisOffsetB.x (), p->rotAxisOffsetB.y (),731 matrix.translate (p->rotAxisOffsetB.x (), p->rotAxisOffsetB.y (),
721 p->rotAxisOffsetB.z ());732 p->rotAxisOffsetB.z ());
722733
723 // Rotate by desired angle B734 // Rotate by desired angle B
724 glRotatef (p->rotAngleB, p->rotAxisB.x (), p->rotAxisB.y (),735 matrix.rotate (p->rotAngleB, p->rotAxisB.x (), p->rotAxisB.y (),
725 p->rotAxisB.z ());736 p->rotAxisB.z ());
726737
727 // Move back to center from B738 // Move back to center from B
728 glTranslatef (-p->rotAxisOffsetB.x (), -p->rotAxisOffsetB.y (),739 matrix.translate (-p->rotAxisOffsetB.x (), -p->rotAxisOffsetB.y (),
729 -p->rotAxisOffsetB.z ());740 -p->rotAxisOffsetB.z ());
730}741}
731742
732743
733744
=== modified file 'plugins/animationaddon/src/animationaddon.cpp'
--- plugins/animationaddon/src/animationaddon.cpp 2013-05-09 13:43:07 +0000
+++ plugins/animationaddon/src/animationaddon.cpp 2016-07-14 15:55:30 +0000
@@ -81,7 +81,7 @@
81#include "private.h"81#include "private.h"
8282
83class AnimAddonPluginVTable :83class AnimAddonPluginVTable :
84 public CompPlugin::VTableForScreenAndWindow<AnimAddonScreen, AnimAddonWindow>84 public CompPlugin::VTableForScreenAndWindow<AnimAddonScreen, AnimAddonWindow, ANIMATIONADDON_ABI>
85{85{
86public:86public:
87 bool init ();87 bool init ();
@@ -232,7 +232,7 @@
232}232}
233233
234AnimAddonWindow::AnimAddonWindow (CompWindow *w) :234AnimAddonWindow::AnimAddonWindow (CompWindow *w) :
235 PluginClassHandler<AnimAddonWindow, CompWindow> (w),235 PluginClassHandler<AnimAddonWindow, CompWindow, ANIMATIONADDON_ABI> (w),
236 mWindow (w),236 mWindow (w),
237 aWindow (AnimWindow::get (w))237 aWindow (AnimWindow::get (w))
238{238{
239239
=== modified file 'plugins/animationaddon/src/dissolve.cpp'
--- plugins/animationaddon/src/dissolve.cpp 2010-08-23 03:24:20 +0000
+++ plugins/animationaddon/src/dissolve.cpp 2016-07-14 15:55:30 +0000
@@ -33,7 +33,7 @@
33 float o = 0.2;33 float o = 0.2;
34 float factor = (4 - layer) * o;34 float factor = (4 - layer) * o;
35 35
36 attrib.opacity *= o / (1.0 - factor);36 attrib.opacity *= (o / (1.0 - factor)) * (1.0 - getDissolveSingleProgress ());
37}37}
3838
39void39void
@@ -62,5 +62,14 @@
62void62void
63DissolveSingleAnim::updateBB (CompOutput &output)63DissolveSingleAnim::updateBB (CompOutput &output)
64{64{
65 mAWindow->expandBBWithWindow ();65 CompRect outRect (mAWindow->mWindow->outputRect ());
66
67 Box windowBox =
68 {
69 static_cast <short int> (outRect.x () - 4),
70 static_cast <short int> (outRect.x () + outRect.width () + 4),
71 static_cast <short int> (outRect.y () - 4),
72 static_cast <short int> (outRect.y () + outRect.height () + 4)
73 };
74 mAWindow->expandBBWithBox (windowBox);
66}75}
6776
=== modified file 'plugins/animationaddon/src/particle.cpp'
--- plugins/animationaddon/src/particle.cpp 2013-02-27 11:33:10 +0000
+++ plugins/animationaddon/src/particle.cpp 2016-07-14 15:55:30 +0000
@@ -81,7 +81,7 @@
81}81}
8282
83void83void
84ParticleSystem::draw (int offsetX, int offsetY)84ParticleSystem::draw (const GLMatrix &transform, int offsetX, int offsetY)
85{85{
86 // TODO86 // TODO
87 // The part below should ideally be done in ParticleSystem constructor87 // The part below should ideally be done in ParticleSystem constructor
@@ -95,9 +95,8 @@
95 GL_RGBA, GL_UNSIGNED_BYTE, fireTex);95 GL_RGBA, GL_UNSIGNED_BYTE, fireTex);
96 glBindTexture (GL_TEXTURE_2D, 0);96 glBindTexture (GL_TEXTURE_2D, 0);
9797
9898 GLMatrix translatedMatrix (transform);
99 glPushMatrix ();99 //translatedMatrix.translate (offsetX - mX, offsetY - mY, 0);
100 glTranslated (offsetX - mX, offsetY - mY, 0);
101100
102 glEnable (GL_BLEND);101 glEnable (GL_BLEND);
103 if (mTex)102 if (mTex)
@@ -105,26 +104,27 @@
105 glBindTexture (GL_TEXTURE_2D, mTex);104 glBindTexture (GL_TEXTURE_2D, mTex);
106 glEnable (GL_TEXTURE_2D);105 glEnable (GL_TEXTURE_2D);
107 }106 }
108 mGScreen->setTexEnvMode (GL_MODULATE);
109107
110 mVerticesCache.resize (4 * 3 * mParticles.size ());108 mVerticesCache.resize (6 * 3 * mParticles.size ());
111 mCoordsCache.resize (4 * 2 * mParticles.size ());109 mCoordsCache.resize (6 * 2 * mParticles.size ());
112 mColorsCache.resize (4 * 4 * mParticles.size ());110 mColorsCache.resize (6 * 4 * mParticles.size ());
113 if (mDarkenAmount > 0)111 if (mDarkenAmount > 0)
114 mDColorsCache.resize (4 * 4 * mParticles.size ());112 mDColorsCache.resize (6 * 4 * mParticles.size ());
115113
116 GLfloat *dcolors = &mDColorsCache[0];114 GLushort *dcolors = &mDColorsCache[0];
117 GLfloat *vertices = &mVerticesCache[0];115 GLfloat *vertices = &mVerticesCache[0];
118 GLfloat *coords = &mCoordsCache[0];116 GLfloat *coords = &mCoordsCache[0];
119 GLfloat *colors = &mColorsCache[0];117 GLushort *colors = &mColorsCache[0];
120118
121 int cornersSize = sizeof (GLfloat) * 8;119 int cornersSize = sizeof (GLfloat) * 12;
122 int colorSize = sizeof (GLfloat) * 4;120 int colorSize = sizeof (GLfloat) * 4;
123121
124 GLfloat cornerCoords[8] = {0.0, 0.0,122 GLfloat cornerCoords[12] = {0.0, 0.0,
125 0.0, 1.0,123 0.0, 1.0,
126 1.0, 1.0,124 1.0, 1.0,
127 1.0, 0.0};125 1.0, 1.0,
126 1.0, 0.0,
127 0.0, 0.0};
128128
129 int numActive = 0;129 int numActive = 0;
130130
@@ -133,7 +133,7 @@
133 if (part.life <= 0.0f) // Ignore dead particles133 if (part.life <= 0.0f) // Ignore dead particles
134 continue;134 continue;
135135
136 numActive += 4;136 numActive += 6;
137137
138 float w = part.width / 2;138 float w = part.width / 2;
139 float h = part.height / 2;139 float h = part.height / 2;
@@ -154,24 +154,34 @@
154 vertices[8] = part.z;154 vertices[8] = part.z;
155155
156 vertices[9] = part.x + w;156 vertices[9] = part.x + w;
157 vertices[10] = part.y - h;157 vertices[10] = part.y + h;
158 vertices[11] = part.z;158 vertices[11] = part.z;
159159
160 vertices += 12;160 vertices[12] = part.x + w;
161 vertices[13] = part.y - h;
162 vertices[14] = part.z;
163
164 vertices[15] = part.x - w;
165 vertices[16] = part.y - h;
166 vertices[17] = part.z;
167
168 vertices += 18;
161169
162 memcpy (coords, cornerCoords, cornersSize);170 memcpy (coords, cornerCoords, cornersSize);
163171
164 coords += 8;172 coords += 12;
165173
166 colors[0] = part.r;174 colors[0] = part.r * COLOR;
167 colors[1] = part.g;175 colors[1] = part.g * COLOR;
168 colors[2] = part.b;176 colors[2] = part.b * COLOR;
169 colors[3] = part.life * part.a;177 colors[3] = part.life * part.a * COLOR;
170 memcpy (colors + 4, colors, colorSize);178 memcpy (colors + 4, colors, colorSize);
171 memcpy (colors + 8, colors, colorSize);179 memcpy (colors + 8, colors, colorSize);
172 memcpy (colors + 12, colors, colorSize);180 memcpy (colors + 12, colors, colorSize);
181 memcpy (colors + 16, colors, colorSize);
182 memcpy (colors + 20, colors, colorSize);
173183
174 colors += 16;184 colors += 24;
175185
176 if (mDarkenAmount > 0)186 if (mDarkenAmount > 0)
177 {187 {
@@ -182,34 +192,35 @@
182 memcpy (dcolors + 4, dcolors, colorSize);192 memcpy (dcolors + 4, dcolors, colorSize);
183 memcpy (dcolors + 8, dcolors, colorSize);193 memcpy (dcolors + 8, dcolors, colorSize);
184 memcpy (dcolors + 12, dcolors, colorSize);194 memcpy (dcolors + 12, dcolors, colorSize);
195 memcpy (dcolors + 16, dcolors, colorSize);
196 memcpy (dcolors + 20, dcolors, colorSize);
185197
186 dcolors += 16;198 dcolors += 24;
187 }199 }
188 }200 }
189201
190 glEnableClientState (GL_COLOR_ARRAY);202 GLVertexBuffer *stream = GLVertexBuffer::streamingBuffer ();
191
192 glTexCoordPointer (2, GL_FLOAT, 2 * sizeof (GLfloat), &mCoordsCache[0]);
193 glVertexPointer (3, GL_FLOAT, 3 * sizeof (GLfloat), &mVerticesCache[0]);
194203
195 // darken the background204 // darken the background
196 if (mDarkenAmount > 0)205 if (mDarkenAmount > 0)
197 {206 {
198 glBlendFunc (GL_ZERO, GL_ONE_MINUS_SRC_ALPHA);207 glBlendFunc (GL_ZERO, GL_ONE_MINUS_SRC_ALPHA);
199 glColorPointer (4, GL_FLOAT, 4 * sizeof (GLfloat), &mDColorsCache[0]);208 stream->begin (GL_TRIANGLES);
200 glDrawArrays (GL_QUADS, 0, numActive);209 stream->addTexCoords (0, numActive, &mCoordsCache[0]);
210 stream->addVertices (numActive, &mVerticesCache[0]);
211 stream->addColors (numActive, &mDColorsCache[0]);
212 if (stream->end ())
213 stream->render (translatedMatrix);
201 }214 }
202 // draw particles215 // draw particles
203 glBlendFunc (GL_SRC_ALPHA, mBlendMode);216 glBlendFunc (GL_SRC_ALPHA, mBlendMode);
204217
205 glColorPointer (4, GL_FLOAT, 4 * sizeof (GLfloat), &mColorsCache[0]);218 stream->begin (GL_TRIANGLES);
206 glDrawArrays (GL_QUADS, 0, numActive);219 stream->addTexCoords (0, numActive, &mCoordsCache[0]);
207 glDisableClientState (GL_COLOR_ARRAY);220 stream->addVertices (numActive, &mVerticesCache[0]);
208221 stream->addColors (numActive, &mColorsCache[0]);
209 glPopMatrix ();222 if (stream->end ())
210 glColor4usv (defaultColor);223 stream->render (translatedMatrix);
211
212 mGScreen->setTexEnvMode (GL_REPLACE);
213224
214 glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);225 glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
215 glDisable (GL_TEXTURE_2D);226 glDisable (GL_TEXTURE_2D);
@@ -217,12 +228,13 @@
217}228}
218229
219void230void
220ParticleAnim::postPaintWindow ()231ParticleAnim::postPaintWindow (const GLMatrix &transform)
221{232{
222 foreach (ParticleSystem &ps, mParticleSystems)233 foreach (ParticleSystem &ps, mParticleSystems)
223 if (ps.active ())234 if (ps.active ())
224 // offset by window pos.235 // offset by window pos.
225 ps.draw (mWindow->x () - mWindow->output ().left,236 ps.draw (transform,
237 mWindow->x () - mWindow->output ().left,
226 mWindow->y () - mWindow->output ().top);238 mWindow->y () - mWindow->output ().top);
227}239}
228240
229241
=== modified file 'plugins/animationaddon/src/polygon.cpp'
--- plugins/animationaddon/src/polygon.cpp 2013-02-27 11:33:10 +0000
+++ plugins/animationaddon/src/polygon.cpp 2016-07-14 15:55:30 +0000
@@ -34,7 +34,6 @@
34 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.34 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
35 */35 */
3636
37#include <GL/glu.h>
38#include "private.h"37#include "private.h"
3938
40static const unsigned short MIN_WINDOW_GRID_SIZE = 10;39static const unsigned short MIN_WINDOW_GRID_SIZE = 10;
@@ -256,8 +255,8 @@
256 pv[22] = -halfH;255 pv[22] = -halfH;
257 pv[23] = -halfThick;256 pv[23] = -halfThick;
258257
259 // 16 indices for 4 sides (for quads)258 // 24 indices for 4 sides (for triangles)
260 p->sideIndices = (GLushort *)calloc (4 * 4, sizeof (GLushort));259 p->sideIndices = (GLushort *)calloc (6 * 4, sizeof (GLushort));
261 if (!p->sideIndices)260 if (!p->sideIndices)
262 {261 {
263 compLogMessage ("animationaddon", CompLogLevelError,262 compLogMessage ("animationaddon", CompLogLevelError,
@@ -275,6 +274,8 @@
275 ind[id++] = 6; // First vertex274 ind[id++] = 6; // First vertex
276 ind[id++] = 1;275 ind[id++] = 1;
277 ind[id++] = 0;276 ind[id++] = 0;
277 ind[id++] = 6;
278 ind[id++] = 0;
278 ind[id++] = 7;279 ind[id++] = 7;
279 nor[6 * 3 + 0] = -1; // Flat shading only uses 1st vertex's normal280 nor[6 * 3 + 0] = -1; // Flat shading only uses 1st vertex's normal
280 nor[6 * 3 + 1] = 0; // in a polygon, vertex 6 for this face.281 nor[6 * 3 + 1] = 0; // in a polygon, vertex 6 for this face.
@@ -284,16 +285,20 @@
284 ind[id++] = 1;285 ind[id++] = 1;
285 ind[id++] = 6;286 ind[id++] = 6;
286 ind[id++] = 5;287 ind[id++] = 5;
288 ind[id++] = 5;
287 ind[id++] = 2;289 ind[id++] = 2;
290 ind[id++] = 1;
288 nor[1 * 3 + 0] = 0;291 nor[1 * 3 + 0] = 0;
289 nor[1 * 3 + 1] = 1;292 nor[1 * 3 + 1] = 1;
290 nor[1 * 3 + 2] = 0;293 nor[1 * 3 + 2] = 0;
291294
292 // Right face295 // Right face
296 ind[id++] = 5;
293 ind[id++] = 2;297 ind[id++] = 2;
298 ind[id++] = 3;
294 ind[id++] = 5;299 ind[id++] = 5;
300 ind[id++] = 3;
295 ind[id++] = 4;301 ind[id++] = 4;
296 ind[id++] = 3;
297 nor[2 * 3 + 0] = 1;302 nor[2 * 3 + 0] = 1;
298 nor[2 * 3 + 1] = 0;303 nor[2 * 3 + 1] = 0;
299 nor[2 * 3 + 2] = 0;304 nor[2 * 3 + 2] = 0;
@@ -302,7 +307,9 @@
302 ind[id++] = 7;307 ind[id++] = 7;
303 ind[id++] = 0;308 ind[id++] = 0;
304 ind[id++] = 3;309 ind[id++] = 3;
310 ind[id++] = 3;
305 ind[id++] = 4;311 ind[id++] = 4;
312 ind[id++] = 7;
306 nor[7 * 3 + 0] = 0;313 nor[7 * 3 + 0] = 0;
307 nor[7 * 3 + 1] = -1;314 nor[7 * 3 + 1] = -1;
308 nor[7 * 3 + 2] = 0;315 nor[7 * 3 + 2] = 0;
@@ -541,8 +548,8 @@
541 pv[34] = topY;548 pv[34] = topY;
542 pv[35] = -halfThick;549 pv[35] = -halfThick;
543550
544 // 24 indices per 6 sides (for quads)551 // 36 indices per 6 sides (for triangles)
545 p->sideIndices = (GLushort *)calloc (4 * 6, sizeof (GLushort));552 p->sideIndices = (GLushort *)calloc (6 * 6, sizeof (GLushort));
546 if (!p->sideIndices)553 if (!p->sideIndices)
547 {554 {
548 compLogMessage ("animationaddon", CompLogLevelError,555 compLogMessage ("animationaddon", CompLogLevelError,
@@ -562,7 +569,9 @@
562 ind[id++] = 11; // First vertex569 ind[id++] = 11; // First vertex
563 ind[id++] = 10;570 ind[id++] = 10;
564 ind[id++] = 1;571 ind[id++] = 1;
572 ind[id++] = 1;
565 ind[id++] = 0;573 ind[id++] = 0;
574 ind[id++] = 11;
566 nor[11 * 3 + 0] = -1; // Flat shading only uses 1st vertex's normal575 nor[11 * 3 + 0] = -1; // Flat shading only uses 1st vertex's normal
567 nor[11 * 3 + 1] = -1; // in a polygon, vertex 11 for this face.576 nor[11 * 3 + 1] = -1; // in a polygon, vertex 11 for this face.
568 nor[11 * 3 + 2] = 0;577 nor[11 * 3 + 2] = 0;
@@ -573,7 +582,9 @@
573 ind[id++] = 1;582 ind[id++] = 1;
574 ind[id++] = 10;583 ind[id++] = 10;
575 ind[id++] = 9;584 ind[id++] = 9;
585 ind[id++] = 9;
576 ind[id++] = 2;586 ind[id++] = 2;
587 ind[id++] = 1;
577 nor[1 * 3 + 0] = -1;588 nor[1 * 3 + 0] = -1;
578 nor[1 * 3 + 1] = 0;589 nor[1 * 3 + 1] = 0;
579 nor[1 * 3 + 2] = 0;590 nor[1 * 3 + 2] = 0;
@@ -582,7 +593,9 @@
582 ind[id++] = 2;593 ind[id++] = 2;
583 ind[id++] = 9;594 ind[id++] = 9;
584 ind[id++] = 8;595 ind[id++] = 8;
596 ind[id++] = 8;
585 ind[id++] = 3;597 ind[id++] = 3;
598 ind[id++] = 2;
586 nor[2 * 3 + 0] = -1;599 nor[2 * 3 + 0] = -1;
587 nor[2 * 3 + 1] = 1;600 nor[2 * 3 + 1] = 1;
588 nor[2 * 3 + 2] = 0;601 nor[2 * 3 + 2] = 0;
@@ -593,7 +606,9 @@
593 ind[id++] = 3;606 ind[id++] = 3;
594 ind[id++] = 8;607 ind[id++] = 8;
595 ind[id++] = 7;608 ind[id++] = 7;
609 ind[id++] = 7;
596 ind[id++] = 4;610 ind[id++] = 4;
611 ind[id++] = 3;
597 nor[3 * 3 + 0] = 1;612 nor[3 * 3 + 0] = 1;
598 nor[3 * 3 + 1] = 1;613 nor[3 * 3 + 1] = 1;
599 nor[3 * 3 + 2] = 0;614 nor[3 * 3 + 2] = 0;
@@ -604,7 +619,9 @@
604 ind[id++] = 4;619 ind[id++] = 4;
605 ind[id++] = 7;620 ind[id++] = 7;
606 ind[id++] = 6;621 ind[id++] = 6;
622 ind[id++] = 6;
607 ind[id++] = 5;623 ind[id++] = 5;
624 ind[id++] = 4;
608 nor[4 * 3 + 0] = 1;625 nor[4 * 3 + 0] = 1;
609 nor[4 * 3 + 1] = 0;626 nor[4 * 3 + 1] = 0;
610 nor[4 * 3 + 2] = 0;627 nor[4 * 3 + 2] = 0;
@@ -613,7 +630,9 @@
613 ind[id++] = 5;630 ind[id++] = 5;
614 ind[id++] = 6;631 ind[id++] = 6;
615 ind[id++] = 11;632 ind[id++] = 11;
633 ind[id++] = 11;
616 ind[id++] = 0;634 ind[id++] = 0;
635 ind[id++] = 5;
617 nor[5 * 3 + 0] = 1;636 nor[5 * 3 + 0] = 1;
618 nor[5 * 3 + 1] = -1;637 nor[5 * 3 + 1] = -1;
619 nor[5 * 3 + 2] = 0;638 nor[5 * 3 + 2] = 0;
@@ -946,8 +965,8 @@
946 pv[22] = -shards[yc][xc].centerY + shards[yc][xc].pt3Y;965 pv[22] = -shards[yc][xc].centerY + shards[yc][xc].pt3Y;
947 pv[23] = -halfThick;966 pv[23] = -halfThick;
948967
949 // 16 indices for 4 sides (for quads)968 // 24 indices for 4 sides (for triangles)
950 p->sideIndices = (GLushort *)calloc (4 * 4, sizeof (GLushort));969 p->sideIndices = (GLushort *)calloc (6 * 4, sizeof (GLushort));
951 if (!p->sideIndices)970 if (!p->sideIndices)
952 {971 {
953 compLogMessage ("animationaddon",972 compLogMessage ("animationaddon",
@@ -965,7 +984,9 @@
965 ind[id++] = 6; // First vertex984 ind[id++] = 6; // First vertex
966 ind[id++] = 1;985 ind[id++] = 1;
967 ind[id++] = 0;986 ind[id++] = 0;
987 ind[id++] = 6;
968 ind[id++] = 7;988 ind[id++] = 7;
989 ind[id++] = 0;
969 nor[6 * 3 + 0] = -1; // Flat shading only uses 1st vertex's normal990 nor[6 * 3 + 0] = -1; // Flat shading only uses 1st vertex's normal
970 nor[6 * 3 + 1] = 0; // in a polygon, vertex 6 for this face.991 nor[6 * 3 + 1] = 0; // in a polygon, vertex 6 for this face.
971 nor[6 * 3 + 2] = 0;992 nor[6 * 3 + 2] = 0;
@@ -974,7 +995,9 @@
974 ind[id++] = 1;995 ind[id++] = 1;
975 ind[id++] = 6;996 ind[id++] = 6;
976 ind[id++] = 5;997 ind[id++] = 5;
998 ind[id++] = 1;
977 ind[id++] = 2;999 ind[id++] = 2;
1000 ind[id++] = 5;
978 nor[1 * 3 + 0] = 0;1001 nor[1 * 3 + 0] = 0;
979 nor[1 * 3 + 1] = 1;1002 nor[1 * 3 + 1] = 1;
980 nor[1 * 3 + 2] = 0;1003 nor[1 * 3 + 2] = 0;
@@ -983,7 +1006,9 @@
983 ind[id++] = 2;1006 ind[id++] = 2;
984 ind[id++] = 5;1007 ind[id++] = 5;
985 ind[id++] = 4;1008 ind[id++] = 4;
1009 ind[id++] = 2;
986 ind[id++] = 3;1010 ind[id++] = 3;
1011 ind[id++] = 4;
987 nor[2 * 3 + 0] = 1;1012 nor[2 * 3 + 0] = 1;
988 nor[2 * 3 + 1] = 0;1013 nor[2 * 3 + 1] = 0;
989 nor[2 * 3 + 2] = 0;1014 nor[2 * 3 + 2] = 0;
@@ -992,7 +1017,9 @@
992 ind[id++] = 7;1017 ind[id++] = 7;
993 ind[id++] = 0;1018 ind[id++] = 0;
994 ind[id++] = 3;1019 ind[id++] = 3;
1020 ind[id++] = 7;
995 ind[id++] = 4;1021 ind[id++] = 4;
1022 ind[id++] = 3;
996 nor[7 * 3 + 0] = 0;1023 nor[7 * 3 + 0] = 0;
997 nor[7 * 3 + 1] = -1;1024 nor[7 * 3 + 1] = -1;
998 nor[7 * 3 + 2] = 0;1025 nor[7 * 3 + 2] = 0;
@@ -1067,8 +1094,11 @@
1067 if (!matrix.size ())1094 if (!matrix.size ())
1068 return;1095 return;
10691096
1070 GLWindow::Geometry &geometry = GLWindow::get (mWindow)->geometry ();1097 /* Force glDrawTexture to be called by pushing a single vertex into the
1071 geometry.vCount = 1; // Force glDrawGeometry to be called1098 * window's vertex buffer */
1099 GLWindow *gWindow = GLWindow::get (mWindow);
1100 GLfloat vertexData[3] = {0.0f, 0.0f, 0.0f};
1101 gWindow->vertexBuffer ()->addVertices (1, vertexData);
10721102
1073 bool dontStoreClips = true;1103 bool dontStoreClips = true;
10741104
@@ -1298,56 +1328,62 @@
1298}1328}
12991329
1300void1330void
1301PolygonAnim::prepareDrawingForAttrib (GLFragment::Attrib &attrib)1331PolygonAnim::prepareDrawingForAttrib (GLWindowPaintAttrib &attrib,
1302{1332 GLVertexBuffer &vertexBuffer)
1303 if (GL::canDoSaturated && attrib.getSaturation () != COLOR)1333{
1304 {1334 // Disabled for now until lighting can be re-written
1305 GLfloat constant[4];1335 // attrib.brightness *= 0.76;
13061336 GLushort color = (attrib.brightness * attrib.opacity) >> 16;
1307 if (GL::canDoSlightlySaturated && attrib.getSaturation () > 0)1337 GLfloat colorNormalized = color / static_cast <GLfloat> (COLOR);
1308 {1338
1309 constant[3] = attrib.getOpacity () / 65535.0f;1339 vertexBuffer.color4f (colorNormalized,
1310 constant[0] = constant[1] = constant[2] = constant[3] *1340 colorNormalized,
1311 attrib.getBrightness () / 65535.0f;1341 colorNormalized,
13121342 attrib.opacity / static_cast <GLfloat> (COLOR));
1313 glTexEnvfv (GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, constant);1343}
1314 }1344
1315 else1345namespace
1316 {1346{
1317 constant[3] = attrib.getOpacity () / 65535.0f;1347 enum class Winding : int
1318 constant[0] = constant[1] = constant[2] = constant[3] *1348 {
1319 attrib.getBrightness () / 65535.0f;1349 Clockwise = 0,
13201350 Counterclockwise = 1
1321 constant[0] = 0.5f + 0.5f * RED_SATURATION_WEIGHT * constant[0];1351 };
1322 constant[1] = 0.5f + 0.5f * GREEN_SATURATION_WEIGHT * constant[1];1352
1323 constant[2] = 0.5f + 0.5f * BLUE_SATURATION_WEIGHT * constant[2];1353 /* This function assumes that indices is large enough to
13241354 * hold a polygon of nSides sides */
1325 glTexEnvfv (GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, constant);1355 unsigned int determineIndicesForPolygon (GLushort *indices,
1326 }1356 GLushort nSides,
1327 }1357 Winding direction)
1328 else1358 {
1329 {1359 unsigned int index = 0;
1330 attrib.setBrightness (0.76 * attrib.getBrightness ());1360 bool front = direction == Winding::Counterclockwise;
13311361
1332 GLushort color =1362 for (GLushort i = 2; i < nSides; ++i)
1333 (attrib.getOpacity () * attrib.getBrightness ()) >> 16;1363 {
13341364 indices[index] = 0;
1335 mGScreen->setTexEnvMode (GL_MODULATE);1365 indices[index + 1] = (front ? (i - 1) : i);
1336 glColor4us (color, color, color, attrib.getOpacity ());1366 indices[index + 2] = (front ? i : (i - 1));
1367
1368 index += 3;
1369 }
1370
1371 return index;
1337 }1372 }
1338}1373}
13391374
1340inline void1375inline void
1341PolygonAnim::drawPolygonClipIntersection (const PolygonObject *p,1376PolygonAnim::drawPolygonClipIntersection (GLTexture *texture,
1377 const GLMatrix &transform,
1378 const PolygonObject *p,
1342 const Clip4Polygons &c,1379 const Clip4Polygons &c,
1343 const GLfloat *vertexTexCoords,1380 const GLfloat *vertexTexCoords,
1344 int pass,1381 int pass,
1345 float forwardProgress,1382 float forwardProgress,
1346 GLdouble clipPlanes[4][4],
1347 const CompOutput &output,1383 const CompOutput &output,
1348 float newOpacity,1384 float newOpacity,
1349 bool decelerates,1385 bool decelerates,
1350 GLfloat skewMat[16])1386 GLMatrix &skewMat)
1351{1387{
1352 int nSides = p->nSides;1388 int nSides = p->nSides;
1353 float newOpacityPolygon = newOpacity;1389 float newOpacityPolygon = newOpacity;
@@ -1386,52 +1422,56 @@
1386 else if (newOpacityPolygon > 0.9999) // if fully opaque1422 else if (newOpacityPolygon > 0.9999) // if fully opaque
1387 return; // draw only non-opaque ones in pass 11423 return; // draw only non-opaque ones in pass 1
13881424
1389 glPushMatrix ();1425 GLMatrix polygonTransform (transform);
13901426
1391 if (mCorrectPerspective == CorrectPerspectivePolygon)1427 if (mCorrectPerspective == CorrectPerspectivePolygon)
1392 getPerspectiveCorrectionMat (p, skewMat, NULL, output);1428 getPerspectiveCorrectionMat (p, NULL, &skewMat, output);
13931429
1394 if (mCorrectPerspective != CorrectPerspectiveNone)1430 if (mCorrectPerspective != CorrectPerspectiveNone)
1395 glMultMatrixf (skewMat);1431 polygonTransform *= skewMat;
13961432
1397 // Center1433 // Center
1398 glTranslatef (p->centerPos.x (),1434 polygonTransform.translate (p->centerPos.x (),
1399 p->centerPos.y (),1435 p->centerPos.y (),
1400 p->centerPos.z ());1436 p->centerPos.z ());
14011437
1402 // Scale z first1438 // Scale z first
1403 glScalef (1.0f, 1.0f, 1.0f / ::screen->width ());1439 polygonTransform.scale (1.0f, 1.0f, 1.0f / ::screen->width ());
14041440
1405 transformPolygon (p);1441 transformPolygon (polygonTransform, p);
14061442
1407 // Move by "rotation axis offset"1443 // Move by "rotation axis offset"
1408 glTranslatef (p->rotAxisOffset.x (),1444 polygonTransform.translate (p->rotAxisOffset.x (),
1409 p->rotAxisOffset.y (),1445 p->rotAxisOffset.y (),
1410 p->rotAxisOffset.z ());1446 p->rotAxisOffset.z ());
14111447
1412 // Rotate by desired angle1448 // Rotate by desired angle
1413 glRotatef (p->rotAngle,1449 polygonTransform.rotate (p->rotAngle,
1414 p->rotAxis.x (), p->rotAxis.y (), p->rotAxis.z ());1450 p->rotAxis.x (),
1451 p->rotAxis.y (),
1452 p->rotAxis.z ());
14151453
1416 // Move back to center1454 // Move back to center
1417 glTranslatef (-p->rotAxisOffset.x (),1455 polygonTransform.translate (-p->rotAxisOffset.x (),
1418 -p->rotAxisOffset.y (),1456 -p->rotAxisOffset.y (),
1419 -p->rotAxisOffset.z ());1457 -p->rotAxisOffset.z ());
14201458
1421 // Scale back1459 // Scale back
1422 glScalef (1.0f, 1.0f, ::screen->width ());1460 polygonTransform.scale (1.0f, 1.0f, ::screen->width ());
14231461
1424 clipPlanes[0][3] = -(c.boxf.x1 - p->centerPosStart.x ());1462 // clipPlanes[0][3] = -(c.boxf.x1 - p->centerPosStart.x ());
1425 clipPlanes[1][3] = -(c.boxf.y1 - p->centerPosStart.y ());1463 // clipPlanes[1][3] = -(c.boxf.y1 - p->centerPosStart.y ());
1426 clipPlanes[2][3] = (c.boxf.x2 - p->centerPosStart.x ());1464 // clipPlanes[2][3] = (c.boxf.x2 - p->centerPosStart.x ());
1427 clipPlanes[3][3] = (c.boxf.y2 - p->centerPosStart.y ());1465 // clipPlanes[3][3] = (c.boxf.y2 - p->centerPosStart.y ());
1428 glClipPlane (GL_CLIP_PLANE0, clipPlanes[0]);1466 // Clip planes are not supported on Modern OpenGL
1429 glClipPlane (GL_CLIP_PLANE1, clipPlanes[1]);1467 //
1430 glClipPlane (GL_CLIP_PLANE2, clipPlanes[2]);1468 // glClipPlane (GL_CLIP_PLANE0, clipPlanes[0]);
1431 glClipPlane (GL_CLIP_PLANE3, clipPlanes[3]);1469 // glClipPlane (GL_CLIP_PLANE1, clipPlanes[1]);
14321470 // glClipPlane (GL_CLIP_PLANE2, clipPlanes[2]);
1433 for (int k = 0; k < 4; k++)1471 // glClipPlane (GL_CLIP_PLANE3, clipPlanes[3]);
1434 glEnable (GL_CLIP_PLANE0 + k);1472 // for (int k = 0; k < 4; k++)
1473 // glEnable (GL_CLIP_PLANE0 + k);
1474
1435 bool fadeBackAndSides =1475 bool fadeBackAndSides =
1436 mBackAndSidesFadeDur > 0 &&1476 mBackAndSidesFadeDur > 0 &&
1437 forwardProgress <= mBackAndSidesFadeDur;1477 forwardProgress <= mBackAndSidesFadeDur;
@@ -1445,56 +1485,92 @@
1445 (forwardProgress / mBackAndSidesFadeDur);1485 (forwardProgress / mBackAndSidesFadeDur);
1446 }1486 }
14471487
1448 GLFragment::Attrib attrib = mCurPaintAttrib;1488 GLWindowPaintAttrib attrib = mCurPaintAttrib;
1449 attrib.setOpacity (newOpacityPolygon2 * OPAQUE);1489 attrib.opacity = newOpacityPolygon2 * OPAQUE;
14501490
1451 prepareDrawingForAttrib (attrib);1491 GLVertexBuffer *streamingVertexBuffer = GLVertexBuffer::streamingBuffer ();
14521492
1453 // Draw back face1493 // Draw back face
1454 glVertexPointer (3, GL_FLOAT, 0, p->vertices + 3 * nSides);1494 glActiveTexture (GL_TEXTURE0);
1455 if (mThickness > 0)1495 texture->enable (GLTexture::Fast);
1456 glNormalPointer (GL_FLOAT, 0, p->normals + 3 * nSides);1496 streamingVertexBuffer->begin (GL_TRIANGLES);
1457 else1497 streamingVertexBuffer->addVertices (nSides, p->vertices + 3 * nSides);
1458 glNormal3f (0.0f, 0.0f, -1.0f);1498 if (p->normals)
1459 glTexCoordPointer (2, GL_FLOAT, 0, &vertexTexCoords[2 * nSides]);1499 streamingVertexBuffer->addNormals (nSides, p->normals + 3 * nSides);
1460 glDrawArrays (GL_POLYGON, 0, nSides);1500 streamingVertexBuffer->addTexCoords (0, nSides, &vertexTexCoords[2 * nSides]);
1501 if (streamingVertexBuffer->end ())
1502 {
1503 GLushort indices[64];
1504 unsigned int nIndices = determineIndicesForPolygon (indices,
1505 nSides,
1506 Winding::Counterclockwise);
1507 streamingVertexBuffer->render (polygonTransform,
1508 attrib,
1509 indices,
1510 nIndices);
1511 }
14611512
1462 // Vertex coords1513 // GL_QUADS uses a different vertex normal than the first
1463 glVertexPointer (3, GL_FLOAT, 0, p->vertices);1514 // so I use GL_TRIANGLES to make sure the normals are right.
1464 if (mThickness > 0)1515 texture->disable ();
1465 glNormalPointer (GL_FLOAT, 0, p->normals);1516 streamingVertexBuffer->begin (GL_TRIANGLES);
1466 else1517 streamingVertexBuffer->addVertices (p->nVertices, p->vertices);
1467 glNormal3f (0.0f, 0.0f, 1.0f);1518 prepareDrawingForAttrib (attrib, *streamingVertexBuffer);
1468 glTexCoordPointer (2, GL_FLOAT, 0, vertexTexCoords);1519 if (mThickness > 0 && p->normals)
1520 streamingVertexBuffer->addNormals (nSides, p->normals);
14691521
1470 // Draw quads for sides1522 // Draw quads for sides
1471 for (int k = 0; k < nSides; k++)1523 if (streamingVertexBuffer->end ())
1472 {1524 {
1473 // GL_QUADS uses a different vertex normal than the first1525 for (int k = 0; k < nSides; k++)
1474 // so I use GL_POLYGON to make sure the normals are right.1526 streamingVertexBuffer->render (polygonTransform,
1475 glDrawElements (GL_POLYGON, 4,1527 attrib,
1476 GL_UNSIGNED_SHORT,1528 p->sideIndices + k * 6,
1477 p->sideIndices + k * 4);1529 6);
1478 }1530 }
14791531
1532 streamingVertexBuffer->colorDefault ();
1533
1534 texture->enable (GLTexture::Fast);
1535 streamingVertexBuffer->begin (GL_TRIANGLES);
1480 // if opacity was changed just above1536 // if opacity was changed just above
1481 if (fadeBackAndSides)1537 if (fadeBackAndSides)
1482 {1538 {
1483 // Go back to normal opacity for front face1539 // Go back to normal opacity for front face
1484 attrib = mCurPaintAttrib;1540 attrib = mCurPaintAttrib;
1485 attrib.setOpacity (newOpacityPolygon * OPAQUE);1541 attrib.opacity = newOpacityPolygon * OPAQUE;
1486 prepareDrawingForAttrib (attrib);1542 }
1487 }1543 streamingVertexBuffer->addVertices (nSides, p->vertices);
1488 // Draw front face1544 if (p->normals)
1489 glDrawArrays (GL_POLYGON, 0, nSides);1545 streamingVertexBuffer->addNormals (nSides, p->normals);
1490 for (int k = 0; k < 4; k++)1546 streamingVertexBuffer->addTexCoords (0, nSides, vertexTexCoords);
1491 glDisable (GL_CLIP_PLANE0 + k);1547 if (streamingVertexBuffer->end ())
14921548 {
1493 glPopMatrix ();1549 GLushort indices[64];
1550 unsigned int nIndices = determineIndicesForPolygon (indices,
1551 nSides,
1552 Winding::Counterclockwise);
1553 streamingVertexBuffer->render (polygonTransform,
1554 attrib,
1555 indices,
1556 nIndices);
1557 }
1558
1559 streamingVertexBuffer->colorDefault ();
1560
1561 texture->disable ();
1562
1563 // Clip planes are not supported on Modern OpenGL
1564 //
1565 // for (int k = 0; k < 4; k++)
1566 // glDisable (GL_CLIP_PLANE0 + k);
1494}1567}
14951568
1496void1569void
1497PolygonAnim::drawGeometry ()1570PolygonAnim::drawGeometry (GLTexture *texture,
1571 const GLMatrix &transform,
1572 const GLWindowPaintAttrib &attrib,
1573 unsigned int mask)
1498{1574{
1499 mNumDrawGeometryCalls++;1575 mNumDrawGeometryCalls++;
15001576
@@ -1540,96 +1616,52 @@
15401616
1541 // OpenGL stuff starts here1617 // OpenGL stuff starts here
15421618
1543 GLboolean normalArrayWas = false;1619 // Lighting will require special shaders, which aren't
15441620 // implemented right now, so disable it.
1545 if (mThickness > 0)1621 //
1546 {1622 // if (mDoLighting)
1547 glPushAttrib (GL_NORMALIZE);1623 // {
1548 glEnable (GL_NORMALIZE);1624 // glPushAttrib (GL_SHADE_MODEL);
15491625 // glShadeModel (GL_FLAT);
1550 normalArrayWas = glIsEnabled (GL_NORMAL_ARRAY);1626 //
1551 glEnableClientState (GL_NORMAL_ARRAY);1627 // glPushAttrib (GL_LIGHT0);
1552 }1628 // glPushAttrib (GL_COLOR_MATERIAL);
15531629 // glPushAttrib (GL_LIGHTING);
1554 if (mDoLighting)1630 // glEnable (GL_COLOR_MATERIAL);
1555 {1631 // glEnable (GL_LIGHTING);
1556 glPushAttrib (GL_SHADE_MODEL);1632 //
1557 glShadeModel (GL_FLAT);1633 // GLfloat ambientLight[] = { 0.3f, 0.3f, 0.3f, 0.3f };
15581634 // GLfloat diffuseLight[] = { 0.9f, 0.9f, 0.9f, 0.9f };
1559 glPushAttrib (GL_LIGHT0);1635 // GLfloat light0Position[] = { -0.5f, 0.5f, 9.0f, 0.0f };
1560 glPushAttrib (GL_COLOR_MATERIAL);1636 //
1561 glPushAttrib (GL_LIGHTING);1637 // glLightfv (GL_LIGHT0, GL_AMBIENT, ambientLight);
1562 glEnable (GL_COLOR_MATERIAL);1638 // glLightfv (GL_LIGHT0, GL_DIFFUSE, diffuseLight);
1563 glEnable (GL_LIGHTING);1639 // glLightfv (GL_LIGHT0, GL_POSITION, light0Position);
15641640 // }
1565 GLfloat ambientLight[] = { 0.3f, 0.3f, 0.3f, 0.3f };
1566 GLfloat diffuseLight[] = { 0.9f, 0.9f, 0.9f, 0.9f };
1567 GLfloat light0Position[] = { -0.5f, 0.5f, 9.0f, 0.0f };
1568
1569 glLightfv (GL_LIGHT0, GL_AMBIENT, ambientLight);
1570 glLightfv (GL_LIGHT0, GL_DIFFUSE, diffuseLight);
1571 glLightfv (GL_LIGHT0, GL_POSITION, light0Position);
1572 }
1573
1574 glPushMatrix ();
1575
1576 glPushAttrib (GL_STENCIL_BUFFER_BIT);
1577 glDisable (GL_STENCIL_TEST);
15781641
1579 if (mDoDepthTest)1642 if (mDoDepthTest)
1580 {1643 {
1581 // Depth test1644 // Depth test
1582 glPushAttrib (GL_DEPTH_FUNC);
1583 glPushAttrib (GL_DEPTH_TEST);
1584 glDepthFunc (GL_LEQUAL);1645 glDepthFunc (GL_LEQUAL);
1646 glDepthMask (GL_TRUE);
1585 glEnable (GL_DEPTH_TEST);1647 glEnable (GL_DEPTH_TEST);
1586 }1648 }
15871649
1588 // Clip planes1650 // Clip planes
1589 GLdouble clipPlanes[4][4] = {{ 1, 0, 0, 0 },1651 // GLdouble clipPlanes[4][4] = {{ 1, 0, 0, 0 },
1590 { 0, 1, 0, 0 },1652 // { 0, 1, 0, 0 },
1591 { -1, 0, 0, 0 },1653 // { -1, 0, 0, 0 },
1592 { 0, -1, 0, 0 }};1654 // { 0, -1, 0, 0 }};
15931655
1594 // Save old color values1656 float opacity = mCurPaintAttrib.opacity / 65535.0;
1595 GLfloat oldColor[4];
1596
1597 glGetFloatv (GL_CURRENT_COLOR, oldColor);
1598
1599 // Determine where we are called from in paint.c's drawWindowTexture
1600 // to find out how we should change the opacity
1601 GLint prevActiveTexture = GL_TEXTURE0_ARB;
1602 bool saturationFull = true;
1603
1604 if (GL::canDoSaturated && mCurPaintAttrib.getSaturation () != COLOR)
1605 {
1606 saturationFull = false;
1607 if (GL::canDoSlightlySaturated &&
1608 mCurPaintAttrib.getSaturation () > 0)
1609 {
1610 if (mCurPaintAttrib.getOpacity () < OPAQUE ||
1611 mCurPaintAttrib.getBrightness () != BRIGHT)
1612 prevActiveTexture = GL_TEXTURE3_ARB;
1613 else
1614 prevActiveTexture = GL_TEXTURE2_ARB;
1615 }
1616 else
1617 prevActiveTexture = GL_TEXTURE1_ARB;
1618 }
1619
1620 float opacity = mCurPaintAttrib.getOpacity () / 65535.0;
16211657
1622 float newOpacity = opacity;1658 float newOpacity = opacity;
1623 float fadePassedBy;1659 float fadePassedBy;
16241660
1625 bool decelerates = deceleratingMotion ();1661 bool decelerates = deceleratingMotion ();
16261662
1627 glPushAttrib (GL_BLEND);
1628 glEnable (GL_BLEND);1663 glEnable (GL_BLEND);
16291664
1630 if (saturationFull)
1631 mGScreen->setTexEnvMode (GL_MODULATE);
1632
1633 // if fade-out duration is not specified per polygon1665 // if fade-out duration is not specified per polygon
1634 if (mAllFadeDuration > -1.0f)1666 if (mAllFadeDuration > -1.0f)
1635 {1667 {
@@ -1657,9 +1689,9 @@
1657 static_cast<ExtensionPluginAnimAddon*> (getExtensionPluginInfo ())->1689 static_cast<ExtensionPluginAnimAddon*> (getExtensionPluginInfo ())->
1658 output ();1690 output ();
16591691
1660 GLfloat skewMat[16];1692 GLMatrix skewMat;
1661 if (mCorrectPerspective == CorrectPerspectiveWindow)1693 if (mCorrectPerspective == CorrectPerspectiveWindow)
1662 getPerspectiveCorrectionMat (NULL, skewMat, NULL, *output);1694 getPerspectiveCorrectionMat (NULL, NULL, &skewMat, *output);
16631695
1664 // pass: 0: draw opaque ones1696 // pass: 0: draw opaque ones
1665 // 1: draw transparent ones1697 // 1: draw transparent ones
@@ -1673,10 +1705,12 @@
1673 const GLfloat *vTexCoords = &c->polygonVertexTexCoords[0];1705 const GLfloat *vTexCoords = &c->polygonVertexTexCoords[0];
1674 foreach (const PolygonObject *p, mPolygons)1706 foreach (const PolygonObject *p, mPolygons)
1675 {1707 {
1676 drawPolygonClipIntersection (p, *c,1708 drawPolygonClipIntersection (texture,
1709 transform,
1710 p, *c,
1677 vTexCoords,1711 vTexCoords,
1678 pass, forwardProgress,1712 pass, forwardProgress,
1679 clipPlanes, *output,1713 *output,
1680 newOpacity,1714 newOpacity,
1681 decelerates,1715 decelerates,
1682 skewMat);1716 skewMat);
@@ -1688,10 +1722,12 @@
1688 foreach (const PolygonClipInfo *pci,1722 foreach (const PolygonClipInfo *pci,
1689 c->intersectingPolygonInfos)1723 c->intersectingPolygonInfos)
1690 {1724 {
1691 drawPolygonClipIntersection (pci->p, *c,1725 drawPolygonClipIntersection (texture,
1726 transform,
1727 pci->p, *c,
1692 &pci->vertexTexCoords[0],1728 &pci->vertexTexCoords[0],
1693 pass, forwardProgress,1729 pass, forwardProgress,
1694 clipPlanes, *output,1730 *output,
1695 newOpacity,1731 newOpacity,
1696 decelerates,1732 decelerates,
1697 skewMat);1733 skewMat);
@@ -1702,45 +1738,24 @@
1702 // Restore1738 // Restore
1703 // -----------------------------------------1739 // -----------------------------------------
17041740
1705 // Restore old color values1741 glDisable (GL_BLEND);
1706 glColor4f (oldColor[0], oldColor[1], oldColor[2], oldColor[3]);
1707
1708 glPopAttrib (); // GL_BLEND
17091742
1710 if (mDoDepthTest)1743 if (mDoDepthTest)
1711 {1744 {
1712 glPopAttrib (); // GL_DEPTH_TEST1745 glDisable (GL_DEPTH_TEST);
1713 glPopAttrib (); // GL_DEPTH_FUNC1746 glDepthMask (GL_FALSE);
1714 }1747 }
17151748
1716 glPopAttrib (); // GL_STENCIL_BUFFER_BIT1749 // Lighting will require special shaders whcih
17171750 // are not implemented for now.
1718 // Restore texture stuff1751 //
1719 if (saturationFull)1752 // if (mDoLighting)
1720 mGScreen->setTexEnvMode (GL_REPLACE);1753 // {
17211754 // glPopAttrib (); // GL_LIGHTING
1722 glPopMatrix ();1755 // glPopAttrib (); // GL_COLOR_MATERIAL
1723 (GL::activeTexture) (prevActiveTexture);1756 // glPopAttrib (); // GL_LIGHT0
17241757 // glPopAttrib (); // GL_SHADE_MODEL
1725 if (mDoLighting)1758 // }
1726 {
1727 glPopAttrib (); // GL_LIGHTING
1728 glPopAttrib (); // GL_COLOR_MATERIAL
1729 glPopAttrib (); // GL_LIGHT0
1730 glPopAttrib (); // GL_SHADE_MODEL
1731 }
1732
1733 if (mThickness > 0)
1734 {
1735 glPopAttrib (); // GL_NORMALIZE
1736
1737 if (normalArrayWas)
1738 glEnableClientState (GL_NORMAL_ARRAY);
1739 else
1740 glDisableClientState (GL_NORMAL_ARRAY);
1741 }
1742 else
1743 glNormal3f (0.0f, 0.0f, -1.0f);
17441759
1745 if (mClipsUpdated) // set the end mark for this group of clips1760 if (mClipsUpdated) // set the end mark for this group of clips
1746 mLastClipInGroup.push_back (lastClip);1761 mLastClipInGroup.push_back (lastClip);
@@ -1760,7 +1775,7 @@
1760}1775}
17611776
1762void1777void
1763PolygonAnim::postPaintWindow ()1778PolygonAnim::postPaintWindow (const GLMatrix &)
1764{1779{
1765 if (mClipsUpdated && // clips should be dropped only in the 1st step1780 if (mClipsUpdated && // clips should be dropped only in the 1st step
1766 mNumDrawGeometryCalls == 0) // if clips not drawn1781 mNumDrawGeometryCalls == 0) // if clips not drawn
@@ -1842,20 +1857,7 @@
18421857
1843 prepareTransform (output, wTransform, wTransform2);1858 prepareTransform (output, wTransform, wTransform2);
18441859
1845 const float *screenProjection = gScreen->projectionMatrix ();1860 GLMatrix *screenProjection = gScreen->projectionMatrix ();
1846 GLdouble dModel[16];
1847 GLdouble dProjection[16];
1848 for (int i = 0; i < 16; i++)
1849 {
1850 dProjection[i] = screenProjection[i];
1851 }
1852 GLint viewport[4] =
1853 {output.region ()->extents.x1,
1854 output.region ()->extents.y1,
1855 output.width (),
1856 output.height ()};
1857 GLdouble px, py, pz;
1858
1859 GLMatrix *modelViewTransform = &wTransform;1861 GLMatrix *modelViewTransform = &wTransform;
18601862
1861 GLMatrix skewMat;1863 GLMatrix skewMat;
@@ -1878,9 +1880,6 @@
18781880
1879 // if modelViewTransform == wTransform2, then1881 // if modelViewTransform == wTransform2, then
1880 // it changes for each polygon1882 // it changes for each polygon
1881 const float *modelViewMatrix = modelViewTransform->getMatrix ();
1882 for (int j = 0; j < 16; j++)
1883 dModel[j] = modelViewMatrix[j];
18841883
1885 Point3d center = p->centerPos;1884 Point3d center = p->centerPos;
1886 float radius = p->boundSphereRadius + 2;1885 float radius = p->boundSphereRadius + 2;
@@ -1924,13 +1923,16 @@
1924 Point3d *pnt = cubeCorners;1923 Point3d *pnt = cubeCorners;
1925 for (int j = 0; j < N_POINTS; j++, pnt++)1924 for (int j = 0; j < N_POINTS; j++, pnt++)
1926 {1925 {
1927 if (!gluProject (pnt->x (), pnt->y (), pnt->z (),1926 namespace com = compiz::opengl::matrix;
1928 dModel, dProjection, viewport,1927 CompPoint p (com::projectIntoViewport(*screenProjection,
1929 &px, &py, &pz))1928 *modelViewTransform,
1930 return;1929 output,
1930 GLVector (pnt->x (),
1931 pnt->y (),
1932 pnt->z ())));
19311933
1932 py = ::screen->height () - py;1934 p.setY (::screen->height () - p.y ());
1933 mAWindow->expandBBWithPoint (px + 0.5, py + 0.5);1935 mAWindow->expandBBWithPoint (p.x () + 0.5, p.y () + 0.5);
1934 }1936 }
1935#undef N_POINTS1937#undef N_POINTS
1936 }1938 }
@@ -1988,9 +1990,16 @@
1988 }1990 }
1989 }1991 }
1990 }1992 }
1993
1991 if (depthUsed)1994 if (depthUsed)
1992 {1995 {
1996#ifdef USE_GLES
1997 glClearDepthf (1000.0f);
1998#else
1993 glClearDepth (1000.0f);1999 glClearDepth (1000.0f);
2000#endif
2001 glDepthMask (GL_TRUE);
1994 glClear (GL_DEPTH_BUFFER_BIT);2002 glClear (GL_DEPTH_BUFFER_BIT);
2003 glDepthMask (GL_FALSE);
1995 }2004 }
1996}2005}
19972006
=== modified file 'plugins/animationaddon/src/private.h'
--- plugins/animationaddon/src/private.h 2013-10-31 15:59:14 +0000
+++ plugins/animationaddon/src/private.h 2016-07-14 15:55:30 +0000
@@ -70,7 +70,7 @@
70};70};
7171
72class AnimAddonWindow :72class AnimAddonWindow :
73 public PluginClassHandler<AnimAddonWindow, CompWindow>73 public PluginClassHandler<AnimAddonWindow, CompWindow, ANIMATIONADDON_ABI>
74{74{
75public:75public:
76 AnimAddonWindow (CompWindow *);76 AnimAddonWindow (CompWindow *);
@@ -224,7 +224,8 @@
224 init ();224 init ();
225225
226 void226 void
227 transformPolygon (const PolygonObject *p);227 transformPolygon (GLMatrix &matrix,
228 const PolygonObject *p);
228229
229 bool230 bool
230 tesselateIntoAirplane ();231 tesselateIntoAirplane ();
231232
=== modified file 'plugins/composite/src/privates.h'
--- plugins/composite/src/privates.h 2013-02-28 03:39:31 +0000
+++ plugins/composite/src/privates.h 2016-07-14 15:55:30 +0000
@@ -142,7 +142,6 @@
142{142{
143 public:143 public:
144 PrivateCompositeWindow (CompWindow *w, CompositeWindow *cw);144 PrivateCompositeWindow (CompWindow *w, CompositeWindow *cw);
145 ~PrivateCompositeWindow ();
146145
147 void windowNotify (CompWindowNotify n);146 void windowNotify (CompWindowNotify n);
148 void resizeNotify (int dx, int dy, int dwidth, int dheight);147 void resizeNotify (int dx, int dy, int dwidth, int dheight);
@@ -156,11 +155,7 @@
156 void allowFurtherRebindAttempts ();155 void allowFurtherRebindAttempts ();
157 bool frozen ();156 bool frozen ();
158157
159 static void handleDamageRect (CompositeWindow *w,158 static void handleDamageRect (CompositeWindow *w, XRectangle const& rect);
160 int x,
161 int y,
162 int width,
163 int height);
164159
165 public:160 public:
166 CompWindow *window;161 CompWindow *window;
@@ -179,9 +174,7 @@
179 unsigned short brightness;174 unsigned short brightness;
180 unsigned short saturation;175 unsigned short saturation;
181176
182 XRectangle *damageRects;177 std::vector<XRectangle> damageRects;
183 int sizeDamage;
184 int nDamage;
185178
186 private:179 private:
187180
188181
=== modified file 'plugins/composite/src/window.cpp'
--- plugins/composite/src/window.cpp 2013-04-13 13:53:39 +0000
+++ plugins/composite/src/window.cpp 2016-07-14 15:55:30 +0000
@@ -115,20 +115,11 @@
115 overlayWindow (false),115 overlayWindow (false),
116 opacity (OPAQUE),116 opacity (OPAQUE),
117 brightness (BRIGHT),117 brightness (BRIGHT),
118 saturation (COLOR),118 saturation (COLOR)
119 damageRects (0),
120 sizeDamage (0),
121 nDamage (0)
122{119{
123 WindowInterface::setHandler (w);120 WindowInterface::setHandler (w);
124}121}
125122
126PrivateCompositeWindow::~PrivateCompositeWindow ()
127{
128 if (sizeDamage)
129 free (damageRects);
130}
131
132bool123bool
133PrivateCompositeWindow::bind ()124PrivateCompositeWindow::bind ()
134{125{
@@ -405,32 +396,14 @@
405CompositeWindow::processDamage (XDamageNotifyEvent *de)396CompositeWindow::processDamage (XDamageNotifyEvent *de)
406{397{
407 if (priv->window->syncWait ())398 if (priv->window->syncWait ())
408 {399 priv->damageRects.push_back (de->area);
409 if (priv->nDamage == priv->sizeDamage)
410 {
411 priv->damageRects = (XRectangle *) realloc (priv->damageRects,
412 (priv->sizeDamage + 1) *
413 sizeof (XRectangle));
414 priv->sizeDamage += 1;
415 }
416
417 priv->damageRects[priv->nDamage].x = de->area.x;
418 priv->damageRects[priv->nDamage].y = de->area.y;
419 priv->damageRects[priv->nDamage].width = de->area.width;
420 priv->damageRects[priv->nDamage].height = de->area.height;
421 priv->nDamage++;
422 }
423 else400 else
424 priv->handleDamageRect (this, de->area.x, de->area.y,401 priv->handleDamageRect (this, de->area);
425 de->area.width, de->area.height);
426}402}
427403
428void404void
429PrivateCompositeWindow::handleDamageRect (CompositeWindow *w,405PrivateCompositeWindow::handleDamageRect (CompositeWindow *w,
430 int x,406 XRectangle const& rect)
431 int y,
432 int width,
433 int height)
434{407{
435 if (!w->priv->redirected)408 if (!w->priv->redirected)
436 return;409 return;
@@ -440,15 +413,15 @@
440 if (!w->priv->damaged)413 if (!w->priv->damaged)
441 w->priv->damaged = initial = true;414 w->priv->damaged = initial = true;
442415
443 if (!w->damageRect (initial, CompRect (x, y, width, height)))416 if (!w->damageRect (initial, CompRect (rect.x, rect.y, rect.width, rect.height)))
444 {417 {
445 const CompWindow::Geometry &geom = w->priv->window->geometry ();418 const CompWindow::Geometry &geom = w->priv->window->geometry ();
446419
447 x += geom.x () + geom.border ();420 int x = rect.x + geom.x () + geom.border ();
448 y += geom.y () + geom.border ();421 int y = rect.y + geom.y () + geom.border ();
449422
450 w->priv->cScreen->damageRegion (CompRegion (CompRect423 w->priv->cScreen->damageRegion (CompRegion (CompRect
451 (x, y, width, height)));424 (x, y, rect.width, rect.height)));
452 }425 }
453426
454 if (initial)427 if (initial)
@@ -565,17 +538,10 @@
565538
566 case CompWindowNotifySyncAlarm:539 case CompWindowNotifySyncAlarm:
567 {540 {
568 XRectangle *rects;541 for (XRectangle const& rect : damageRects)
542 PrivateCompositeWindow::handleDamageRect (cWindow, rect);
569543
570 rects = damageRects;544 damageRects.clear();
571 while (nDamage--)
572 {
573 PrivateCompositeWindow::handleDamageRect (cWindow,
574 rects[nDamage].x,
575 rects[nDamage].y,
576 rects[nDamage].width,
577 rects[nDamage].height);
578 }
579 break;545 break;
580 }546 }
581547
582548
=== modified file 'plugins/expo/expo.xml.in'
--- plugins/expo/expo.xml.in 2016-05-10 07:21:00 +0000
+++ plugins/expo/expo.xml.in 2016-07-14 15:55:30 +0000
@@ -95,7 +95,7 @@
95 <_long>The animation used when initiating or leaving Expo.</_long>95 <_long>The animation used when initiating or leaving Expo.</_long>
96 <default>0</default>96 <default>0</default>
97 <min>0</min>97 <min>0</min>
98 <max>2</max>98 <max>3</max>
99 <desc>99 <desc>
100 <value>0</value>100 <value>0</value>
101 <_name>Zoom</_name>101 <_name>Zoom</_name>
@@ -108,6 +108,10 @@
108 <value>2</value>108 <value>2</value>
109 <_name>Vortex</_name>109 <_name>Vortex</_name>
110 </desc>110 </desc>
111 <desc>
112 <value>3</value>
113 <_name>None</_name>
114 </desc>
111 </option>115 </option>
112 </group>116 </group>
113 <group>117 <group>
114118
=== modified file 'plugins/expo/src/expo.cpp'
--- plugins/expo/src/expo.cpp 2016-05-16 06:23:55 +0000
+++ plugins/expo/src/expo.cpp 2016-07-14 15:55:30 +0000
@@ -402,10 +402,18 @@
402 float val = (static_cast <float> (msSinceLastPaint) / 1000.0f) /402 float val = (static_cast <float> (msSinceLastPaint) / 1000.0f) /
403 optionGetZoomTime ();403 optionGetZoomTime ();
404404
405 if (expoMode)405 if (optionGetExpoAnimation() != ExpoScreen::ExpoAnimationNone) {
406 expoCam = MIN (1.0, expoCam + val);406 if (expoMode)
407 else407 expoCam = MIN (1.0, expoCam + val);
408 expoCam = MAX (0.0, expoCam - val);408 else
409 expoCam = MAX (0.0, expoCam - val);
410 }
411 else {
412 if (expoMode)
413 expoCam = 1;
414 else
415 expoCam = 0;
416 }
409417
410 if (expoCam)418 if (expoCam)
411 {419 {
412420
=== modified file 'plugins/ezoom/ezoom.xml.in' (properties changed: -x to +x)
--- plugins/ezoom/ezoom.xml.in 2015-10-26 17:15:43 +0000
+++ plugins/ezoom/ezoom.xml.in 2016-07-14 15:55:30 +0000
@@ -81,49 +81,218 @@
81 </group>81 </group>
82 <group>82 <group>
83 <_short>Specific Zoom</_short>83 <_short>Specific Zoom</_short>
84 <option type="bool" name="spec_target_focus">
85 <_short>Target Focused Window on Specific Zoom</_short>
86 <_long>Check this to target the focused window when jumping to a specific zoom level. Uncheck this to target the mouse.</_long>
87 <default>true</default>
88 </option>
89 <option type="float" name="zoom_specific_1">
90 <_short>Specific Zoom 1</_short>
91 <_long>Zoom level to go to when triggering hotkey 1</_long>
92 <default>1.0</default>
93 <min>0.1</min>
94 <max>1.0</max>
95 <precision>0.01</precision>
96 </option>
84 <option type="key" name="zoom_specific_1_key">97 <option type="key" name="zoom_specific_1_key">
85 <_short>Zoom Specific Level 1</_short>98 <_short>Zoom to Specific Zoom 1</_short>
86 <_long>Zoom to the specific zoom level 1</_long>99 <_long>Zoom to the specific zoom level 1</_long>
87 <default></default>100 <default></default>
88 </option>101 </option>
89 <option type="float" name="zoom_spec1">102 <option type="float" name="zoom_specific_2">
90 <_short>Specific zoom factor 1</_short>103 <_short>Specific Zoom 2</_short>
91 <_long>Zoom level to go to when triggering hotkey 1</_long>104 <_long>Zoom level to go to when triggering hotkey 2</_long>
92 <default>1.0</default>105 <default>1.0</default>
93 <min>0.1</min>106 <min>0.1</min>
94 <max>1.0</max>107 <max>1.0</max>
95 <precision>0.01</precision>108 <precision>0.01</precision>
96 </option>109 </option>
97 <option type="key" name="zoom_specific_2_key">110 <option type="key" name="zoom_specific_2_key">
98 <_short>Zoom Specific Level 2</_short>111 <_short>Zoom to Specific Zoom 2</_short>
99 <_long>Zoom to the specific zoom level 2</_long>112 <_long>Zoom to the specific zoom level 2</_long>
100 <default></default>113 <default></default>
101 </option>114 </option>
102 <option type="float" name="zoom_spec2">115 <option type="float" name="zoom_specific_3">
103 <_short>Specific zoom factor 2</_short>116 <_short>Specific Zoom 3</_short>
104 <_long>Zoom level to go to when triggering hotkey 2</_long>117 <_long>Zoom level to go to when triggering hotkey 3</_long>
105 <default>0.5</default>118 <default>1.0</default>
106 <min>0.1</min>119 <min>0.1</min>
107 <max>1.0</max>120 <max>1.0</max>
108 <precision>0.01</precision>121 <precision>0.01</precision>
109 </option>122 </option>
110 <option type="key" name="zoom_specific_3_key">123 <option type="key" name="zoom_specific_3_key">
111 <_short>Zoom Specific Level 3</_short>124 <_short>Zoom to Specific Zoom 3</_short>
112 <_long>Zoom to the specific zoom level 3</_long>125 <_long>Zoom to the specific zoom level 3</_long>
113 <default></default>126 <default></default>
114 </option>127 </option>
115 <option type="float" name="zoom_spec3">128 <option type="float" name="zoom_specific_4">
116 <_short>Specific zoom factor 3</_short>129 <_short>Specific Zoom 4</_short>
117 <_long>Zoom level to go to when triggering hotkey 3</_long>130 <_long>Zoom level to go to when triggering hotkey 4</_long>
118 <default>0.2</default>131 <default>1.0</default>
119 <min>0.1</min>132 <min>0.1</min>
120 <max>1.0</max>133 <max>1.0</max>
121 <precision>0.01</precision>134 <precision>0.01</precision>
122 </option>135 </option>
123 <option type="bool" name="spec_target_focus">136 <option type="key" name="zoom_specific_4_key">
124 <_short>Target Focused Window on Specific level</_short>137 <_short>Zoom to Specific Zoom 4</_short>
125 <_long>Enable this to target the focused window when jumping to a specific zoom level. Disable to target mouse.</_long>138 <_long>Zoom to the specific zoom level 4</_long>
126 <default>true</default>139 <default></default>
140 </option>
141 <option type="float" name="zoom_specific_5">
142 <_short>Specific Zoom 5</_short>
143 <_long>Zoom level to go to when triggering hotkey 5</_long>
144 <default>1.0</default>
145 <min>0.1</min>
146 <max>1.0</max>
147 <precision>0.01</precision>
148 </option>
149 <option type="key" name="zoom_specific_5_key">
150 <_short>Zoom to Specific Zoom 5</_short>
151 <_long>Zoom to the specific zoom level 5</_long>
152 <default></default>
153 </option>
154 <option type="float" name="zoom_specific_6">
155 <_short>Specific Zoom 6</_short>
156 <_long>Zoom level to go to when triggering hotkey 6</_long>
157 <default>1.0</default>
158 <min>0.1</min>
159 <max>1.0</max>
160 <precision>0.01</precision>
161 </option>
162 <option type="key" name="zoom_specific_6_key">
163 <_short>Zoom to Specific Zoom 6</_short>
164 <_long>Zoom to the specific zoom level 6</_long>
165 <default></default>
166 </option>
167 <option type="float" name="zoom_specific_7">
168 <_short>Specific Zoom 7</_short>
169 <_long>Zoom level to go to when triggering hotkey 7</_long>
170 <default>1.0</default>
171 <min>0.1</min>
172 <max>1.0</max>
173 <precision>0.01</precision>
174 </option>
175 <option type="key" name="zoom_specific_7_key">
176 <_short>Zoom to Specific Zoom 7</_short>
177 <_long>Zoom to the specific zoom level 7</_long>
178 <default></default>
179 </option>
180 <option type="float" name="zoom_specific_8">
181 <_short>Specific Zoom 8</_short>
182 <_long>Zoom level to go to when triggering hotkey 8</_long>
183 <default>1.0</default>
184 <min>0.1</min>
185 <max>1.0</max>
186 <precision>0.01</precision>
187 </option>
188 <option type="key" name="zoom_specific_8_key">
189 <_short>Zoom to Specific Zoom 8</_short>
190 <_long>Zoom to the specific zoom level 8</_long>
191 <default></default>
192 </option>
193 <option type="float" name="zoom_specific_9">
194 <_short>Specific Zoom 9</_short>
195 <_long>Zoom level to go to when triggering hotkey 9</_long>
196 <default>1.0</default>
197 <min>0.1</min>
198 <max>1.0</max>
199 <precision>0.01</precision>
200 </option>
201 <option type="key" name="zoom_specific_9_key">
202 <_short>Zoom to Specific Zoom 9</_short>
203 <_long>Zoom to the specific zoom level 9</_long>
204 <default></default>
205 </option>
206 <option type="float" name="zoom_specific_10">
207 <_short>Specific Zoom 10</_short>
208 <_long>Zoom level to go to when triggering hotkey 10</_long>
209 <default>1.0</default>
210 <min>0.1</min>
211 <max>1.0</max>
212 <precision>0.01</precision>
213 </option>
214 <option type="key" name="zoom_specific_10_key">
215 <_short>Zoom to Specific Zoom 10</_short>
216 <_long>Zoom to the specific zoom level 10</_long>
217 <default></default>
218 </option>
219 <option type="float" name="zoom_specific_11">
220 <_short>Specific Zoom 11</_short>
221 <_long>Zoom level to go to when triggering hotkey 11</_long>
222 <default>1.0</default>
223 <min>0.1</min>
224 <max>1.0</max>
225 <precision>0.01</precision>
226 </option>
227 <option type="key" name="zoom_specific_11_key">
228 <_short>Zoom to Specific Zoom 11</_short>
229 <_long>Zoom to the specific zoom level 11</_long>
230 <default></default>
231 </option>
232 <option type="float" name="zoom_specific_12">
233 <_short>Specific Zoom 12</_short>
234 <_long>Zoom level to go to when triggering hotkey 12</_long>
235 <default>1.0</default>
236 <min>0.1</min>
237 <max>1.0</max>
238 <precision>0.01</precision>
239 </option>
240 <option type="key" name="zoom_specific_12_key">
241 <_short>Zoom to Specific Zoom 12</_short>
242 <_long>Zoom to the specific zoom level 12</_long>
243 <default></default>
244 </option>
245 <option type="float" name="zoom_specific_13">
246 <_short>Specific Zoom 13</_short>
247 <_long>Zoom level to go to when triggering hotkey 13</_long>
248 <default>1.0</default>
249 <min>0.1</min>
250 <max>1.0</max>
251 <precision>0.01</precision>
252 </option>
253 <option type="key" name="zoom_specific_13_key">
254 <_short>Zoom to Specific Zoom 13</_short>
255 <_long>Zoom to the specific zoom level 13</_long>
256 <default></default>
257 </option>
258 <option type="float" name="zoom_specific_14">
259 <_short>Specific Zoom 14</_short>
260 <_long>Zoom level to go to when triggering hotkey 14</_long>
261 <default>1.0</default>
262 <min>0.1</min>
263 <max>1.0</max>
264 <precision>0.01</precision>
265 </option>
266 <option type="key" name="zoom_specific_14_key">
267 <_short>Zoom to Specific Zoom 14</_short>
268 <_long>Zoom to the specific zoom level 14</_long>
269 <default></default>
270 </option>
271 <option type="float" name="zoom_specific_15">
272 <_short>Specific Zoom 15</_short>
273 <_long>Zoom level to go to when triggering hotkey 15</_long>
274 <default>1.0</default>
275 <min>0.1</min>
276 <max>1.0</max>
277 <precision>0.01</precision>
278 </option>
279 <option type="key" name="zoom_specific_15_key">
280 <_short>Zoom to Specific Zoom 15</_short>
281 <_long>Zoom to the specific zoom level 15</_long>
282 <default></default>
283 </option>
284 <option type="float" name="zoom_specific_16">
285 <_short>Specific Zoom 16</_short>
286 <_long>Zoom level to go to when triggering hotkey 16</_long>
287 <default>1.0</default>
288 <min>0.1</min>
289 <max>1.0</max>
290 <precision>0.01</precision>
291 </option>
292 <option type="key" name="zoom_specific_16_key">
293 <_short>Zoom to Specific Zoom 16</_short>
294 <_long>Zoom to the specific zoom level 16</_long>
295 <default></default>
127 </option>296 </option>
128 </group>297 </group>
129 <group>298 <group>
130299
=== modified file 'plugins/ezoom/src/ezoom.cpp' (properties changed: -x to +x)
--- plugins/ezoom/src/ezoom.cpp 2014-10-22 16:01:27 +0000
+++ plugins/ezoom/src/ezoom.cpp 2016-07-14 15:55:30 +0000
@@ -1591,16 +1591,68 @@
15911591
1592 switch (target)1592 switch (target)
1593 {1593 {
1594 case ZoomTargetFirst:1594 case ZoomTarget1:
1595 zoom_level = optionGetZoomSpec1 ();1595 zoom_level = optionGetZoomSpecific1 ();
1596 break;1596 break;
15971597
1598 case ZoomTargetSecond:1598 case ZoomTarget2:
1599 zoom_level = optionGetZoomSpec2 ();1599 zoom_level = optionGetZoomSpecific2 ();
1600 break;1600 break;
16011601
1602 case ZoomTargetThird:1602 case ZoomTarget3:
1603 zoom_level = optionGetZoomSpec3 ();1603 zoom_level = optionGetZoomSpecific3 ();
1604 break;
1605
1606 case ZoomTarget4:
1607 zoom_level = optionGetZoomSpecific4 ();
1608 break;
1609
1610 case ZoomTarget5:
1611 zoom_level = optionGetZoomSpecific5 ();
1612 break;
1613
1614 case ZoomTarget6:
1615 zoom_level = optionGetZoomSpecific6 ();
1616 break;
1617
1618 case ZoomTarget7:
1619 zoom_level = optionGetZoomSpecific7 ();
1620 break;
1621
1622 case ZoomTarget8:
1623 zoom_level = optionGetZoomSpecific8 ();
1624 break;
1625
1626 case ZoomTarget9:
1627 zoom_level = optionGetZoomSpecific9 ();
1628 break;
1629
1630 case ZoomTarget10:
1631 zoom_level = optionGetZoomSpecific10 ();
1632 break;
1633
1634 case ZoomTarget11:
1635 zoom_level = optionGetZoomSpecific11 ();
1636 break;
1637
1638 case ZoomTarget12:
1639 zoom_level = optionGetZoomSpecific12 ();
1640 break;
1641
1642 case ZoomTarget13:
1643 zoom_level = optionGetZoomSpecific13 ();
1644 break;
1645
1646 case ZoomTarget14:
1647 zoom_level = optionGetZoomSpecific14 ();
1648 break;
1649
1650 case ZoomTarget15:
1651 zoom_level = optionGetZoomSpecific15 ();
1652 break;
1653
1654 case ZoomTarget16:
1655 zoom_level = optionGetZoomSpecific16 ();
1604 break;1656 break;
16051657
1606 default:1658 default:
@@ -1966,16 +2018,54 @@
1966 optionSetZoomOutKeyInitiate (boost::bind (&EZoomScreen::zoomOut, this, _1,2018 optionSetZoomOutKeyInitiate (boost::bind (&EZoomScreen::zoomOut, this, _1,
1967 _2, _3));2019 _2, _3));
19682020
1969 optionSetZoomSpecific1KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,2021 optionSetZoomSpecific1KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,
1970 this, _1, _2, _3,2022 this, _1, _2, _3,
1971 ZoomTargetFirst));2023 ZoomTarget1));
1972 optionSetZoomSpecific2KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,2024 optionSetZoomSpecific2KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,
1973 this, _1, _2, _3,2025 this, _1, _2, _3,
1974 ZoomTargetSecond));2026 ZoomTarget2));
1975 optionSetZoomSpecific3KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,2027 optionSetZoomSpecific3KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,
1976 this, _1, _2, _3,2028 this, _1, _2, _3,
1977 ZoomTargetThird));2029 ZoomTarget3));
19782030 optionSetZoomSpecific4KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,
2031 this, _1, _2, _3,
2032 ZoomTarget4));
2033 optionSetZoomSpecific5KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,
2034 this, _1, _2, _3,
2035 ZoomTarget5));
2036 optionSetZoomSpecific6KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,
2037 this, _1, _2, _3,
2038 ZoomTarget6));
2039 optionSetZoomSpecific7KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,
2040 this, _1, _2, _3,
2041 ZoomTarget7));
2042 optionSetZoomSpecific8KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,
2043 this, _1, _2, _3,
2044 ZoomTarget8));
2045 optionSetZoomSpecific9KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,
2046 this, _1, _2, _3,
2047 ZoomTarget9));
2048 optionSetZoomSpecific10KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,
2049 this, _1, _2, _3,
2050 ZoomTarget10));
2051 optionSetZoomSpecific11KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,
2052 this, _1, _2, _3,
2053 ZoomTarget11));
2054 optionSetZoomSpecific12KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,
2055 this, _1, _2, _3,
2056 ZoomTarget12));
2057 optionSetZoomSpecific13KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,
2058 this, _1, _2, _3,
2059 ZoomTarget13));
2060 optionSetZoomSpecific14KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,
2061 this, _1, _2, _3,
2062 ZoomTarget14));
2063 optionSetZoomSpecific15KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,
2064 this, _1, _2, _3,
2065 ZoomTarget15));
2066 optionSetZoomSpecific16KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific,
2067 this, _1, _2, _3,
2068 ZoomTarget16));
1979 optionSetPanLeftKeyInitiate (boost::bind (&EZoomScreen::zoomPan, this, _1,2069 optionSetPanLeftKeyInitiate (boost::bind (&EZoomScreen::zoomPan, this, _1,
1980 _2, _3, -1, 0));2070 _2, _3, -1, 0));
1981 optionSetPanRightKeyInitiate (boost::bind (&EZoomScreen::zoomPan, this, _1,2071 optionSetPanRightKeyInitiate (boost::bind (&EZoomScreen::zoomPan, this, _1,
19822072
=== modified file 'plugins/ezoom/src/ezoom.h' (properties changed: -x to +x)
--- plugins/ezoom/src/ezoom.h 2013-05-15 15:44:02 +0000
+++ plugins/ezoom/src/ezoom.h 2016-07-14 15:55:30 +0000
@@ -51,9 +51,22 @@
5151
52enum SpecificZoomTarget52enum SpecificZoomTarget
53{53{
54 ZoomTargetFirst = 0,54 ZoomTarget1 = 0,
55 ZoomTargetSecond,55 ZoomTarget2,
56 ZoomTargetThird56 ZoomTarget3,
57 ZoomTarget4,
58 ZoomTarget5,
59 ZoomTarget6,
60 ZoomTarget7,
61 ZoomTarget8,
62 ZoomTarget9,
63 ZoomTarget10,
64 ZoomTarget11,
65 ZoomTarget12,
66 ZoomTarget13,
67 ZoomTarget14,
68 ZoomTarget15,
69 ZoomTarget16
57};70};
5871
59class EZoomScreen :72class EZoomScreen :
6073
=== modified file 'plugins/grid/src/grid.cpp' (properties changed: -x to +x)
--- plugins/grid/src/grid.cpp 2015-04-06 13:14:51 +0000
+++ plugins/grid/src/grid.cpp 2016-07-14 15:55:30 +0000
@@ -250,110 +250,129 @@
250 !optionGetCycleSizes ())) &&250 !optionGetCycleSizes ())) &&
251 gw->lastTarget & where)251 gw->lastTarget & where)
252 {252 {
253 /* TODO:
254 * instead of just using what was here
255 * decide on how to deal with rounding/truncating/off by one,
256 * might be helpful in cases like using a windowed virtual machine
257 * with a relatively prime number for width,
258 * examples 631, 797, 1021, 1279, 1439, 1913, 2039, 2557, 3833, ... NextPrime[{N}, -1]
259 */
260 int slotWidth12 = workarea.width () / 8;
261 int slotWidth17 = (workarea.width () / 6);
253 int slotWidth25 = workarea.width () / 4;262 int slotWidth25 = workarea.width () / 4;
254 int slotWidth33 = (workarea.width () / 3) + cw->border ().left;263 int slotWidth33 = (workarea.width () / 3) + cw->border ().left;
255 int slotWidth17 = slotWidth33 - slotWidth25;264 int slotWidth50 = (workarea.width () / 2);
256 int slotWidth66 = workarea.width () - slotWidth33;265 int slotWidth66 = workarea.width () - slotWidth33;
257 int slotWidth75 = workarea.width () - slotWidth25;266 int slotWidth75 = workarea.width () - slotWidth25;
267 int slotWidth100 = workarea.width ();
268 int slotWidth37 = slotWidth75 / 2;
258269
259 if (props.numCellsX == 2) /* keys (1, 4, 7, 3, 6, 9) */270 if (props.numCellsX == 2) /* keys (1, 4, 7, 3, 6, 9) */
260 {271 {
261 if ((currentRect.width () == desiredRect.width () &&272 if ((currentRect.width () == desiredRect.width () &&
262 currentRect.x () == desiredRect.x ()) ||273 currentRect.x () == desiredRect.x ()) ||
263 (gw->resizeCount < 1) || (gw->resizeCount > 5))274 (gw->resizeCount < 1) || (gw->resizeCount > 6))
264 gw->resizeCount = 3;275 {
265276 gw->resizeCount = 2;
266 /* tricky, have to allow for window constraints when277 }
267 * computing what the 33% and 66% offsets would be278 /* tricky, have to allow for window constraints when
268 */279 * computing what the 33% and 66% offsets would be
269 switch (gw->resizeCount)280 */
270 {281 switch (gw->resizeCount)
271 case 1:282 {
272 desiredSlot.setWidth (slotWidth66);283 case 1:
273 desiredSlot.setX (workarea.x () +284 desiredSlot.setWidth (slotWidth50);
274 props.gravityRight * slotWidth33);285 desiredSlot.setX (workarea.x () + props.gravityRight * slotWidth50);
275 ++gw->resizeCount;286 ++gw->resizeCount;
276 break;287 break;
277288
278 case 2:289 case 2:
279 ++gw->resizeCount;290 desiredSlot.setWidth (slotWidth33);
280 break;291 desiredSlot.setX (workarea.x () + props.gravityRight * slotWidth66);
281292 ++gw->resizeCount;
282 case 3:293 break;
283 desiredSlot.setWidth (slotWidth33);294
284 desiredSlot.setX (workarea.x () +295 case 3:
285 props.gravityRight * slotWidth66);296 desiredSlot.setWidth (slotWidth25);
286 ++gw->resizeCount;297 desiredSlot.setX (workarea.x () + props.gravityRight * slotWidth75);
287 break;298 ++gw->resizeCount;
288299 break;
289 case 4:300
290 desiredSlot.setWidth (slotWidth25);301 case 4:
291 desiredSlot.setX (workarea.x () +302 desiredSlot.setWidth (slotWidth100);
292 props.gravityRight * slotWidth75);303 desiredSlot.setX (workarea.x ());
293 ++gw->resizeCount;304 ++gw->resizeCount;
294 break;305 break;
295306
296 case 5:307 case 5:
297 desiredSlot.setWidth (slotWidth75);308 desiredSlot.setWidth (slotWidth75);
298 desiredSlot.setX (workarea.x () +309 desiredSlot.setX (workarea.x () + props.gravityRight * slotWidth25);
299 props.gravityRight * slotWidth25);310 ++gw->resizeCount;
300 ++gw->resizeCount;311 break;
301 break;312
302313 case 6:
303 default:314 desiredSlot.setWidth (slotWidth66);
304 break;315 desiredSlot.setX (workarea.x () + props.gravityRight * slotWidth33);
305 }316 ++gw->resizeCount;
317 break;
318
319 default:
320 break;
321 }
306 }322 }
307 else /* keys (2, 5, 8) */323 else /* keys (2, 5, 8) */
308 {324 {
309 if ((currentRect.width () == desiredRect.width () &&325 if ((currentRect.width () == desiredRect.width () &&
310 currentRect.x () == desiredRect.x ()) ||326 currentRect.x () == desiredRect.x ()) ||
311 (gw->resizeCount < 1) || (gw->resizeCount > 5))327 (gw->resizeCount < 1) || (gw->resizeCount > 6))
328 {
329 gw->resizeCount = 2;
330 }
331 switch (gw->resizeCount)
332 {
333 case 1:
334 desiredSlot.setWidth (slotWidth100);
335 desiredSlot.setX (workarea.x ());
336 ++gw->resizeCount;
337 break;
338
339 case 2:
340 desiredSlot.setWidth (slotWidth75);
341 desiredSlot.setX (workarea.x () + slotWidth12);
342 ++gw->resizeCount;
343 break;
344
345 case 3:
346 desiredSlot.setWidth (slotWidth66);
347 desiredSlot.setX (workarea.x () + slotWidth17);
348 ++gw->resizeCount;
349 break;
350
351 case 4:
352 desiredSlot.setWidth ((slotWidth50));
353 desiredSlot.setX (workarea.x () + slotWidth25);
354 ++gw->resizeCount;
355 break;
356
357 case 5:
358 desiredSlot.setWidth (slotWidth33 - (cw->border ().left + cw->border ().right));
359 desiredSlot.setX (workarea.x () + slotWidth33);
360 ++gw->resizeCount;
361 break;
362
363 case 6:
364 desiredSlot.setWidth ((slotWidth25));
365 desiredSlot.setX (workarea.x () + slotWidth37);
366 ++gw->resizeCount;
367 break;
368
369 default:
370 break;
371 }
372 }
373 if (gw->resizeCount > 6){
312 gw->resizeCount = 1;374 gw->resizeCount = 1;
313375 }
314 switch (gw->resizeCount)
315 {
316 case 1:
317 desiredSlot.setWidth (workarea.width () -
318 (slotWidth17 * 2));
319 desiredSlot.setX (workarea.x () + slotWidth17);
320 ++gw->resizeCount;
321 break;
322
323 case 2:
324 desiredSlot.setWidth ((slotWidth25 * 2) +
325 (slotWidth17 * 2));
326 desiredSlot.setX (workarea.x () +
327 (slotWidth25 - slotWidth17));
328 ++gw->resizeCount;
329 break;
330
331 case 3:
332 desiredSlot.setWidth ((slotWidth25 * 2));
333 desiredSlot.setX (workarea.x () + slotWidth25);
334 ++gw->resizeCount;
335 break;
336
337 case 4:
338 desiredSlot.setWidth (slotWidth33 -
339 (cw->border ().left +
340 cw->border ().right));
341 desiredSlot.setX (workarea.x () + slotWidth33);
342 ++gw->resizeCount;
343 break;
344
345 case 5:
346 ++gw->resizeCount;
347 break;
348
349 default:
350 break;
351 }
352 }
353
354 if (gw->resizeCount == 6)
355 gw->resizeCount = 1;
356
357 desiredRect = constrainSize (cw, desiredSlot);376 desiredRect = constrainSize (cw, desiredSlot);
358 }377 }
359378
360379
=== modified file 'plugins/opengl/include/opengl/matrix.h'
--- plugins/opengl/include/opengl/matrix.h 2012-08-02 11:57:41 +0000
+++ plugins/opengl/include/opengl/matrix.h 2016-07-14 15:55:30 +0000
@@ -26,6 +26,8 @@
26#ifndef _GLMATRIX_H26#ifndef _GLMATRIX_H
27#define _GLMATRIX_H27#define _GLMATRIX_H
2828
29#include <core/point.h>
30#include <core/rect.h>
29#include <opengl/vector.h>31#include <opengl/vector.h>
3032
31class CompOutput;33class CompOutput;
@@ -65,4 +67,29 @@
65 float m[16];67 float m[16];
66};68};
6769
70namespace compiz
71{
72 namespace opengl
73 {
74 namespace matrix
75 {
76 /* This function returns co-ordinates into viewport space. In order
77 * to convert into something like damage rectangles please remember
78 * to flip on the y axis. */
79 inline CompPoint projectIntoViewport (const GLMatrix &modelview,
80 const GLMatrix &projection,
81 const CompRect &vp,
82 const GLVector &vector)
83 {
84 GLVector projected (projection * modelview * vector);
85 projected.homogenize ();
86 projected[0] = projected[0] * 0.5 + 0.5;
87 projected[1] = projected[1] * 0.5 + 0.5;
88 return CompPoint (projected[0] * vp.width () + vp.x (),
89 projected[1] * vp.height () + vp.y ());
90 }
91 }
92 }
93}
94
68#endif95#endif
6996
=== modified file 'plugins/opengl/include/opengl/opengl.h'
--- plugins/opengl/include/opengl/opengl.h 2016-05-13 07:57:01 +0000
+++ plugins/opengl/include/opengl/opengl.h 2016-07-14 15:55:30 +0000
@@ -1036,6 +1036,12 @@
1036 std::string vertex_shader,1036 std::string vertex_shader,
1037 std::string fragment_shader);1037 std::string fragment_shader);
10381038
1039 /**
1040 * Use this if overriding glDrawTexture completely - used to clear
1041 * out any internal shader caches.
1042 */
1043 void clearShaders ();
1044
1039 GLTexture *getIcon (int width, int height);1045 GLTexture *getIcon (int width, int height);
10401046
1041 WRAPABLE_HND (0, GLWindowInterface, bool, glPaint,1047 WRAPABLE_HND (0, GLWindowInterface, bool, glPaint,
10421048
=== modified file 'plugins/opengl/include/opengl/vertexbuffer.h'
--- plugins/opengl/include/opengl/vertexbuffer.h 2016-05-12 06:16:56 +0000
+++ plugins/opengl/include/opengl/vertexbuffer.h 2016-07-14 15:55:30 +0000
@@ -113,12 +113,30 @@
113113
114 int render (const GLMatrix &modelview);114 int render (const GLMatrix &modelview);
115115
116 int render (const GLushort *indices,
117 GLuint nIndices);
118
119 int render (const GLMatrix &modelview,
120 const GLushort *indices,
121 GLuint nIndices);
122
116 int render (const GLMatrix &modelview,123 int render (const GLMatrix &modelview,
117 const GLWindowPaintAttrib &attrib);124 const GLWindowPaintAttrib &attrib);
118125
126 int render (const GLMatrix &modelview,
127 const GLWindowPaintAttrib &attrib,
128 const GLushort *indices,
129 GLuint nIndices);
130
119 int render (const GLMatrix &projection,131 int render (const GLMatrix &projection,
120 const GLMatrix &modelview,132 const GLMatrix &modelview,
121 const GLWindowPaintAttrib &attrib);133 const GLWindowPaintAttrib &attrib);
134
135 int render (const GLMatrix &projection,
136 const GLMatrix &modelview,
137 const GLWindowPaintAttrib &attrib,
138 const GLushort *indices,
139 GLuint nIndices);
122140
123 void setVertexOffset (GLuint vOffset);141 void setVertexOffset (GLuint vOffset);
124 void setMaxVertices (GLint vMax);142 void setMaxVertices (GLint vMax);
125143
=== modified file 'plugins/opengl/src/paint.cpp'
--- plugins/opengl/src/paint.cpp 2016-05-17 02:52:47 +0000
+++ plugins/opengl/src/paint.cpp 2016-07-14 15:55:30 +0000
@@ -1298,16 +1298,7 @@
1298 priv->vertexBuffer->render (transform, attrib);1298 priv->vertexBuffer->render (transform, attrib);
1299 #endif1299 #endif
13001300
1301 for (std::list<const GLShaderData*>::const_iterator it = priv->shaders.begin();1301 clearShaders ();
1302 it != priv->shaders.end();
1303 ++it)
1304 {
1305 if ((*it)->isCached != true)
1306 {
1307 delete *it;
1308 }
1309 }
1310 priv->shaders.clear ();
1311 texture->disable ();1302 texture->disable ();
13121303
1313 if (mask & PAINT_WINDOW_BLEND_MASK)1304 if (mask & PAINT_WINDOW_BLEND_MASK)
13141305
=== modified file 'plugins/opengl/src/privatevertexbuffer.h'
--- plugins/opengl/src/privatevertexbuffer.h 2013-10-31 15:59:14 +0000
+++ plugins/opengl/src/privatevertexbuffer.h 2016-07-14 15:55:30 +0000
@@ -109,10 +109,14 @@
109109
110 int render (const GLMatrix *projection,110 int render (const GLMatrix *projection,
111 const GLMatrix *modelview,111 const GLMatrix *modelview,
112 const GLWindowPaintAttrib *attrib);112 const GLWindowPaintAttrib *attrib,
113 const GLushort *indices,
114 GLuint nIndices);
113 int legacyRender (const GLMatrix &projection,115 int legacyRender (const GLMatrix &projection,
114 const GLMatrix &modelview,116 const GLMatrix &modelview,
115 const GLWindowPaintAttrib &attrib);117 const GLWindowPaintAttrib &attrib,
118 const GLushort *indices,
119 GLuint nIndices);
116120
117 public:121 public:
118 static GLVertexBuffer *streamingBuffer;122 static GLVertexBuffer *streamingBuffer;
119123
=== modified file 'plugins/opengl/src/vertexbuffer.cpp'
--- plugins/opengl/src/vertexbuffer.cpp 2016-05-12 05:17:55 +0000
+++ plugins/opengl/src/vertexbuffer.cpp 2016-07-14 15:55:30 +0000
@@ -343,7 +343,16 @@
343int GLVertexBuffer::render ()343int GLVertexBuffer::render ()
344{344{
345 if (enabled ())345 if (enabled ())
346 return priv->render (NULL, NULL, NULL);346 return priv->render (NULL, NULL, NULL, NULL, 0);
347 else
348 return -1;
349}
350
351int GLVertexBuffer::render (const GLushort *indices,
352 GLuint nIndices)
353{
354 if (enabled ())
355 return priv->render (NULL, NULL, NULL, indices, nIndices);
347 else356 else
348 return -1;357 return -1;
349}358}
@@ -355,15 +364,42 @@
355 return render (modelview, attrib);364 return render (modelview, attrib);
356}365}
357366
367int GLVertexBuffer::render (const GLMatrix &modelview,
368 const GLushort *indices,
369 GLuint nIndices)
370{
371 const GLWindowPaintAttrib attrib = { OPAQUE, BRIGHT, COLOR, 0, 0, 0, 0 };
372
373 return render (modelview, attrib, indices, nIndices);
374}
375
358int GLVertexBuffer::render (const GLMatrix &modelview,376int GLVertexBuffer::render (const GLMatrix &modelview,
359 const GLWindowPaintAttrib &attrib)377 const GLWindowPaintAttrib &attrib)
360{378{
361 GLScreen *gScreen = GLScreen::get (screen);379 GLScreen *gScreen = GLScreen::get (screen);
362 GLMatrix *projection = gScreen->projectionMatrix ();380 GLMatrix *projection = gScreen->projectionMatrix ();
363381
364 return render (*projection, modelview, attrib);382 return render (*projection, modelview, attrib, NULL, 0);
365}383}
366384
385
386int GLVertexBuffer::render (const GLMatrix &modelview,
387 const GLWindowPaintAttrib &attrib,
388 const GLushort *indices,
389 GLuint nIndices)
390{
391 GLScreen *gScreen = GLScreen::get (screen);
392 GLMatrix *projection = gScreen->projectionMatrix ();
393
394 return render (*projection, modelview, attrib, indices, nIndices);
395}
396
397int GLVertexBuffer::render (const GLMatrix &projection,
398 const GLMatrix &modelview,
399 const GLWindowPaintAttrib &attrib)
400{
401 return render (projection, modelview, attrib, NULL, 0);
402}
367403
368#if 0404#if 0
369#define PRINT_MATRIX(m) printMatrix ((m), #m)405#define PRINT_MATRIX(m) printMatrix ((m), #m)
@@ -378,9 +414,11 @@
378#define PRINT_MATRIX(m)414#define PRINT_MATRIX(m)
379#endif415#endif
380416
381int GLVertexBuffer::render (const GLMatrix &projection,417int GLVertexBuffer::render (const GLMatrix &projection,
382 const GLMatrix &modelview,418 const GLMatrix &modelview,
383 const GLWindowPaintAttrib &attrib)419 const GLWindowPaintAttrib &attrib,
420 const GLushort *indices,
421 GLuint nIndices)
384{422{
385 if (!priv->vertexData.size ())423 if (!priv->vertexData.size ())
386 return -1;424 return -1;
@@ -389,9 +427,9 @@
389 PRINT_MATRIX(projection);427 PRINT_MATRIX(projection);
390428
391 if (enabled ())429 if (enabled ())
392 return priv->render (&projection, &modelview, &attrib);430 return priv->render (&projection, &modelview, &attrib, indices, nIndices);
393 else431 else
394 return priv->legacyRender (projection, modelview, attrib);432 return priv->legacyRender (projection, modelview, attrib, indices, nIndices);
395}433}
396434
397PrivateVertexBuffer::PrivateVertexBuffer () :435PrivateVertexBuffer::PrivateVertexBuffer () :
@@ -431,9 +469,11 @@
431 }469 }
432}470}
433471
434int PrivateVertexBuffer::render (const GLMatrix *projection,472int PrivateVertexBuffer::render (const GLMatrix *projection,
435 const GLMatrix *modelview,473 const GLMatrix *modelview,
436 const GLWindowPaintAttrib *attrib)474 const GLWindowPaintAttrib *attrib,
475 const GLushort *indices,
476 GLuint nIndices)
437{477{
438 GLfloat attribs[3] = {1, 1, 1};478 GLfloat attribs[3] = {1, 1, 1};
439 GLint positionIndex = -1;479 GLint positionIndex = -1;
@@ -552,11 +592,16 @@
552 tmpProgram->setUniform3f ("paintAttrib", attribs[0], attribs[1], attribs[2]);592 tmpProgram->setUniform3f ("paintAttrib", attribs[0], attribs[1], attribs[2]);
553 }593 }
554594
555595 const GLuint nVerticesToDraw = maxVertices > 0 ?
556 glDrawArrays (primitiveType, vertexOffset, maxVertices > 0 ?596 std::min (static_cast <int> (vertexData.size () / 3),
557 std::min (static_cast <int> (vertexData.size () / 3),597 maxVertices) :
558 maxVertices) :598 vertexData.size () / 3;
559 vertexData.size () / 3);599
600 if (nIndices && indices)
601 glDrawElements (primitiveType, nIndices, GL_UNSIGNED_SHORT, indices);
602 else
603 glDrawArrays (primitiveType, vertexOffset, nVerticesToDraw);
604
560 for (int i = 0; i < 4; ++i)605 for (int i = 0; i < 4; ++i)
561 {606 {
562 if (texCoordIndex[i] != -1)607 if (texCoordIndex[i] != -1)
@@ -578,7 +623,9 @@
578623
579int PrivateVertexBuffer::legacyRender (const GLMatrix &projection,624int PrivateVertexBuffer::legacyRender (const GLMatrix &projection,
580 const GLMatrix &modelview,625 const GLMatrix &modelview,
581 const GLWindowPaintAttrib &attrib)626 const GLWindowPaintAttrib &attrib,
627 const GLushort *indices,
628 GLuint nIndices)
582{629{
583 #ifndef USE_GLES630 #ifndef USE_GLES
584 glMatrixMode (GL_PROJECTION);631 glMatrixMode (GL_PROJECTION);
@@ -626,10 +673,18 @@
626 glTexCoordPointer (2, GL_FLOAT, 0, &textureData[i][0]);673 glTexCoordPointer (2, GL_FLOAT, 0, &textureData[i][0]);
627 }674 }
628675
629 glDrawArrays (primitiveType, vertexOffset, maxVertices > 0 ?676 const GLuint nVerticesToDraw = maxVertices > 0 ?
630 std::min (static_cast <int> (vertexData.size () / 3),677 std::min (static_cast <int> (vertexData.size () / 3),
631 maxVertices) :678 maxVertices) :
632 vertexData.size () / 3);679 vertexData.size () / 3;
680
681 if (indices && nIndices)
682 glDrawElements (primitiveType,
683 nIndices,
684 GL_UNSIGNED_SHORT,
685 indices);
686 else
687 glDrawArrays (primitiveType, vertexOffset, nVerticesToDraw);
633688
634 glDisableClientState (GL_VERTEX_ARRAY);689 glDisableClientState (GL_VERTEX_ARRAY);
635 glDisableClientState (GL_NORMAL_ARRAY);690 glDisableClientState (GL_NORMAL_ARRAY);
636691
=== modified file 'plugins/opengl/src/window.cpp'
--- plugins/opengl/src/window.cpp 2016-05-13 06:41:03 +0000
+++ plugins/opengl/src/window.cpp 2016-07-14 15:55:30 +0000
@@ -375,6 +375,21 @@
375}375}
376376
377void377void
378GLWindow::clearShaders ()
379{
380 for (std::list<const GLShaderData*>::const_iterator it = priv->shaders.begin();
381 it != priv->shaders.end();
382 ++it)
383 {
384 if ((*it)->isCached != true)
385 {
386 delete *it;
387 }
388 }
389 priv->shaders.clear ();
390}
391
392void
378PrivateGLWindow::updateFrameRegion (CompRegion &region)393PrivateGLWindow::updateFrameRegion (CompRegion &region)
379{394{
380 window->updateFrameRegion (region);395 window->updateFrameRegion (region);
381396
=== modified file 'plugins/scale/scale.xml.in'
--- plugins/scale/scale.xml.in 2016-04-27 15:47:55 +0000
+++ plugins/scale/scale.xml.in 2016-07-14 15:55:30 +0000
@@ -139,6 +139,11 @@
139 <_name>On all output devices</_name>139 <_name>On all output devices</_name>
140 </desc>140 </desc>
141 </option>141 </option>
142 <option name="skip_animation" type="bool">
143 <_short>Skip Animation</_short>
144 <_long>Skips the scale plugin animation.</_long>
145 <default>false</default>
146 </option>
142 </group>147 </group>
143 <group>148 <group>
144 <_short>Bindings</_short>149 <_short>Bindings</_short>
145150
=== modified file 'plugins/scale/src/scale.cpp'
--- plugins/scale/src/scale.cpp 2016-05-17 02:53:00 +0000
+++ plugins/scale/src/scale.cpp 2016-07-14 15:55:30 +0000
@@ -932,9 +932,11 @@
932 if (state != ScaleScreen::Idle && state != ScaleScreen::Wait)932 if (state != ScaleScreen::Idle && state != ScaleScreen::Wait)
933 {933 {
934 int steps;934 int steps;
935 float amount, chunk;935 float amount, chunk, speed;
936936
937 amount = msSinceLastPaint * 0.05f * optionGetSpeed ();937 speed = optionGetSkipAnimation() ? USHRT_MAX : optionGetSpeed();
938
939 amount = msSinceLastPaint * 0.05f * speed;
938 steps = amount / (0.5f * optionGetTimestep ());940 steps = amount / (0.5f * optionGetTimestep ());
939941
940 if (!steps)942 if (!steps)

Subscribers

People subscribed via source and target branches