ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/pango-render.c
(Generate patch)

Comparing deliantra/Deliantra-Client/pango-render.c (file contents):
Revision 1.12 by root, Mon Aug 13 15:31:21 2007 UTC vs.
Revision 1.15 by root, Sun Jan 13 08:31:45 2008 UTC

180 if (!g || g->generation != tc_generation) 180 if (!g || g->generation != tc_generation)
181 { 181 {
182 Glyph bm; 182 Glyph bm;
183 font_render_glyph (&bm, font, glyph); 183 font_render_glyph (&bm, font, glyph);
184 184
185 if (g) 185 if (!g)
186 g->generation = tc_generation;
187 else
188 { 186 {
189 g = g_slice_new (glyph_info); 187 g = g_slice_new (glyph_info);
190 188
191 _pango_opengl_font_set_glyph_cache_destroy (font, (GDestroyNotify)free_glyph_info); 189 _pango_opengl_font_set_glyph_cache_destroy (font, (GDestroyNotify)free_glyph_info);
192 _pango_opengl_font_set_cache_glyph_data (font, glyph, g); 190 _pango_opengl_font_set_cache_glyph_data (font, glyph, g);
193 } 191 }
194 192
195 tc_get (&g->tex, bm.width, bm.height); 193 g->generation = tc_generation;
196 194
197 g->left = bm.left; 195 g->left = bm.left;
198 g->top = bm.top; 196 g->top = bm.top;
199 197
198 tc_get (&g->tex, bm.width, bm.height);
199
200 if (bm.width && bm.height)
201 {
200 glBindTexture (GL_TEXTURE_2D, g->tex.name); 202 glBindTexture (GL_TEXTURE_2D, g->tex.name);
201 glPixelStorei (GL_UNPACK_ROW_LENGTH, bm.stride); 203 glPixelStorei (GL_UNPACK_ROW_LENGTH, bm.stride);
202 glPixelStorei (GL_UNPACK_ALIGNMENT, 1); 204 glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
203 glTexSubImage2D (GL_TEXTURE_2D, 0, g->tex.x, g->tex.y, bm.width, bm.height, GL_ALPHA, GL_UNSIGNED_BYTE, bm.bitmap); 205 glTexSubImage2D (GL_TEXTURE_2D, 0, g->tex.x, g->tex.y, bm.width, bm.height, GL_ALPHA, GL_UNSIGNED_BYTE, bm.bitmap);
204 glPixelStorei (GL_UNPACK_ROW_LENGTH, 0); 206 glPixelStorei (GL_UNPACK_ROW_LENGTH, 0);
205 glPixelStorei (GL_UNPACK_ALIGNMENT, 4); 207 glPixelStorei (GL_UNPACK_ALIGNMENT, 4);
208 }
206 } 209 }
207 210
208 x += g->left; 211 x += g->left;
209 y -= g->top; 212 y -= g->top;
210 213
276 int x, int y, 279 int x, int y,
277 float r, float g, float b, float a, 280 float r, float g, float b, float a,
278 int flags) 281 int flags)
279{ 282{
280 pango_opengl_render_layout_subpixel ( 283 pango_opengl_render_layout_subpixel (
281 layout, rc, x * PANGO_SCALE, y * PANGO_SCALE, r, g, b, a, flags 284 layout, rc, x * PANGO_SCALE, y * PANGO_SCALE, r, g, b, a, flags
282 ); 285 );
283} 286}
284 287
285static void 288static void
286pango_opengl_renderer_init (PangoOpenGLRenderer *renderer) 289pango_opengl_renderer_init (PangoOpenGLRenderer *renderer)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines