From c963d75dfdeec11f82e79e727062fbf89afa2c04 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Sun, 22 Apr 2012 09:19:23 +1000 Subject: Update EFL to latest beta. --- libraries/evas/src/lib/canvas/Makefile.am | 1 - libraries/evas/src/lib/canvas/Makefile.in | 15 +- libraries/evas/src/lib/canvas/evas_callbacks.c | 9 ++ libraries/evas/src/lib/canvas/evas_events.c | 17 +- libraries/evas/src/lib/canvas/evas_map.c | 34 ++-- libraries/evas/src/lib/canvas/evas_object_image.c | 40 ++++- libraries/evas/src/lib/canvas/evas_object_main.c | 19 ++- .../evas/src/lib/canvas/evas_object_textblock.c | 180 ++++++++++++++++----- libraries/evas/src/lib/canvas/evas_render.c | 63 ++++++-- 9 files changed, 277 insertions(+), 101 deletions(-) (limited to 'libraries/evas/src/lib/canvas') diff --git a/libraries/evas/src/lib/canvas/Makefile.am b/libraries/evas/src/lib/canvas/Makefile.am index 79544aa..e302668 100644 --- a/libraries/evas/src/lib/canvas/Makefile.am +++ b/libraries/evas/src/lib/canvas/Makefile.am @@ -8,7 +8,6 @@ AM_CPPFLAGS = \ -DPACKAGE_BIN_DIR=\"$(bindir)\" \ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ -@WIN32_CPPFLAGS@ \ @FREETYPE_CFLAGS@ \ @EET_CFLAGS@ \ @FONTCONFIG_CFLAGS@ \ diff --git a/libraries/evas/src/lib/canvas/Makefile.in b/libraries/evas/src/lib/canvas/Makefile.in index 75da67a..c7e48bc 100644 --- a/libraries/evas/src/lib/canvas/Makefile.in +++ b/libraries/evas/src/lib/canvas/Makefile.in @@ -161,6 +161,8 @@ EVAS_SSE3_CFLAGS = @EVAS_SSE3_CFLAGS@ EVIL_CFLAGS = @EVIL_CFLAGS@ EVIL_LIBS = @EVIL_LIBS@ EXEEXT = @EXEEXT@ +EXOTIC_CFLAGS = @EXOTIC_CFLAGS@ +EXOTIC_LIBS = @EXOTIC_LIBS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ @@ -211,6 +213,8 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PNG_CFLAGS = @PNG_CFLAGS@ PNG_LIBS = @PNG_LIBS@ RANLIB = @RANLIB@ @@ -229,8 +233,6 @@ VERSION = @VERSION@ VMAJ = @VMAJ@ WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ -WIN32_CFLAGS = @WIN32_CFLAGS@ -WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ XCB_CFLAGS = @XCB_CFLAGS@ XCB_GL_CFLAGS = @XCB_GL_CFLAGS@ XCB_GL_LIBS = @XCB_GL_LIBS@ @@ -304,8 +306,6 @@ evas_engine_software_ddraw_cflags = @evas_engine_software_ddraw_cflags@ evas_engine_software_ddraw_libs = @evas_engine_software_ddraw_libs@ evas_engine_software_gdi_cflags = @evas_engine_software_gdi_cflags@ evas_engine_software_gdi_libs = @evas_engine_software_gdi_libs@ -evas_engine_software_sdl_cflags = @evas_engine_software_sdl_cflags@ -evas_engine_software_sdl_libs = @evas_engine_software_sdl_libs@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ @@ -393,10 +393,9 @@ AM_CPPFLAGS = -I. -I$(top_srcdir)/src/lib \ -I$(top_srcdir)/src/lib/include -I$(top_srcdir)/src/lib/cserve \ -DPACKAGE_BIN_DIR=\"$(bindir)\" \ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ - -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" @WIN32_CPPFLAGS@ \ - @FREETYPE_CFLAGS@ @EET_CFLAGS@ @FONTCONFIG_CFLAGS@ \ - @EVAS_CFLAGS@ @EINA_CFLAGS@ @EVIL_CFLAGS@ @PIXMAN_CFLAGS@ \ - $(am__append_1) + -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" @FREETYPE_CFLAGS@ \ + @EET_CFLAGS@ @FONTCONFIG_CFLAGS@ @EVAS_CFLAGS@ @EINA_CFLAGS@ \ + @EVIL_CFLAGS@ @PIXMAN_CFLAGS@ $(am__append_1) noinst_LTLIBRARIES = libevas_canvas.la libevas_canvas_la_SOURCES = \ evas_callbacks.c \ diff --git a/libraries/evas/src/lib/canvas/evas_callbacks.c b/libraries/evas/src/lib/canvas/evas_callbacks.c index 93f34f2..47cfb0c 100644 --- a/libraries/evas/src/lib/canvas/evas_callbacks.c +++ b/libraries/evas/src/lib/canvas/evas_callbacks.c @@ -172,6 +172,15 @@ evas_object_event_callback_call(Evas_Object *obj, Evas_Callback_Type type, void if ((obj->delete_me) || (!obj->layer)) return; if ((obj->last_event == event_id) && (obj->last_event_type == type)) return; + if (obj->last_event > event_id) + { + if ((obj->last_event_type == EVAS_CALLBACK_MOUSE_OUT) && + ((type >= EVAS_CALLBACK_MOUSE_DOWN) && + (type <= EVAS_CALLBACK_MULTI_MOVE))) + { + return; + } + } obj->last_event = event_id; obj->last_event_type = type; if (!(e = obj->layer->evas)) return; diff --git a/libraries/evas/src/lib/canvas/evas_events.c b/libraries/evas/src/lib/canvas/evas_events.c index 9b7077e..1ee8388 100644 --- a/libraries/evas/src/lib/canvas/evas_events.c +++ b/libraries/evas/src/lib/canvas/evas_events.c @@ -486,8 +486,9 @@ evas_event_feed_mouse_up(Evas *e, int b, Evas_Button_Flags flags, unsigned int t } if (!obj->delete_me) { - if (e->events_frozen <= 0) - evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_UP, &ev, event_id); + if ((e->events_frozen <= 0) && + (!evas_event_freezes_through(obj))) + evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_UP, &ev, event_id); } if (e->delete_me) break; if (obj->pointer_mode == EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN) @@ -1668,18 +1669,6 @@ evas_object_freeze_events_set(Evas_Object *obj, Eina_Bool freeze) if (obj->freeze_events == freeze) return; obj->freeze_events = freeze; evas_object_smart_member_cache_invalidate(obj, EINA_FALSE, EINA_TRUE); - if (evas_object_is_in_output_rect(obj, - obj->layer->evas->pointer.x, - obj->layer->evas->pointer.y, 1, 1) && - ((!obj->precise_is_inside) || - (evas_object_is_inside(obj, - obj->layer->evas->pointer.x, - obj->layer->evas->pointer.y)))) - evas_event_feed_mouse_move(obj->layer->evas, - obj->layer->evas->pointer.x, - obj->layer->evas->pointer.y, - obj->layer->evas->last_timestamp, - NULL); } EAPI Eina_Bool diff --git a/libraries/evas/src/lib/canvas/evas_map.c b/libraries/evas/src/lib/canvas/evas_map.c index 2359d5a..5dcb760 100644 --- a/libraries/evas/src/lib/canvas/evas_map.c +++ b/libraries/evas/src/lib/canvas/evas_map.c @@ -35,7 +35,7 @@ _evas_map_calc_geom_change(Evas_Object *obj) static void _evas_map_calc_map_geometry(Evas_Object *obj) { - Evas_Coord x1, x2, y1, y2; + Evas_Coord x1, x2, yy1, yy2; const Evas_Map_Point *p, *p_end; Eina_Bool ch = EINA_FALSE; @@ -82,7 +82,7 @@ _evas_map_calc_map_geometry(Evas_Object *obj) p = obj->cur.map->points; p_end = p + obj->cur.map->count; x1 = x2 = lround(p->x); - y1 = y2 = lround(p->y); + yy1 = yy2 = lround(p->y); p++; for (; p < p_end; p++) { @@ -92,21 +92,21 @@ _evas_map_calc_map_geometry(Evas_Object *obj) y = lround(p->y); if (x < x1) x1 = x; if (x > x2) x2 = x; - if (y < y1) y1 = y; - if (y > y2) y2 = y; + if (y < yy1) yy1 = y; + if (y > yy2) yy2 = y; } // this causes clip-out bugs now mapped objs canbe opaque!!! // // add 1 pixel of fuzz around the map region to ensure updates are correct -// x1 -= 1; y1 -= 1; -// x2 += 1; y2 += 1; +// x1 -= 1; yy1 -= 1; +// x2 += 1; yy2 += 1; if (obj->cur.map->normal_geometry.x != x1) ch = 1; - if (obj->cur.map->normal_geometry.y != y1) ch = 1; + if (obj->cur.map->normal_geometry.y != yy1) ch = 1; if (obj->cur.map->normal_geometry.w != (x2 - x1)) ch = 1; - if (obj->cur.map->normal_geometry.h != (y2 - y1)) ch = 1; + if (obj->cur.map->normal_geometry.h != (yy2 - yy1)) ch = 1; obj->cur.map->normal_geometry.x = x1; - obj->cur.map->normal_geometry.y = y1; + obj->cur.map->normal_geometry.y = yy1; obj->cur.map->normal_geometry.w = (x2 - x1); - obj->cur.map->normal_geometry.h = (y2 - y1); + obj->cur.map->normal_geometry.h = (yy2 - yy1); if (ch) _evas_map_calc_geom_change(obj); } @@ -374,9 +374,11 @@ evas_object_map_enable_set(Evas_Object *obj, Eina_Bool enabled) MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); return; MAGIC_CHECK_END(); + Eina_Bool pchange = EINA_FALSE; enabled = !!enabled; if (obj->cur.usemap == enabled) return; + pchange = obj->changed; obj->cur.usemap = enabled; if (enabled) { @@ -405,6 +407,8 @@ evas_object_map_enable_set(Evas_Object *obj, Eina_Bool enabled) /* This is a bit heavy handed, but it fixes the case of same geometry, but * changed colour or UV settings. */ evas_object_change(obj); + if (!obj->changed_pchange) obj->changed_pchange = pchange; + obj->changed_map = EINA_TRUE; } EAPI Eina_Bool @@ -896,7 +900,7 @@ evas_map_util_3d_lighting(Evas_Map *m, for (i = 0; i < m->count; i++) { double x, y, z; - double nx, ny, nz, x1, y1, z1, x2, y2, z2, ln, br; + double nx, ny, nz, x1, yy1, z1, x2, yy2, z2, ln, br; int h, j, mr, mg, mb; x = m->points[i].x; @@ -907,15 +911,15 @@ evas_map_util_3d_lighting(Evas_Map *m, j = (i + 1) % 4 + (i & ~0x3); // next point x1 = m->points[h].x - x; - y1 = m->points[h].y - y; + yy1 = m->points[h].y - y; z1 = m->points[h].z - z; x2 = m->points[j].x - x; - y2 = m->points[j].y - y; + yy2 = m->points[j].y - y; z2 = m->points[j].z - z; - nx = (y1 * z2) - (z1 * y2); + nx = (yy1 * z2) - (z1 * yy2); ny = (z1 * x2) - (x1 * z2); - nz = (x1 * y2) - (y1 * x2); + nz = (x1 * yy2) - (yy1 * x2); ln = (nx * nx) + (ny * ny) + (nz * nz); ln = sqrt(ln); diff --git a/libraries/evas/src/lib/canvas/evas_object_image.c b/libraries/evas/src/lib/canvas/evas_object_image.c index d9f6378..4ebea08 100644 --- a/libraries/evas/src/lib/canvas/evas_object_image.c +++ b/libraries/evas/src/lib/canvas/evas_object_image.c @@ -2908,11 +2908,31 @@ evas_object_image_render(Evas_Object *obj, void *output, void *context, void *su { Evas_Coord idw, idh, idx, idy; int ix, iy, iw, ih; + int img_set = 0; if (o->dirty_pixels) { if (o->func.get_pixels) { + // Set img object for direct rendering optimization + // Check for image w/h against image geometry w/h + // Check for image color r,g,b,a = {255,255,255,255} + // Check and make sure that there are no maps. + if ( (obj->cur.geometry.w == o->cur.image.w) && + (obj->cur.geometry.h == o->cur.image.h) && + (obj->cur.color.r == 255) && + (obj->cur.color.g == 255) && + (obj->cur.color.b == 255) && + (obj->cur.color.a == 255) && + (!obj->cur.map) ) + { + if (obj->layer->evas->engine.func->gl_img_obj_set) + { + obj->layer->evas->engine.func->gl_img_obj_set(output, obj, o->cur.has_alpha); + img_set = 1; + } + } + o->func.get_pixels(o->func.get_pixels_data, obj); if (o->engine_data != pixels) pixels = o->engine_data; @@ -3152,7 +3172,17 @@ evas_object_image_render(Evas_Object *obj, void *output, void *context, void *su idy = ydy; if (dobreak_w) break; } - } + } + + // Unset img object + if (img_set) + { + if (obj->layer->evas->engine.func->gl_img_obj_set) + { + obj->layer->evas->engine.func->gl_img_obj_set(output, NULL, 0); + img_set = 0; + } + } } } @@ -3371,10 +3401,10 @@ evas_object_image_render_pre(Evas_Object *obj) y = idy; h = ((int)(idy + idh)) - y; - r.x = ((rr->x - 1) * w) / o->cur.image.w; - r.y = ((rr->y - 1) * h) / o->cur.image.h; - r.w = ((rr->w + 2) * w) / o->cur.image.w; - r.h = ((rr->h + 2) * h) / o->cur.image.h; + r.x = (rr->x * w) / o->cur.image.w; + r.y = (rr->y * h) / o->cur.image.h; + r.w = ((rr->w * w) + (o->cur.image.w * 2) - 1) / o->cur.image.w; + r.h = ((rr->h * h) + (o->cur.image.h * 2) - 1) / o->cur.image.h; r.x += obj->cur.geometry.x + x; r.y += obj->cur.geometry.y + y; RECTS_CLIP_TO_RECT(r.x, r.y, r.w, r.h, diff --git a/libraries/evas/src/lib/canvas/evas_object_main.c b/libraries/evas/src/lib/canvas/evas_object_main.c index 86ab498..81fc858 100644 --- a/libraries/evas/src/lib/canvas/evas_object_main.c +++ b/libraries/evas/src/lib/canvas/evas_object_main.c @@ -230,7 +230,7 @@ evas_object_clip_changes_clean(Evas_Object *obj) } void -evas_object_render_pre_effect_updates(Eina_Array *rects, Evas_Object *obj, int is_v, int was_v) +evas_object_render_pre_effect_updates(Eina_Array *rects, Evas_Object *obj, int is_v, int was_v __UNUSED__) { Eina_Rectangle *r; Evas_Object *clipper; @@ -241,7 +241,6 @@ evas_object_render_pre_effect_updates(Eina_Array *rects, Evas_Object *obj, int i if (obj->smart.smart) goto end; /* FIXME: was_v isn't used... why? */ - was_v = 0; if (!obj->clip.clipees) { EINA_ARRAY_ITER_NEXT(rects, i, r, it) @@ -1042,6 +1041,22 @@ evas_object_color_set(Evas_Object *obj, int r, int g, int b, int a) if (g > 255) g = 255; if (g < 0) g = 0; if (b > 255) b = 255; if (b < 0) b = 0; if (a > 255) a = 255; if (a < 0) a = 0; + if (r > a) + { + r = a; + ERR("Evas only handle pre multiplied color !"); + } + if (g > a) + { + g = a; + ERR("Evas only handle pre multiplied color !"); + } + if (b > a) + { + b = a; + ERR("Evas only handle pre multiplied color !"); + } + if (evas_object_intercept_call_color_set(obj, r, g, b, a)) return; if (obj->smart.smart) { diff --git a/libraries/evas/src/lib/canvas/evas_object_textblock.c b/libraries/evas/src/lib/canvas/evas_object_textblock.c index 568911c..ee07e20 100644 --- a/libraries/evas/src/lib/canvas/evas_object_textblock.c +++ b/libraries/evas/src/lib/canvas/evas_object_textblock.c @@ -430,6 +430,7 @@ struct _Evas_Object_Textblock { DATA32 magic; Evas_Textblock_Style *style; + Evas_Textblock_Style *style_user; Evas_Textblock_Cursor *cursor; Eina_List *cursors; Evas_Object_Textblock_Node_Text *text_nodes; @@ -4185,11 +4186,27 @@ _layout(const Evas_Object *obj, int w, int h, int *w_ret, int *h_ret) /* Start of logical layout creation */ /* setup default base style */ - if ((c->o->style) && (c->o->style->default_tag)) { - c->fmt = _layout_format_push(c, NULL, NULL); - _format_fill(c->obj, c->fmt, c->o->style->default_tag); - _format_finalize(c->obj, c->fmt); + Eina_Bool finalize = EINA_FALSE; + if ((c->o->style) && (c->o->style->default_tag)) + { + c->fmt = _layout_format_push(c, NULL, NULL); + _format_fill(c->obj, c->fmt, c->o->style->default_tag); + finalize = EINA_TRUE; + } + + if ((c->o->style_user) && (c->o->style_user->default_tag)) + { + if (!c->fmt) + { + c->fmt = _layout_format_push(c, NULL, NULL); + } + _format_fill(c->obj, c->fmt, c->o->style_user->default_tag); + finalize = EINA_TRUE; + } + + if (finalize) + _format_finalize(c->obj, c->fmt); } if (!c->fmt) { @@ -4485,9 +4502,9 @@ evas_textblock_style_set(Evas_Textblock_Style *ts, const char *text) { // format MUST be KEY='VALUE'[KEY='VALUE']... const char *p; - const char *key_start, *key_stop, *val_start, *val_stop; + const char *key_start, *key_stop, *val_start; - key_start = key_stop = val_start = val_stop = NULL; + key_start = key_stop = val_start = NULL; p = ts->style_text; while (*p) { @@ -4504,19 +4521,54 @@ evas_textblock_style_set(Evas_Textblock_Style *ts, const char *text) else if (!val_start) { if (((*p) == '\'') && (*(p + 1))) - val_start = p + 1; - } - else if (!val_stop) - { - if (((*p) == '\'') && (p > ts->style_text) && (p[-1] != '\\')) - val_stop = p; + { + val_start = ++p; + } } - if ((key_start) && (key_stop) && (val_start) && (val_stop)) + if ((key_start) && (key_stop) && (val_start)) { - char *tags, *replaces; + char *tags, *replaces = NULL; Evas_Object_Style_Tag *tag; - size_t tag_len = key_stop - key_start; - size_t replace_len = val_stop - val_start; + const char *val_stop = NULL; + size_t tag_len; + size_t replace_len; + + { + Eina_Strbuf *buf = eina_strbuf_new(); + val_stop = val_start; + while(*p) + { + if (*p == '\'') + { + /* Break if we found the tag end */ + if (p[-1] != '\\') + { + eina_strbuf_append_length(buf, val_stop, + p - val_stop); + break; + } + else + { + eina_strbuf_append_length(buf, val_stop, + p - val_stop - 1); + eina_strbuf_append_char(buf, '\''); + val_stop = p + 1; + } + } + p++; + } + replaces = eina_strbuf_string_steal(buf); + eina_strbuf_free(buf); + } + /* If we didn't find an end, just aboart. */ + if (!*p) + { + if (replaces) free(replaces); + break; + } + + tag_len = key_stop - key_start; + replace_len = val_stop - val_start; tags = malloc(tag_len + 1); if (tags) @@ -4525,12 +4577,6 @@ evas_textblock_style_set(Evas_Textblock_Style *ts, const char *text) tags[tag_len] = 0; } - replaces = malloc(replace_len + 1); - if (replaces) - { - memcpy(replaces, val_start, replace_len); - replaces[replace_len] = 0; - } if ((tags) && (replaces)) { if (!strcmp(tags, "DEFAULT")) @@ -4561,7 +4607,7 @@ evas_textblock_style_set(Evas_Textblock_Style *ts, const char *text) if (tags) free(tags); if (replaces) free(replaces); } - key_start = key_stop = val_start = val_stop = NULL; + key_start = key_stop = val_start = NULL; } p++; } @@ -4576,13 +4622,15 @@ evas_textblock_style_get(const Evas_Textblock_Style *ts) } /* textblock styles */ -EAPI void -evas_object_textblock_style_set(Evas_Object *obj, Evas_Textblock_Style *ts) + +static void +_textblock_style_generic_set(Evas_Object *obj, Evas_Textblock_Style *ts, + Evas_Textblock_Style **obj_ts) { TB_HEAD(); - if (ts == o->style) return; + if (ts == *obj_ts) return; if ((ts) && (ts->delete_me)) return; - if (o->style) + if (*obj_ts) { Evas_Textblock_Style *old_ts; if (o->markup_text) @@ -4591,7 +4639,7 @@ evas_object_textblock_style_set(Evas_Object *obj, Evas_Textblock_Style *ts) o->markup_text = NULL; } - old_ts = o->style; + old_ts = *obj_ts; old_ts->objects = eina_list_remove(old_ts->objects, obj); if ((old_ts->delete_me) && (!old_ts->objects)) evas_textblock_style_free(old_ts); @@ -4600,12 +4648,19 @@ evas_object_textblock_style_set(Evas_Object *obj, Evas_Textblock_Style *ts) { ts->objects = eina_list_append(ts->objects, obj); } - o->style = ts; + *obj_ts = ts; _evas_textblock_invalidate_all(o); _evas_textblock_changed(o, obj); } +EAPI void +evas_object_textblock_style_set(Evas_Object *obj, Evas_Textblock_Style *ts) +{ + TB_HEAD(); + _textblock_style_generic_set(obj, ts, &(o->style)); +} + EAPI const Evas_Textblock_Style * evas_object_textblock_style_get(const Evas_Object *obj) { @@ -4614,6 +4669,27 @@ evas_object_textblock_style_get(const Evas_Object *obj) } EAPI void +evas_object_textblock_style_user_push(Evas_Object *obj, Evas_Textblock_Style *ts) +{ + TB_HEAD(); + _textblock_style_generic_set(obj, ts, &(o->style_user)); +} + +EAPI const Evas_Textblock_Style * +evas_object_textblock_style_user_peek(const Evas_Object *obj) +{ + TB_HEAD_RETURN(NULL); + return o->style_user; +} + +EAPI void +evas_object_textblock_style_user_pop(Evas_Object *obj) +{ + TB_HEAD(); + _textblock_style_generic_set(obj, NULL, &(o->style_user)); +} + +EAPI void evas_object_textblock_replace_char_set(Evas_Object *obj, const char *ch) { TB_HEAD(); @@ -4902,7 +4978,7 @@ evas_object_textblock_text_markup_set(Evas_Object *obj, const char *text) o->markup_text = NULL; } _nodes_clear(obj); - if (!o->style) + if (!o->style && !o->style_user) { if (text != o->markup_text) { @@ -5244,7 +5320,7 @@ evas_textblock_text_markup_to_utf8(const Evas_Object *obj, const char *text) const char *escape; escape = _escaped_char_get(esc_start, esc_end + 1); - eina_strbuf_append(sbuf, escape); + if (escape) eina_strbuf_append(sbuf, escape); esc_start = esc_end = NULL; } else if (*p == 0) @@ -5650,7 +5726,6 @@ EAPI Eina_Bool evas_textblock_cursor_is_format(const Evas_Textblock_Cursor *cur) { if (!cur || !cur->node) return EINA_FALSE; - if (evas_textblock_cursor_format_is_visible_get(cur)) return EINA_TRUE; return (_evas_textblock_cursor_node_format_at_pos_get(cur)) ? EINA_TRUE : EINA_FALSE; } @@ -5977,9 +6052,9 @@ evas_textblock_cursor_format_prev(Evas_Textblock_Cursor *cur) #else #define BREAK_AFTER(i) \ - ((!str[i + 1]) || \ - (_is_white(str[i]) && !_is_white(str[i + 1])) || \ - (!_is_white(str[i]) && _is_white(str[i + 1]))) + ((!text[i + 1]) || \ + (_is_white(text[i]) && !_is_white(text[i + 1])) || \ + (!_is_white(text[i]) && _is_white(text[i + 1]))) #endif @@ -7241,7 +7316,13 @@ _evas_textblock_node_format_new(Evas_Object_Textblock *o, const char *_format) } } - match = _style_match_tag(o->style, format, format_len, &replace_len); + if (!o->style_user || !(match = _style_match_tag(o->style_user, format, + format_len, &replace_len))) + { + match = _style_match_tag(o->style, format, format_len, + &replace_len); + } + if (match) { if (match[0] != '-') @@ -7633,6 +7714,7 @@ evas_textblock_cursor_range_delete(Evas_Textblock_Cursor *cur1, Evas_Textblock_C } fnode = _evas_textblock_cursor_node_format_at_pos_get(cur1); + n1->dirty = n2->dirty = EINA_TRUE; if (should_merge) { /* We call this function instead of the cursor one because we already @@ -7646,7 +7728,6 @@ evas_textblock_cursor_range_delete(Evas_Textblock_Cursor *cur1, Evas_Textblock_C evas_textblock_cursor_copy(cur1, o->cursor); _evas_textblock_changed(o, cur1->obj); - n1->dirty = n2->dirty = EINA_TRUE; } @@ -8022,6 +8103,7 @@ evas_textblock_cursor_format_is_visible_get(const Evas_Textblock_Cursor *cur) if (!cur) return EINA_FALSE; if (!cur->node) return EINA_FALSE; + if (!evas_textblock_cursor_is_format(cur)) return EINA_FALSE; text = eina_ustrbuf_string_get(cur->node->unicode); return EVAS_TEXTBLOCK_IS_VISIBLE_FORMAT_CHAR(text[cur->pos]); } @@ -9016,12 +9098,22 @@ _size_native_calc_line_finalize(const Evas_Object *obj, Eina_List *items, Eina_List *i; it = eina_list_data_get(items); - /* If there are no text items yet, calc ascent/descent - * according to the current format. */ - if (it && (*ascent + *descent == 0)) - _layout_format_ascent_descent_adjust(obj, ascent, descent, it->format); - *w = 0; + + if (it) + { + /* If there are no text items yet, calc ascent/descent + * according to the current format. */ + if (*ascent + *descent == 0) + _layout_format_ascent_descent_adjust(obj, ascent, descent, + it->format); + + /* Add margins. */ + if (it->format) + *w = it->format->margin.l + it->format->margin.r; + } + + /* Adjust all the item sizes according to the final line size, * and update the x positions of all the items of the line. */ EINA_LIST_FOREACH(items, i, it) @@ -9226,6 +9318,10 @@ evas_object_textblock_free(Evas_Object *obj) evas_object_textblock_clear(obj); evas_object_textblock_style_set(obj, NULL); + while (evas_object_textblock_style_user_peek(obj)) + { + evas_object_textblock_style_user_pop(obj); + } o = (Evas_Object_Textblock *)(obj->object_data); free(o->cursor); while (o->cursors) diff --git a/libraries/evas/src/lib/canvas/evas_render.c b/libraries/evas/src/lib/canvas/evas_render.c index cdedaec..32ce988 100644 --- a/libraries/evas/src/lib/canvas/evas_render.c +++ b/libraries/evas/src/lib/canvas/evas_render.c @@ -612,6 +612,8 @@ pending_change(void *data, void *gdata __UNUSED__) obj->changed_move_only = 0; obj->changed_nomove = 0; obj->changed_move = 0; + obj->changed_map = 0; + obj->changed_pchange = 0; } return obj->changed ? EINA_TRUE : EINA_FALSE; } @@ -984,6 +986,8 @@ evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface, o2->changed_move_only = 0; o2->changed_nomove = 0; o2->changed_move = 0; + o2->changed_map = 0; + o2->changed_pchange = 0; continue; } if (o2->changed) @@ -994,6 +998,8 @@ evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface, o2->changed_move_only = 0; o2->changed_nomove = 0; o2->changed_move = 0; + o2->changed_map = 0; + o2->changed_pchange = 0; break; } } @@ -1002,16 +1008,21 @@ evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface, obj->changed_move_only = 0; obj->changed_nomove = 0; obj->changed_move = 0; + obj->changed_map = 0; + obj->changed_pchange = 0; } else { if (obj->changed) { - changed = 1; + if ((obj->changed_pchange) && (obj->changed_map)) + changed = 1; obj->changed = 0; obj->changed_move_only = 0; obj->changed_nomove = 0; obj->changed_move = 0; + obj->changed_map = 0; + obj->changed_pchange = 0; } } @@ -1144,10 +1155,12 @@ evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface, e->engine.data.context, ecx, ecy, ecw, ech); if (obj->cur.cache.clip.visible) - obj->layer->evas->engine.func->image_map_draw - (e->engine.data.output, e->engine.data.context, surface, - obj->cur.map->surface, obj->cur.map->count, pts, - obj->cur.map->smooth, 0); + { + obj->layer->evas->engine.func->image_map_draw + (e->engine.data.output, e->engine.data.context, surface, + obj->cur.map->surface, obj->cur.map->count, pts, + obj->cur.map->smooth, 0); + } // FIXME: needs to cache these maps and // keep them only rendering updates // obj->layer->evas->engine.func->image_map_surface_free @@ -1500,6 +1513,12 @@ evas_render_updates_internal(Evas *e, off_x = cx - ux; off_y = cy - uy; /* build obscuring objects list (in order from bottom to top) */ + if (alpha) + { + e->engine.func->context_clip_set(e->engine.data.output, + e->engine.data.context, + ux + off_x, uy + off_y, uw, uh); + } for (i = 0; i < e->obscuring_objects.count; ++i) { obj = (Evas_Object *)eina_array_data_get @@ -1515,9 +1534,6 @@ evas_render_updates_internal(Evas *e, } if (alpha) { - e->engine.func->context_clip_set(e->engine.data.output, - e->engine.data.context, - ux + off_x, uy + off_y, uw, uh); e->engine.func->context_color_set(e->engine.data.output, e->engine.data.context, 0, 0, 0, 0); @@ -1548,7 +1564,7 @@ evas_render_updates_internal(Evas *e, (obj->cur.visible) && (!obj->delete_me) && (obj->cur.cache.clip.visible) && - // (!obj->smart.smart) && +// (!obj->smart.smart) && ((obj->cur.color.a > 0 || obj->cur.render_op != EVAS_RENDER_BLEND))) { int x, y, w, h; @@ -1579,6 +1595,9 @@ evas_render_updates_internal(Evas *e, else e->engine.func->context_mask_unset(e->engine.data.output, e->engine.data.context); + e->engine.func->context_clip_set(e->engine.data.output, + e->engine.data.context, + x, y, w, h); #if 1 /* FIXME: this can slow things down... figure out optimum... coverage */ for (j = offset; j < e->temporary_objects.count; ++j) { @@ -1589,9 +1608,6 @@ evas_render_updates_internal(Evas *e, _evas_render_cutout_add(e, obj2, off_x, off_y); } #endif - e->engine.func->context_clip_set(e->engine.data.output, - e->engine.data.context, - x, y, w, h); clean_them |= evas_render_mapped(e, obj, e->engine.data.context, surface, off_x, off_y, 0, cx, cy, cw, ch @@ -1637,6 +1653,8 @@ evas_render_updates_internal(Evas *e, obj->changed_move_only = 0; obj->changed_nomove = 0; obj->changed_move = 0; + obj->changed_map = 0; + obj->changed_pchange = 0; } else if ((obj->cur.map != obj->prev.map) || (obj->cur.usemap != obj->prev.usemap)) @@ -1648,6 +1666,8 @@ evas_render_updates_internal(Evas *e, obj->changed_move_only = 0; obj->changed_nomove = 0; obj->changed_move = 0; + obj->changed_map = 0; + obj->changed_pchange = 0; } /* moved to other pre-process phase 1 if (obj->delete_me == 2) @@ -1684,6 +1704,7 @@ evas_render_updates_internal(Evas *e, e->framespace.changed = 0; e->invalidate = 0; + // always clean... lots of mem waste! /* If their are some object to restack or some object to delete, * it's useless to keep the render object list around. */ if (clean_them) @@ -1693,6 +1714,17 @@ evas_render_updates_internal(Evas *e, eina_array_clean(&e->restack_objects); eina_array_clean(&e->delete_objects); eina_array_clean(&e->obscuring_objects); + eina_array_clean(&e->temporary_objects); + eina_array_clean(&e->clip_changes); +/* we should flush here and have a mempool system for this + eina_array_flush(&e->active_objects); + eina_array_flush(&e->render_objects); + eina_array_flush(&e->restack_objects); + eina_array_flush(&e->delete_objects); + eina_array_flush(&e->obscuring_objects); + eina_array_flush(&e->temporary_objects); + eina_array_flush(&e->clip_changes); + */ e->invalidate = 1; } @@ -1768,11 +1800,14 @@ evas_render_idle_flush(Evas *e) (e->engine.data.output)) e->engine.func->output_idle_flush(e->engine.data.output); - eina_array_flush(&e->delete_objects); eina_array_flush(&e->active_objects); - eina_array_flush(&e->restack_objects); eina_array_flush(&e->render_objects); + eina_array_flush(&e->restack_objects); + eina_array_flush(&e->delete_objects); + eina_array_flush(&e->obscuring_objects); + eina_array_flush(&e->temporary_objects); eina_array_flush(&e->clip_changes); + eina_array_flush(&e->temporary_objects); e->invalidate = 1; } -- cgit v1.1