Mir

Merge lp:~vanvugt/mir/fix-1215285 into lp:~mir-team/mir/trunk

Proposed by Daniel van Vugt
Status: Merged
Approved by: Alan Griffiths
Approved revision: no longer in the source branch.
Merged at revision: 995
Proposed branch: lp:~vanvugt/mir/fix-1215285
Merge into: lp:~mir-team/mir/trunk
Diff against target: 40 lines (+7/-7)
1 file modified
examples/eglplasma.c (+7/-7)
To merge this branch: bzr merge lp:~vanvugt/mir/fix-1215285
Reviewer Review Type Date Requested Status
Alan Griffiths Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+181468@code.launchpad.net

Commit message

eglplasma: Don't include the alpha component in gradient calculations. We
want the whole surface to be opaque. (LP: #1215285)

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

OK

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'examples/eglplasma.c'
2--- examples/eglplasma.c 2013-07-04 09:32:09 +0000
3+++ examples/eglplasma.c 2013-08-22 06:20:07 +0000
4@@ -63,12 +63,12 @@
5 "precision mediump float; \n"
6 "uniform float theta; \n"
7 "varying vec2 texcoord; \n"
8- "uniform vec4 low_color, high_color; \n"
9+ "uniform vec3 low_color, high_color; \n"
10 " \n"
11- "vec4 gradient(float x) \n"
12+ "vec3 gradient(float x) \n"
13 "{ \n"
14- " vec4 col; \n"
15- " const vec4 white = vec4(1.0, 1.0, 1.0, 1.0); \n"
16+ " vec3 col; \n"
17+ " const vec3 white = vec3(1.0, 1.0, 1.0); \n"
18 " if (x < 0.333) \n"
19 " col = x * low_color / 0.333; \n"
20 " else if (x < 0.666) \n"
21@@ -95,7 +95,7 @@
22 " cos(1.7 * v * cos(2.0 * t)) \n"
23 " ) / 3.0; \n"
24 " float x = (us * vs + 1.0) / 2.0; \n"
25- " gl_FragColor = gradient(x); \n"
26+ " gl_FragColor = vec4(gradient(x), 1.0); \n"
27 "} \n";
28
29 const GLfloat vertices[] =
30@@ -141,8 +141,8 @@
31 low_color = glGetUniformLocation(prog, "low_color");
32 high_color = glGetUniformLocation(prog, "high_color");
33 theta = glGetUniformLocation(prog, "theta");
34- glUniform4f(low_color, DARK_AUBERGINE, 1.0f);
35- glUniform4f(high_color, ORANGE, 1.0f);
36+ glUniform3f(low_color, DARK_AUBERGINE);
37+ glUniform3f(high_color, ORANGE);
38
39 glVertexAttribPointer(vpos, 2, GL_FLOAT, GL_FALSE, 0, vertices);
40 glEnableVertexAttribArray(0);

Subscribers

People subscribed via source and target branches