Gentoo Archives: gentoo-commits

From: "Alexandre Rostovtsev (tetromino)" <tetromino@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in media-libs/clutter/files: clutter-1.8.2-cogl-fallback-to-non-transparent.patch clutter-1.8.2-em-computation.patch clutter-1.8.2-default-resolution.patch clutter-1.8.2-offscreen-effect-actor-size.patch
Date: Sat, 31 Dec 2011 19:19:29
Message-Id: 20111231191917.B43612004B@flycatcher.gentoo.org
1 tetromino 11/12/31 19:19:17
2
3 Added:
4 clutter-1.8.2-cogl-fallback-to-non-transparent.patch
5 clutter-1.8.2-em-computation.patch
6 clutter-1.8.2-default-resolution.patch
7 clutter-1.8.2-offscreen-effect-actor-size.patch
8 Log:
9 Add useful patches from upstream; fixes totem on old video cards (thanks to Rafał Mużyło for reporting), font rendering, offscreen effect efficiency.
10
11 (Portage version: 2.2.0_alpha84/cvs/Linux x86_64)
12
13 Revision Changes Path
14 1.1 media-libs/clutter/files/clutter-1.8.2-cogl-fallback-to-non-transparent.patch
15
16 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/clutter/files/clutter-1.8.2-cogl-fallback-to-non-transparent.patch?rev=1.1&view=markup
17 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/clutter/files/clutter-1.8.2-cogl-fallback-to-non-transparent.patch?rev=1.1&content-type=text/plain
18
19 Index: clutter-1.8.2-cogl-fallback-to-non-transparent.patch
20 ===================================================================
21 From f05432d57e5e980d0841fd6c13a7f886a46107fe Mon Sep 17 00:00:00 2001
22 From: Robert Bragg <robert@×××××××××××.com>
23 Date: Tue, 1 Nov 2011 13:42:40 +0000
24 Subject: [PATCH] cogl: fallback to non-transparent stages if unsupported
25
26 If our check of the CoglOnscreenTemplate during initialization fails
27 then we disable the request for an alpha component in the swap chain and
28 try the check again.
29
30 Reviewed-by: Neil Roberts <neil@×××××××××××.com>
31 Reviewed-by: Emmanuele Bassi <ebassi@×××××××××××.com>
32 ---
33 clutter/cogl/clutter-backend-cogl.c | 26 +++++++++++++++++++++++---
34 1 files changed, 23 insertions(+), 3 deletions(-)
35
36 diff --git a/clutter/cogl/clutter-backend-cogl.c b/clutter/cogl/clutter-backend-cogl.c
37 index 1ca8850..1343dd1 100644
38 --- a/clutter/cogl/clutter-backend-cogl.c
39 +++ b/clutter/cogl/clutter-backend-cogl.c
40 @@ -296,6 +296,7 @@ clutter_backend_cogl_create_context (ClutterBackend *backend,
41 #endif
42 CoglSwapChain *swap_chain = NULL;
43 CoglOnscreenTemplate *onscreen_template = NULL;
44 + gboolean status;
45
46 if (backend->cogl_context)
47 return TRUE;
48 @@ -325,9 +326,28 @@ clutter_backend_cogl_create_context (ClutterBackend *backend,
49 * Conceptually should we be able to check an onscreen_template
50 * without more details about the CoglDisplay configuration?
51 */
52 - if (!cogl_renderer_check_onscreen_template (backend->cogl_renderer,
53 - onscreen_template,
54 - error))
55 + status = cogl_renderer_check_onscreen_template (backend->cogl_renderer,
56 + onscreen_template,
57 + error);
58 +#ifdef COGL_HAS_XLIB_SUPPORT
59 + if (!status && clutter_x11_get_use_argb_visual ())
60 + {
61 + g_clear_error (error);
62 + /* It's possible that the current renderer doesn't support transparency
63 + * in a swap_chain so lets see if we can fallback to not having any
64 + * transparency...
65 + *
66 + * XXX: It might be nice to have a CoglRenderer feature we could
67 + * explicitly check for ahead of time.
68 + */
69 + cogl_swap_chain_set_has_alpha (swap_chain, FALSE);
70 + status = cogl_renderer_check_onscreen_template (backend->cogl_renderer,
71 + onscreen_template,
72 + error);
73 + }
74 +#endif
75 +
76 + if (!status)
77 goto error;
78
79 backend->cogl_display = cogl_display_new (backend->cogl_renderer,
80 --
81 1.7.8.1
82
83
84
85
86 1.1 media-libs/clutter/files/clutter-1.8.2-em-computation.patch
87
88 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/clutter/files/clutter-1.8.2-em-computation.patch?rev=1.1&view=markup
89 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/clutter/files/clutter-1.8.2-em-computation.patch?rev=1.1&content-type=text/plain
90
91 Index: clutter-1.8.2-em-computation.patch
92 ===================================================================
93 From 85a466268360ad007de90e34b24fa0f56692eaa8 Mon Sep 17 00:00:00 2001
94 From: Emmanuele Bassi <ebassi@×××××××××××.com>
95 Date: Mon, 5 Dec 2011 11:43:48 +0000
96 Subject: [PATCH] backend: Fix em computation for non-absolute fonts
97
98 If a font description is not set to have an absolute size then we were
99 using the wrong transformation for points to device units.
100 (cherry picked from commit 158245fda31e7adad38aa49e4c12efcad0e326e0)
101
102 Signed-off-by: Emmanuele Bassi <ebassi@×××××××××××.com>
103 ---
104 clutter/clutter-backend.c | 8 ++------
105 1 files changed, 2 insertions(+), 6 deletions(-)
106
107 diff --git a/clutter/clutter-backend.c b/clutter/clutter-backend.c
108 index 8267544..db0a637 100644
109 --- a/clutter/clutter-backend.c
110 +++ b/clutter/clutter-backend.c
111 @@ -155,14 +155,10 @@ get_units_per_em (ClutterBackend *backend,
112 if (is_absolute)
113 font_size = (gdouble) pango_size / PANGO_SCALE;
114 else
115 - font_size = (gdouble) pango_size / PANGO_SCALE
116 - * dpi
117 - / 96.0f;
118 + font_size = dpi * ((gdouble) pango_size / PANGO_SCALE) / 72.0f;
119
120 /* 10 points at 96 DPI is 13.3 pixels */
121 - units_per_em = (1.2f * font_size)
122 - * dpi
123 - / 96.0f;
124 + units_per_em = (1.2f * font_size) * dpi / 96.0f;
125 }
126 else
127 units_per_em = -1.0f;
128 --
129 1.7.8.1
130
131
132
133
134 1.1 media-libs/clutter/files/clutter-1.8.2-default-resolution.patch
135
136 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/clutter/files/clutter-1.8.2-default-resolution.patch?rev=1.1&view=markup
137 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/clutter/files/clutter-1.8.2-default-resolution.patch?rev=1.1&content-type=text/plain
138
139 Index: clutter-1.8.2-default-resolution.patch
140 ===================================================================
141 From 0e6e3a5d4b51331df8df5bebd60195fbcf5caec5 Mon Sep 17 00:00:00 2001
142 From: Emmanuele Bassi <ebassi@×××××××××××.com>
143 Date: Mon, 5 Dec 2011 11:42:49 +0000
144 Subject: [PATCH] backend: Return the correct default resolution
145 MIME-Version: 1.0
146 Content-Type: text/plain; charset=UTF-8
147 Content-Transfer-Encoding: 8bit
148
149 If ClutterSettings:font-dpi is set to -1 then the default resolution
150 should be returned by ClutterBackend — i.e. 96.0.
151 (cherry picked from commit 943a65b476431400bd0436e1be243a2917385866)
152
153 Signed-off-by: Emmanuele Bassi <ebassi@×××××××××××.com>
154 ---
155 clutter/clutter-backend.c | 11 ++++++++++-
156 1 files changed, 10 insertions(+), 1 deletions(-)
157
158 diff --git a/clutter/clutter-backend.c b/clutter/clutter-backend.c
159 index 80e4853..8267544 100644
160 --- a/clutter/clutter-backend.c
161 +++ b/clutter/clutter-backend.c
162 @@ -179,14 +179,20 @@ clutter_backend_real_resolution_changed (ClutterBackend *backend)
163 ClutterBackendPrivate *priv = backend->priv;
164 ClutterMainContext *context;
165 ClutterSettings *settings;
166 + gdouble resolution;
167 gint dpi;
168
169 settings = clutter_settings_get_default ();
170 g_object_get (settings, "font-dpi", &dpi, NULL);
171
172 + if (dpi < 0)
173 + resolution = 96.0;
174 + else
175 + resolution = dpi / 1024.0;
176 +
177 context = _clutter_context_get_default ();
178 if (context->font_map != NULL)
179 - cogl_pango_font_map_set_resolution (context->font_map, dpi / 1024.0);
180 + cogl_pango_font_map_set_resolution (context->font_map, resolution);
181
182 priv->units_per_em = get_units_per_em (backend, NULL);
183 priv->units_serial += 1;
184 @@ -788,6 +794,9 @@ clutter_backend_get_resolution (ClutterBackend *backend)
185 settings = clutter_settings_get_default ();
186 g_object_get (settings, "font-dpi", &resolution, NULL);
187
188 + if (resolution < 0)
189 + return 96.0;
190 +
191 return resolution / 1024.0;
192 }
193
194 --
195 1.7.8.1
196
197
198
199
200 1.1 media-libs/clutter/files/clutter-1.8.2-offscreen-effect-actor-size.patch
201
202 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/clutter/files/clutter-1.8.2-offscreen-effect-actor-size.patch?rev=1.1&view=markup
203 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/clutter/files/clutter-1.8.2-offscreen-effect-actor-size.patch?rev=1.1&content-type=text/plain
204
205 Index: clutter-1.8.2-offscreen-effect-actor-size.patch
206 ===================================================================
207 From 2e5980612bb0f27c1616960a5b4bcd3898af14c0 Mon Sep 17 00:00:00 2001
208 From: Neil Roberts <neil@×××××××××××.com>
209 Date: Mon, 28 Nov 2011 13:08:57 +0000
210 Subject: [PATCH] offscreen-effect: Track the size of the actor separately
211
212 Previously the offscreen effect was keeping track of the size of the
213 texture so that it could detect when a different size is requested and
214 create a new texture. However this breaks if a subclass overrides
215 create_texture to make the texture bigger because in that case the
216 size of the texture will always be different from the calculated size
217 of the actor. This patch makes it also track the size of the fbo that
218 was requested before being passed through create_texture() and it
219 instead uses that to detect when a new FBO is needed.
220
221 https://bugzilla.gnome.org/show_bug.cgi?id=665040
222
223 Reviewed-by: Emmanuele Bassi <ebassi@×××××××××××.com>
224
225 (cherry picked from commit a2774fb0dcce0c92036b69fb75092ec8dc80905d)
226 ---
227 clutter/clutter-offscreen-effect.c | 17 +++++++++++++++--
228 1 files changed, 15 insertions(+), 2 deletions(-)
229
230 diff --git a/clutter/clutter-offscreen-effect.c b/clutter/clutter-offscreen-effect.c
231 index cf0d07c..071b415 100644
232 --- a/clutter/clutter-offscreen-effect.c
233 +++ b/clutter/clutter-offscreen-effect.c
234 @@ -85,9 +85,17 @@ struct _ClutterOffscreenEffectPrivate
235 gfloat x_offset;
236 gfloat y_offset;
237
238 + /* The size of the texture */
239 gfloat target_width;
240 gfloat target_height;
241
242 + /* This is the calculated size of the fbo before being passed
243 + through create_texture(). This needs to be tracked separately so
244 + that we can detect when a different size is calculated and
245 + regenerate the fbo */
246 + int fbo_width;
247 + int fbo_height;
248 +
249 gint old_opacity_override;
250
251 /* The matrix that was current the last time the fbo was updated. We
252 @@ -154,8 +162,8 @@ update_fbo (ClutterEffect *effect, int fbo_width, int fbo_height)
253 return FALSE;
254 }
255
256 - if (priv->target_width == fbo_width &&
257 - priv->target_height == fbo_height &&
258 + if (priv->fbo_width == fbo_width &&
259 + priv->fbo_height == fbo_height &&
260 priv->offscreen != COGL_INVALID_HANDLE)
261 return TRUE;
262
263 @@ -187,6 +195,9 @@ update_fbo (ClutterEffect *effect, int fbo_width, int fbo_height)
264 priv->target_width = cogl_texture_get_width (texture);
265 priv->target_height = cogl_texture_get_height (texture);
266
267 + priv->fbo_width = fbo_width;
268 + priv->fbo_height = fbo_height;
269 +
270 if (priv->offscreen != COGL_INVALID_HANDLE)
271 cogl_handle_unref (priv->offscreen);
272
273 @@ -200,6 +211,8 @@ update_fbo (ClutterEffect *effect, int fbo_width, int fbo_height)
274
275 priv->target_width = 0;
276 priv->target_height = 0;
277 + priv->fbo_width = 0;
278 + priv->fbo_height = 0;
279
280 return FALSE;
281 }
282 --
283 1.7.8.1