Added new APIs for controlling source object's visibility.
Fixed bugs related to updating proxy textures.
evas_object_show(image);
/* Set the image object as render target for 3D scene. */
- evas_object_image_3d_scene_set(image, data.scene);
+ evas_object_image_t3d_scene_set(image, data.scene);
/* Add animation timer callback. */
ecore_timer_add(0.016, _animate_scene, &data);
evas_object_show(image);
/* Set the image object as render target for 3D scene. */
- evas_object_image_3d_scene_set(image, data.scene);
+ evas_object_image_t3d_scene_set(image, data.scene);
/* Add animation timer callback. */
ecore_timer_add(0.01, _animate_scene, &data);
image = evas_object_image_filled_add(evas);
evas_object_image_size_set(image, WIDTH, HEIGHT);
- evas_object_image_3d_scene_set(image, scene);
+ evas_object_image_t3d_scene_set(image, scene);
evas_object_move(image, 0, 0);
evas_object_resize(image, WIDTH, HEIGHT);
evas_object_show(image);
image = evas_object_image_filled_add(evas);
evas_object_image_size_set(image, WIDTH, HEIGHT);
- evas_object_image_3d_scene_set(image, scene);
+ evas_object_image_t3d_scene_set(image, scene);
evas_object_move(image, 0, 0);
evas_object_resize(image, WIDTH, HEIGHT);
evas_object_show(image);
_scene_setup(&data);
/* Set the image object as render target for 3D scene. */
- evas_object_image_3d_scene_set(image, data.scene);
+ evas_object_image_t3d_scene_set(image, data.scene);
/* Add animation timer callback. */
ecore_timer_add(0.016, _animate_scene, &data);
} Evas_3D_Pick_Type;
/* Image object render target */
-EAPI void evas_object_image_3d_scene_set(Evas_Object *obj, Evas_3D_Scene *scene) EINA_ARG_NONNULL(1);
-EAPI Evas_3D_Scene *evas_object_image_3d_scene_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
+EAPI void evas_object_image_t3d_scene_set(Evas_Object *obj, Evas_3D_Scene *scene) EINA_ARG_NONNULL(1);
+EAPI Evas_3D_Scene *evas_object_image_t3d_scene_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
/* Scene */
EAPI Evas_3D_Scene *evas_3d_scene_add(Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
EAPI void evas_3d_texture_data_set(Evas_3D_Texture *texture, Evas_3D_Color_Format color_format, Evas_3D_Pixel_Format pixel_format, int w, int h, const void *data);
EAPI void evas_3d_texture_file_set(Evas_3D_Texture *texture, const char *file, const char *key) EINA_ARG_NONNULL(1);
EAPI void evas_3d_texture_source_set(Evas_3D_Texture *texture, Evas_Object *source) EINA_ARG_NONNULL(1);
+EAPI void evas_3d_texture_source_visible_set(Evas_3D_Texture *texture, Eina_Bool visible) EINA_ARG_NONNULL(1);
+EAPI Eina_Bool evas_3d_texture_source_visible_get(const Evas_3D_Texture *texture) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
EAPI Evas_3D_Color_Format evas_3d_texture_color_format_get(const Evas_3D_Texture *texture) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
EAPI void evas_3d_texture_size_get(const Evas_3D_Texture *texture, int *w, int *h) EINA_ARG_NONNULL(1);
EAPI void evas_3d_texture_wrap_set(Evas_3D_Texture *texture, Evas_3D_Wrap_Mode s, Evas_3D_Wrap_Mode t) EINA_ARG_NONNULL(1);
{
proxy_src->proxy_textures = eina_list_remove(proxy_src->proxy_textures, texture);
- if (eina_list_count(proxy_src->proxy_textures) == 0)
+ if (eina_list_count(proxy_src->proxy_textures) == 0 &&
+ eina_list_count(proxy_src->proxies) == 0 &&
+ proxy_src->surface != NULL)
{
- if (eina_list_count(proxy_src->proxies) == 0)
- {
- Evas_Public_Data *e = src->layer->evas;
- e->engine.func->image_map_surface_free(e->engine.data.output,
- proxy_src->surface);
- proxy_src->surface = NULL;
- }
+ Evas_Public_Data *e = src->layer->evas;
+ e->engine.func->image_map_surface_free(e->engine.data.output,
+ proxy_src->surface);
+ proxy_src->surface = NULL;
}
if (proxy_src->src_invisible)
}
else
{
+ Evas_Proxy_Render_Data proxy_render_data = {
+ .eo_proxy = NULL,
+ .proxy_obj = NULL,
+ .eo_src = texture->source,
+ .source_clip = EINA_FALSE
+ };
+
evas_render_mapped(e, texture->source, source, ctx, proxy_write->surface,
-source->cur->geometry.x,
-source->cur->geometry.y,
1, 0, 0, e->output.w, e->output.h,
- NULL
+ &proxy_render_data
#ifdef REND_DBG
, 1
#endif
evas_3d_object_change(&texture->base, EVAS_3D_STATE_TEXTURE_DATA, NULL);
}
+EAPI void
+evas_3d_texture_source_visible_set(Evas_3D_Texture *texture, Eina_Bool visible)
+{
+ Evas_Object_Protected_Data *src_obj;
+
+ if (texture->source == NULL)
+ return;
+
+ src_obj = eo_data_scope_get(texture->source, EVAS_OBJ_CLASS);
+
+ if (src_obj->proxy->src_invisible == !visible)
+ return;
+
+ EINA_COW_WRITE_BEGIN(evas_object_proxy_cow, src_obj->proxy, Evas_Object_Proxy_Data, proxy_write)
+ proxy_write->src_invisible = !visible;
+ EINA_COW_WRITE_END(evas_object_proxy_cow, src_obj->proxy, proxy_write);
+
+ src_obj->changed_src_visible = EINA_TRUE;
+ evas_object_smart_member_cache_invalidate(texture->source, EINA_FALSE, EINA_FALSE, EINA_TRUE);
+ evas_object_change(texture->source, src_obj);
+}
+
+EAPI Eina_Bool
+evas_3d_texture_source_visible_get(const Evas_3D_Texture *texture)
+{
+ Evas_Object_Protected_Data *src_obj;
+
+ if (texture->source == NULL)
+ return EINA_FALSE;
+
+ src_obj = eo_data_scope_get(texture->source, EVAS_OBJ_CLASS);
+ return !src_obj->proxy->src_invisible;
+}
+
EAPI Evas_3D_Color_Format
evas_3d_texture_color_format_get(const Evas_3D_Texture *texture)
{
(o->cur->source ?
eo_data_scope_get(o->cur->source, EVAS_OBJ_CLASS):
NULL);
+#ifdef EVAS_3D
+ if (o->cur->scene)
+ {
+ _3d_render(obj->layer->evas->evas, eo_obj, obj, o, o->cur->scene);
+ pixels = obj->data_3d->surface;
+ imagew = obj->data_3d->w;
+ imageh = obj->data_3d->h;
+ uvw = imagew;
+ uvh = imageh;
+ }
+ else if (!o->cur->source)
+#else
if (!o->cur->source)
+#endif
{
pixels = o->engine_data;
imagew = o->cur->image.w;
else if (eo_isa(proxy, EVAS_OBJ_TEXT_CLASS))
eo_do(proxy, evas_obj_text_filter_source_set(NULL, eo_obj));
}
+
+ while (obj->proxy->proxy_textures)
+ evas_3d_texture_source_set(obj->proxy->proxy_textures->data, NULL);
+
if (obj->cur->clipper) evas_object_clip_unset(eo_obj);
evas_object_map_set(eo_obj, NULL);
if (obj->is_smart) evas_object_smart_del(eo_obj);
//Update the proxies recursively.
_evas_proxy_redraw_set(e, proxy, render);
}
+
+#ifdef EVAS_3D
+ if (obj->proxy->proxy_textures)
+ {
+ /* Flag need redraw on proxy texture source */
+ EINA_COW_WRITE_BEGIN(evas_object_proxy_cow, obj->proxy,
+ Evas_Object_Proxy_Data, source)
+ source->redraw = EINA_TRUE;
+ EINA_COW_WRITE_END(evas_object_proxy_cow, obj->proxy, source);
+ }
+#endif
}
static void
eina_array_data_get(active_objects, i);
if (obj->changed) evas_object_clip_recalc(obj);
+#ifdef EVAS_3D
+ if (!obj->proxy->proxies && !obj->proxy->proxy_textures) continue;
+#else
if (!obj->proxy->proxies) continue;
+#endif
if (obj->smart.smart)
changed = evas_object_smart_changed_get(obj->object);
obj->func->render_pre(eo_obj, obj, obj->private_data);
if (obj->proxy->redraw)
_evas_render_prev_cur_clip_cache_add(e, obj);
+#ifdef EVAS_3D
+ if (obj->proxy->proxies || obj->proxy->proxy_textures)
+#else
if (obj->proxy->proxies)
+#endif
{
if (!obj->smart.smart || evas_object_smart_changed_get(eo_obj))
{
static inline Evas_Real
evas_reciprocal_sqrt(Evas_Real x)
{
- long i;
- float y, r;
-
- y = x * 0.5f;
- i = *(long *)(&x);
- i = 0x5f3759df - (i >> 1);
- r = *(float *)(&i);
- r = r * (1.5f - r * r * y);
- return r;
+ union {
+ float f;
+ long i;
+ } u;
+
+ u.f = x;
+ u.i = 0x5f3759df - (u.i >> 1);
+ return u.f * (1.5f - u.f * u.f * x * 0.5f);
}
{
if (obj->parent_cache.src_invisible_valid)
return obj->parent_cache.src_invisible;
+#ifdef EVAS_3D
+ if ((obj->proxy->proxies || obj->proxy->proxy_textures) && obj->proxy->src_invisible) return 1;
+#else
if (obj->proxy->proxies && obj->proxy->src_invisible) return 1;
+#endif
if (!obj->smart.parent) return 0;
Evas_Object_Protected_Data *smart_parent_pd =
eo_data_scope_get(obj->smart.parent, EVAS_OBJ_CLASS);