From 2881402e2c580330a990032fd46920b9e540f5d4 Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Mon, 4 Oct 2010 15:59:08 +0000 Subject: [PATCH] * expedite: fix stride usage (stride are indexing bytes not pixels). SVN revision: 53030 --- src/bin/image_data_argb.c | 8 ++++---- src/bin/image_data_argb_alpha.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/bin/image_data_argb.c b/src/bin/image_data_argb.c index 191ba24..c063766 100644 --- a/src/bin/image_data_argb.c +++ b/src/bin/image_data_argb.c @@ -61,12 +61,12 @@ static void _loop(double t, int f) evas_object_resize(o_images[i], w, h); evas_object_image_fill_set(o_images[i], 0, 0, w, h); data = evas_object_image_data_get(o_images[i], 1); - st = evas_object_image_stride_get(o_images[i]); + st = evas_object_image_stride_get(o_images[i]) >> 2; p = data; ff = (f ^ (f << 8) ^ (f << 16) ^ (f << 24)); - for (y = 0; y < 480; y++) + for (y = 0; y < h; y++) { - for (x = 0; x < 640; x++) + for (x = 0; x < w; x++) { *p = ((((x * y) + f) << 8) ^ (x - y - f)) | 0xff000000; p++; @@ -74,7 +74,7 @@ static void _loop(double t, int f) p += (st - w); } evas_object_image_data_set(o_images[i], data); - evas_object_image_data_update_add(o_images[i], 0, 0, 640, 480); + evas_object_image_data_update_add(o_images[i], 0, 0, w, h); } FPS_STD(NAME); } diff --git a/src/bin/image_data_argb_alpha.c b/src/bin/image_data_argb_alpha.c index 0cdba76..6c7fc33 100644 --- a/src/bin/image_data_argb_alpha.c +++ b/src/bin/image_data_argb_alpha.c @@ -61,12 +61,12 @@ static void _loop(double t, int f) evas_object_resize(o_images[i], w, h); evas_object_image_fill_set(o_images[i], 0, 0, w, h); data = evas_object_image_data_get(o_images[i], 1); - st = evas_object_image_stride_get(o_images[i]); + st = evas_object_image_stride_get(o_images[i]) >> 2; p = data; ff = (f ^ (f << 8) ^ (f << 16) ^ (f << 24)); - for (y = 0; y < 480; y++) + for (y = 0; y < h; y++) { - for (x = 0; x < 640; x++) + for (x = 0; x < w; x++) { r = (x * y / 7) + f; g = (x / 2); @@ -85,7 +85,7 @@ static void _loop(double t, int f) p += (st - w); } evas_object_image_data_set(o_images[i], data); - evas_object_image_data_update_add(o_images[i], 0, 0, 640, 480); + evas_object_image_data_update_add(o_images[i], 0, 0, w, h); } FPS_STD(NAME); }