#define IMG_WIDTH 256
#define IMG_HEIGHT 256
+// TODO: remove this when map/unmap are fully supported (GL engine)
+#undef USE_EO_IMAGE
+
typedef struct _Scene_Data
{
Eo *scene;
static float angle = 0.0f;
Scene_Data *scene = (Scene_Data *)data;
unsigned int *pixels;
- int i, j, stride;
+ int i, j, stride, length;
angle += 0.5;
/* Rotate */
if (angle > 360.0) angle -= 360.0f;
- //pixels = efl_gfx_buffer_get(source, EINA_TRUE, NULL, NULL, NULL, &stride, NULL, NULL, NULL, NULL, NULL, NULL);
+#ifdef USE_EO_IMAGE
+ pixels = efl_gfx_buffer_map(source, &length, EFL_GFX_BUFFER_ACCESS_MODE_WRITE, 0, 0, 0, 0,
+ EFL_GFX_COLORSPACE_ARGB8888, &stride);
+ if (!pixels) return EINA_TRUE;
+#else
+ (void) length;
pixels = evas_object_image_data_get(source, EINA_TRUE);
stride = evas_object_image_stride_get(source);
+#endif
for (i = 0; i < IMG_HEIGHT; i++)
{
}
}
- //efl_gfx_buffer_set(source, pixels, 0, 0, stride, 0, 0, 0, 0, 0, 0);
- //evas_object_image_data_update_add(source, 0, 0, IMG_WIDTH, IMG_HEIGHT);
+#ifdef USE_EO_IMAGE
+ efl_gfx_buffer_unmap(source, pixels, length);
+ efl_gfx_buffer_update_add(source, 0, 0, IMG_WIDTH, IMG_HEIGHT);
+#else
evas_object_image_data_set(source, pixels);
evas_object_image_data_update_add(source, 0, 0, IMG_WIDTH, IMG_HEIGHT);
+#endif
return EINA_TRUE;
}
efl_gfx_visible_set(background, EINA_TRUE);
/* Add a background image. */
- source = evas_object_image_filled_add(evas);
- efl_gfx_view_size_set(source, IMG_WIDTH, IMG_HEIGHT);
+#ifdef USE_EO_IMAGE
+ source = eo_add(EFL_CANVAS_IMAGE_CLASS, evas);
+ efl_gfx_buffer_data_set(source, NULL, WIDTH, HEIGHT, 0, EFL_GFX_COLORSPACE_ARGB8888);
efl_gfx_position_set(source, (WIDTH / 2), (HEIGHT / 2));
efl_gfx_size_set(source, (WIDTH / 2), (HEIGHT / 2));
efl_gfx_visible_set(source, EINA_TRUE);
+#else
+ source = evas_object_image_filled_add(evas);
+ evas_object_image_size_set(source, IMG_WIDTH, IMG_HEIGHT);
+ evas_object_move(source, (WIDTH / 2), (HEIGHT / 2));
+ evas_object_resize(source, (WIDTH / 2), (HEIGHT / 2));
+ evas_object_show(source);
+#endif
/* Add an image object for 3D scene rendering. */
image = eo_add(EFL_CANVAS_SCENE3D_CLASS, evas);