evas/async_render: skip early if text_props with no glyphs
authorUlisses Furquim <ulisses@profusion.mobi>
Fri, 11 Jan 2013 19:56:32 +0000 (19:56 +0000)
committerUlisses Furquim <ulisses@profusion.mobi>
Fri, 11 Jan 2013 19:56:32 +0000 (19:56 +0000)
This is intended to preserve old behavior now that we have
evas_common_font_draw_cb() to handle both sync and async callbacks.
However, we need to check where why we end up with no glyphs in a
text_props even after calling evas_common_font_draw_prepare().

SVN revision: 82664

src/lib/evas/common/evas_font_draw.c
src/modules/evas/engines/software_generic/evas_engine.c

index 9aff3c3..84e8062 100644 (file)
@@ -336,6 +336,8 @@ evas_common_font_draw_cb(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, E
    int c, cx, cy, cw, ch;
    int i;
 
+   if (!glyphs) return;
+
    im_w = dst->cache_entry.w;
    im_h = dst->cache_entry.h;
 
index b0031b3..ce30cd9 100644 (file)
@@ -1968,6 +1968,8 @@ eng_font_draw(void *data EINA_UNUSED, void *context, void *surface, Evas_Font_Se
    if (do_async)
      {
         evas_common_font_draw_prepare(text_props);
+        if (!text_props->glyphs) return EINA_FALSE;
+
         evas_common_font_draw_cb(surface, context, x, y, text_props->glyphs,
                                  _font_draw_thread_cmd);
         return EINA_TRUE;
@@ -1975,7 +1977,7 @@ eng_font_draw(void *data EINA_UNUSED, void *context, void *surface, Evas_Font_Se
 #ifdef BUILD_PIPE_RENDER
    else if ((cpunum > 1))
      evas_common_pipe_text_draw(surface, context, x, y, text_props);
-#endif   
+#endif
    else
      {
         evas_common_font_draw_prepare(text_props);