Merge lp:~compiz-team/compiz-grid-plugin/compiz-grid-plugin.less-eye-burning into lp:compiz-grid-plugin

Proposed by Sam Spilsbury
Status: Merged
Approved by: Gord Allott
Approved revision: no longer in the source branch.
Merged at revision: 87
Proposed branch: lp:~compiz-team/compiz-grid-plugin/compiz-grid-plugin.less-eye-burning
Merge into: lp:compiz-grid-plugin
Diff against target: 45 lines (+17/-8)
1 file modified
src/grid.cpp (+17/-8)
To merge this branch: bzr merge lp:~compiz-team/compiz-grid-plugin/compiz-grid-plugin.less-eye-burning
Reviewer Review Type Date Requested Status
Compiz Maintainers Pending
Review via email: mp+72858@code.launchpad.net

Description of the change

premultiply colors

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/grid.cpp'
2--- src/grid.cpp 2011-05-26 11:30:01 +0000
3+++ src/grid.cpp 2011-08-25 10:56:46 +0000
4@@ -379,10 +379,13 @@
5 {
6 GLushort *color;
7 Animation& anim = *iter;
8+ float alpha = (float) optionGetFillColorAlpha () / 65535.0f * anim.opacity;
9
10- color = optionGetFillColor ();
11- glColor4us (anim.opacity * color[0], anim.opacity * color[1],
12- anim.opacity * color[2], anim.opacity * color[3]);
13+ /* fill rectangle */
14+ glColor4f (((float) optionGetFillColorRed () / 65535.0f) * alpha,
15+ ((float) optionGetFillColorGreen () / 65535.0f) * alpha,
16+ ((float) optionGetFillColorBlue () / 65535.0f) * alpha,
17+ alpha);
18
19 /* fill rectangle */
20 glRecti (anim.currentRect.x1 (), anim.currentRect.y2 (),
21@@ -390,14 +393,20 @@
22
23 /* Set outline rect smaller to avoid damage issues */
24 anim.currentRect.setGeometry (anim.currentRect.x () + 1,
25- anim.currentRect.y () + 1,
26- anim.currentRect.width () - 2,
27- anim.currentRect.height () - 2);
28+ anim.currentRect.y () + 1,
29+ anim.currentRect.width () - 2,
30+ anim.currentRect.height () - 2);
31
32 /* draw outline */
33 color = optionGetOutlineColor ();
34- glColor4us (anim.opacity * color[0], anim.opacity * color[1],
35- anim.opacity * color[2], anim.opacity * color[3]);
36+
37+ /* draw outline */
38+ glColor4f (((float) optionGetOutlineColorRed () / 65535.0f) * alpha,
39+ ((float) optionGetOutlineColorGreen () / 65535.0f) * alpha,
40+ ((float) optionGetOutlineColorBlue () / 65535.0f) * alpha,
41+ ((float) optionGetOutlineColorAlpha () / 65535.0f) * anim.opacity);
42+
43+ glColor4us (color[0], color[1], color[2], anim.opacity * color[3]);
44
45 glLineWidth (2.0);
46

Subscribers

People subscribed via source and target branches

to all changes: