expedite-cxx: image_blend_* globals as pointers, not instances.

This commit is contained in:
Savio Sena 2014-09-29 14:43:26 +00:00
parent 9ee8b2a45b
commit 3f1b05bd0b
2 changed files with 20 additions and 16 deletions

View File

@ -15,8 +15,7 @@
#define EXPEDITE_CXX_TEST_IMPL
#include "image_blend_border_capi.h"
static efl::eina::list<evas::image> images;
static efl::eina::list<evas::image>* images;
/* standard var */
static int done = 0;
@ -25,10 +24,11 @@ static int done = 0;
static void _setup()
{
evas::canvas canvas(::eo_ref(G_evas));
images = new efl::eina::list<evas::image>;
for (int i = 0; i < OBNUM; i++)
{
evas::image o(efl::eo::parent = canvas);
images.push_back(o);
images->push_back(o);
o.file_set(::build_path("bar.png"), "");
o.border_set(6, 6, 6, 6);
o.visibility_set(true);
@ -39,16 +39,20 @@ static void _setup()
/* cleanup */
static void _cleanup()
{
images.clear();
if (images)
{
images->clear();
delete images;
}
}
/* loop - do things */
static void _loop(double t, int f)
{
int i = 0;
Evas_Coord x, y, w, h, w0, h0;
for (auto it = images.begin(), end = images.end(); it != end; it++, i++)
int i = 0;
if (!images) return;
for (evas::image img : *images)
{
w0 = 80;
h0 = 80;
@ -58,12 +62,11 @@ static void _loop(double t, int f)
x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2);
y = (win_h / 2) - (h / 2);
y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2);
(*it).position_set(x, y);
(*it).evas::object::size_set(w, h);
(*it).fill_set(0, 0, w, h);
img.evas::object::position_set(x, y);
img.evas::object::size_set(w, h);
img.fill_set(0, 0, w, h);
++i;
}
FPS_STD(NAME);
}

View File

@ -51,16 +51,17 @@ static void _cleanup()
/* loop - do things */
static void _loop(double t, int f)
{
auto itr = images.begin();
for (int i = 0; i < MANYNUM; i++, ++itr)
int i = 0;
for (evas::image& img : images)
{
Evas_Coord w, h;
(*itr).size_get(&w, &h);
img.evas::object::size_get(&w, &h);
Evas_Coord x = (win_w / 2) - (w / 2);
x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (win_w / 2);
Evas_Coord y = (win_h / 2) - (h / 2);
y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (win_h / 2);
(*itr).position_set(x, y);
img.evas::object::position_set(x, y);
++i;
}
FPS_STD(NAME);
}