diff options
author | David Walter Seikel | 2012-04-22 09:19:23 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-04-22 09:19:23 +1000 |
commit | c963d75dfdeec11f82e79e727062fbf89afa2c04 (patch) | |
tree | 895633dbf641110be46f117c29890c49b3ffc0bd /libraries/evas/src/lib/canvas/evas_object_image.c | |
parent | Adding the new extantz viewer and grid manager. (diff) | |
download | SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.zip SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.tar.gz SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.tar.bz2 SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.tar.xz |
Update EFL to latest beta.
Diffstat (limited to 'libraries/evas/src/lib/canvas/evas_object_image.c')
-rw-r--r-- | libraries/evas/src/lib/canvas/evas_object_image.c | 40 |
1 files changed, 35 insertions, 5 deletions
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 | |||
2908 | { | 2908 | { |
2909 | Evas_Coord idw, idh, idx, idy; | 2909 | Evas_Coord idw, idh, idx, idy; |
2910 | int ix, iy, iw, ih; | 2910 | int ix, iy, iw, ih; |
2911 | int img_set = 0; | ||
2911 | 2912 | ||
2912 | if (o->dirty_pixels) | 2913 | if (o->dirty_pixels) |
2913 | { | 2914 | { |
2914 | if (o->func.get_pixels) | 2915 | if (o->func.get_pixels) |
2915 | { | 2916 | { |
2917 | // Set img object for direct rendering optimization | ||
2918 | // Check for image w/h against image geometry w/h | ||
2919 | // Check for image color r,g,b,a = {255,255,255,255} | ||
2920 | // Check and make sure that there are no maps. | ||
2921 | if ( (obj->cur.geometry.w == o->cur.image.w) && | ||
2922 | (obj->cur.geometry.h == o->cur.image.h) && | ||
2923 | (obj->cur.color.r == 255) && | ||
2924 | (obj->cur.color.g == 255) && | ||
2925 | (obj->cur.color.b == 255) && | ||
2926 | (obj->cur.color.a == 255) && | ||
2927 | (!obj->cur.map) ) | ||
2928 | { | ||
2929 | if (obj->layer->evas->engine.func->gl_img_obj_set) | ||
2930 | { | ||
2931 | obj->layer->evas->engine.func->gl_img_obj_set(output, obj, o->cur.has_alpha); | ||
2932 | img_set = 1; | ||
2933 | } | ||
2934 | } | ||
2935 | |||
2916 | o->func.get_pixels(o->func.get_pixels_data, obj); | 2936 | o->func.get_pixels(o->func.get_pixels_data, obj); |
2917 | if (o->engine_data != pixels) | 2937 | if (o->engine_data != pixels) |
2918 | pixels = o->engine_data; | 2938 | pixels = o->engine_data; |
@@ -3152,7 +3172,17 @@ evas_object_image_render(Evas_Object *obj, void *output, void *context, void *su | |||
3152 | idy = ydy; | 3172 | idy = ydy; |
3153 | if (dobreak_w) break; | 3173 | if (dobreak_w) break; |
3154 | } | 3174 | } |
3155 | } | 3175 | } |
3176 | |||
3177 | // Unset img object | ||
3178 | if (img_set) | ||
3179 | { | ||
3180 | if (obj->layer->evas->engine.func->gl_img_obj_set) | ||
3181 | { | ||
3182 | obj->layer->evas->engine.func->gl_img_obj_set(output, NULL, 0); | ||
3183 | img_set = 0; | ||
3184 | } | ||
3185 | } | ||
3156 | } | 3186 | } |
3157 | } | 3187 | } |
3158 | 3188 | ||
@@ -3371,10 +3401,10 @@ evas_object_image_render_pre(Evas_Object *obj) | |||
3371 | y = idy; | 3401 | y = idy; |
3372 | h = ((int)(idy + idh)) - y; | 3402 | h = ((int)(idy + idh)) - y; |
3373 | 3403 | ||
3374 | r.x = ((rr->x - 1) * w) / o->cur.image.w; | 3404 | r.x = (rr->x * w) / o->cur.image.w; |
3375 | r.y = ((rr->y - 1) * h) / o->cur.image.h; | 3405 | r.y = (rr->y * h) / o->cur.image.h; |
3376 | r.w = ((rr->w + 2) * w) / o->cur.image.w; | 3406 | r.w = ((rr->w * w) + (o->cur.image.w * 2) - 1) / o->cur.image.w; |
3377 | r.h = ((rr->h + 2) * h) / o->cur.image.h; | 3407 | r.h = ((rr->h * h) + (o->cur.image.h * 2) - 1) / o->cur.image.h; |
3378 | r.x += obj->cur.geometry.x + x; | 3408 | r.x += obj->cur.geometry.x + x; |
3379 | r.y += obj->cur.geometry.y + y; | 3409 | r.y += obj->cur.geometry.y + y; |
3380 | RECTS_CLIP_TO_RECT(r.x, r.y, r.w, r.h, | 3410 | RECTS_CLIP_TO_RECT(r.x, r.y, r.w, r.h, |