fix font aligned tex.
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 13 Oct 2009 10:42:03 +0000 (10:42 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 13 Oct 2009 10:42:03 +0000 (10:42 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@43049 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/modules/engines/gl_common/evas_gl_font.c
src/modules/engines/gl_common/evas_gl_texture.c

index ee27564..4d622e3 100644 (file)
@@ -19,7 +19,7 @@ evas_gl_font_texture_new(Evas_GL_Context *gc, RGBA_Font_Glyph *fg)
    j = fg->glyph_out->bitmap.pitch;
    if (j < w) j = w;
 
-   nw = w;
+   nw = ((w + 3) / 4) * 4;
    ndata = alloca(nw *h);
    if (!ndata) return NULL;
    if (fg->glyph_out->bitmap.num_grays == 256)
index 6aa936b..25b8223 100644 (file)
@@ -350,15 +350,13 @@ evas_gl_common_texture_alpha_update(Evas_GL_Texture *tex, DATA8 *pixels, int w,
 #ifdef GL_UNPACK_ROW_LENGTH   
    glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
 #endif   
-   glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+   glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
    glTexSubImage2D(GL_TEXTURE_2D, 0,
                   tex->x, tex->y, w, h,
                   GL_ALPHA, GL_UNSIGNED_BYTE,
                   pixels);
    if (tex->pt->texture != tex->gc->shader.cur_tex)
-     {
-        glBindTexture(GL_TEXTURE_2D, tex->gc->shader.cur_tex);
-     }
+     glBindTexture(GL_TEXTURE_2D, tex->gc->shader.cur_tex);
 }
 
 Evas_GL_Texture *