ui transit: improve zoom effect smoothness by subpixel rendering.

Summary:
evas image might have a better quaility if scaling/transform is not necessary,
so we have a condition to check if image is axis-aligned transformed or not.

On the other hand sub-pixel(floating point coordinates unit) rendering necessary
if image has an effect such a zooming. This would result in a smoother effect
than integer coodinate system.

We need a more precise condition to confirm this,
so we intrduce "anti-alias" option to decide the condition.
now, anti-aliased objects will have a sub-pixel rendering always.

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D12194
This commit is contained in:
Hermet Park 2020-11-24 12:17:17 +09:00
parent 841ceced52
commit 6b1f281f17
2 changed files with 8 additions and 1 deletions

View File

@ -95,6 +95,7 @@ struct _Elm_Transit_Obj_Data
Eina_Bool map_enabled : 1;
Eina_Bool visible : 1;
Eina_Bool freeze_events : 1;
Eina_Bool anti_alias : 1;
} state;
int ref;
};
@ -140,6 +141,7 @@ _transit_obj_data_save(Evas_Object *obj)
obj_data->state.visible = evas_object_visible_get(obj);
obj_data->state.freeze_events = evas_object_freeze_events_get(obj);
obj_data->state.map_enabled = evas_object_map_enable_get(obj);
obj_data->state.anti_alias = evas_object_anti_alias_get(obj);
ELM_SAFE_FREE(obj_data->state.map, evas_map_free);
@ -205,6 +207,7 @@ _transit_obj_data_recover(Elm_Transit *transit, Evas_Object *obj)
obj_data->state.b, obj_data->state.a);
if (obj_data->state.visible) evas_object_show(obj);
else evas_object_hide(obj);
evas_object_anti_alias_set(obj, obj_data->state.anti_alias);
evas_object_map_enable_set(obj, obj_data->state.map_enabled);
evas_object_map_set(obj, obj_data->state.map);
}
@ -1282,6 +1285,9 @@ _transit_effect_zoom_op(Elm_Transit_Effect *effect, Elm_Transit *transit , doubl
EINA_LIST_FOREACH(transit->objs, elist, obj)
{
//Turn on for fixing jiggling by sub-pixel rendering
evas_object_anti_alias_set(obj, EINA_TRUE);
obj_data = evas_object_data_get(obj, _transit_key);
if (obj_data && obj_data->state.map_enabled)
{

View File

@ -1318,7 +1318,8 @@ eng_image_map_draw(void *engine EINA_UNUSED, void *data, void *context, void *su
evas_gl_common_context_target_surface_set(gl_context, surface);
gl_context->dc = context;
if (fabsf(m->pts[0].fx - m->pts[3].fx) < FLT_EPSILON &&
if (!((RGBA_Draw_Context*) context)->anti_alias &&
fabsf(m->pts[0].fx - m->pts[3].fx) < FLT_EPSILON &&
fabsf(m->pts[1].fx - m->pts[2].fx) < FLT_EPSILON &&
fabsf(m->pts[0].fy - m->pts[1].fy) < FLT_EPSILON &&
fabsf(m->pts[3].fy - m->pts[2].fy) < FLT_EPSILON &&