Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 1 | Upstream-Status: Backport |
| 2 | |
| 3 | http://lists.cairographics.org/archives/cairo/2015-May/026253.html |
| 4 | http://cgit.freedesktop.org/cairo/commit/?id=f52f0e2feb1ad0a4de23c475a8c020d41a1764a8 |
| 5 | |
| 6 | Signed-off-by: Andre McCurdy <armccurdy@gmail.com> |
| 7 | |
| 8 | |
| 9 | From f52f0e2feb1ad0a4de23c475a8c020d41a1764a8 Mon Sep 17 00:00:00 2001 |
| 10 | From: Zan Dobersek <zdobersek@igalia.com> |
| 11 | Date: Fri, 8 May 2015 01:50:25 -0700 |
| 12 | Subject: [PATCH] Manually transpose the matrix in _cairo_gl_shader_bind_matrix() |
| 13 | |
| 14 | To maintain compatibility with OpenGL ES 2.0, the matrix in |
| 15 | _cairo_gl_shader_bind_matrix() should be manually transposed, |
| 16 | and GL_FALSE passed as the transpose argument to the |
| 17 | glUniformMatrix3fv() call as it is the only valid value for |
| 18 | that parameter in OpenGL ES 2.0. |
| 19 | |
| 20 | Reviewed-by: Bryce Harrington <bryce@osg.samsung.com> |
| 21 | Acked-by: "Henry (Yu) Song" <henry.song@samsung.com> |
| 22 | --- |
| 23 | src/cairo-gl-shaders.c | 8 ++++---- |
| 24 | 1 file changed, 4 insertions(+), 4 deletions(-) |
| 25 | |
| 26 | diff --git a/src/cairo-gl-shaders.c b/src/cairo-gl-shaders.c |
| 27 | index 2710606..fe975d2 100644 |
| 28 | --- a/src/cairo-gl-shaders.c |
| 29 | +++ b/src/cairo-gl-shaders.c |
| 30 | @@ -973,12 +973,12 @@ _cairo_gl_shader_bind_matrix (cairo_gl_context_t *ctx, |
| 31 | { |
| 32 | cairo_gl_dispatch_t *dispatch = &ctx->dispatch; |
| 33 | float gl_m[9] = { |
| 34 | - m->xx, m->xy, m->x0, |
| 35 | - m->yx, m->yy, m->y0, |
| 36 | - 0, 0, 1 |
| 37 | + m->xx, m->yx, 0, |
| 38 | + m->xy, m->yy, 0, |
| 39 | + m->x0, m->y0, 1 |
| 40 | }; |
| 41 | assert (location != -1); |
| 42 | - dispatch->UniformMatrix3fv (location, 1, GL_TRUE, gl_m); |
| 43 | + dispatch->UniformMatrix3fv (location, 1, GL_FALSE, gl_m); |
| 44 | } |
| 45 | |
| 46 | void |
| 47 | -- |
| 48 | 1.9.1 |
| 49 | |