forked from enlightenment/efl
added save file flag for old evas test and fixe dimage buffer rendering to work
again SVN revision: 3630
This commit is contained in:
parent
5e5d03af9c
commit
3a11bc158a
|
@ -817,7 +817,6 @@ __evas_image_flush_draw(Display *disp, Imlib_Image dstim, Window win)
|
|||
{
|
||||
Evas_List l;
|
||||
|
||||
imlib_context_set_dither(1);
|
||||
imlib_context_set_blend(1);
|
||||
|
||||
for(l = drawable_list; l; l = l->next)
|
||||
|
@ -826,7 +825,7 @@ __evas_image_flush_draw(Display *disp, Imlib_Image dstim, Window win)
|
|||
|
||||
dr = l->data;
|
||||
|
||||
if ((dr->im == dstim) && (dr->disp == disp))
|
||||
if ((dr->im == dstim))
|
||||
{
|
||||
Evas_List ll;
|
||||
|
||||
|
@ -840,6 +839,7 @@ __evas_image_flush_draw(Display *disp, Imlib_Image dstim, Window win)
|
|||
{
|
||||
int w, h;
|
||||
|
||||
w = up->w; h = up->h;
|
||||
imlib_context_set_image(dr->im);
|
||||
imlib_blend_image_onto_image(up->image, 1,
|
||||
0, 0, w, h,
|
||||
|
@ -909,12 +909,10 @@ __evas_image_init(Display *disp, int screen, int colors)
|
|||
|
||||
if (!initted)
|
||||
{
|
||||
imlib_set_color_usage(216);
|
||||
imlib_set_font_cache_size(1024 * 1024);
|
||||
imlib_set_cache_size(8 * 1024 * 1024);
|
||||
initted = 1;
|
||||
}
|
||||
imlib_set_color_usage(colors);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -822,7 +822,7 @@ __evas_imlib_init(Display *disp, int screen, int colors)
|
|||
|
||||
if (!initted)
|
||||
{
|
||||
imlib_set_color_usage(216);
|
||||
imlib_set_color_usage(colors);
|
||||
imlib_set_font_cache_size(1024 * 1024);
|
||||
imlib_set_cache_size(8 * 1024 * 1024);
|
||||
initted = 1;
|
||||
|
|
|
@ -95,15 +95,19 @@ fn_rect(double v, double val, int no)
|
|||
200, 60, 220, 80
|
||||
};
|
||||
static double coords[8 * 4];
|
||||
static double last_val = 0;
|
||||
int i;
|
||||
|
||||
if (no)
|
||||
{
|
||||
for (i = 0; i < 8; i++)
|
||||
if (last_val != val)
|
||||
{
|
||||
if (o_fn_rects[i])
|
||||
evas_del_object(evas_view, o_fn_rects[i]);
|
||||
o_fn_rects[i] = NULL;
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
if (o_fn_rects[i])
|
||||
evas_del_object(evas_view, o_fn_rects[i]);
|
||||
o_fn_rects[i] = NULL;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -143,7 +147,8 @@ fn_rect(double v, double val, int no)
|
|||
evas_resize(evas_view, o_fn_rects[i],
|
||||
coords[(i * 4) + 2], coords[(i * 4) + 3]);
|
||||
evas_show(evas_view, o_fn_rects[i]);
|
||||
}
|
||||
}
|
||||
last_val = val;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -154,15 +159,19 @@ fn_line(double v, double val, int no)
|
|||
static int init = 0;
|
||||
static int colors[64 * 4];
|
||||
static double coords[64 * 4];
|
||||
static double last_val = 0;
|
||||
int i;
|
||||
|
||||
if (no)
|
||||
{
|
||||
for (i = 0; i < 64; i++)
|
||||
if (last_val != val)
|
||||
{
|
||||
if (o_fn_lines[i])
|
||||
evas_del_object(evas_view, o_fn_lines[i]);
|
||||
o_fn_lines[i] = NULL;
|
||||
for (i = 0; i < 64; i++)
|
||||
{
|
||||
if (o_fn_lines[i])
|
||||
evas_del_object(evas_view, o_fn_lines[i]);
|
||||
o_fn_lines[i] = NULL;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -207,6 +216,7 @@ fn_line(double v, double val, int no)
|
|||
coords[(i * 4) + 3] + (20 * sin((val * 1.3) + 2.1 + i)));
|
||||
evas_show(evas_view, o_fn_lines[i]);
|
||||
}
|
||||
last_val = val;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -230,7 +240,7 @@ fn_image(double v, double val, int no)
|
|||
}
|
||||
|
||||
|
||||
static double codes_loop = 170;
|
||||
static double codes_loop = 180;
|
||||
static CodeBlock codes[] =
|
||||
{
|
||||
{ 128.0, 2.0, 4.0, 6.0, fn_rect},
|
||||
|
@ -238,9 +248,15 @@ static CodeBlock codes[] =
|
|||
{ 136.0, 2.0, 4.0, 6.0, fn_poly},
|
||||
{ 140.0, 2.0, 4.0, 6.0, fn_text},
|
||||
{ 144.0, 2.0, 4.0, 6.0, fn_grad},
|
||||
{ 148.0, 2.0, 4.0, 6.0, fn_image}
|
||||
{ 148.0, 2.0, 4.0, 6.0, fn_image},
|
||||
{ 164.0, 4.0, 12.0, 16.0, fn_rect},
|
||||
{ 164.0, 4.0, 12.0, 16.0, fn_line},
|
||||
{ 164.0, 4.0, 12.0, 16.0, fn_poly},
|
||||
{ 164.0, 4.0, 12.0, 16.0, fn_text},
|
||||
{ 164.0, 4.0, 12.0, 16.0, fn_grad},
|
||||
{ 164.0, 4.0, 12.0, 16.0, fn_image}
|
||||
};
|
||||
static double texts_loop = 170;
|
||||
static double texts_loop = 180;
|
||||
static TextBlock texts[] =
|
||||
{
|
||||
{ 10.0, 2.0, 4.0, 6.0, "What are the 7 Wonders of the world?", NULL, NULL},
|
||||
|
@ -282,7 +298,7 @@ static TextBlock texts[] =
|
|||
{ 160.0, 2.0, 4.0, 6.0, "Faded in and out ...", NULL, NULL},
|
||||
{ 164.0, 2.0, 4.0, 6.0, "And much much more ...", NULL, NULL},
|
||||
};
|
||||
static double images_loop = 170;
|
||||
static double images_loop = 180;
|
||||
static ImageBlock images[] =
|
||||
{
|
||||
{ 14.0, 2.0, 4.0, 6.0, 300, 100, IMGDIR"evas_test_wonder_1.png", NULL},
|
||||
|
|
|
@ -80,6 +80,7 @@ main(int argc, char **argv)
|
|||
Evas_Gradient grad;
|
||||
int down;
|
||||
double t1, t2;
|
||||
char *save_file = NULL;
|
||||
char *imgs[8] =
|
||||
{
|
||||
"img/mush.png",
|
||||
|
@ -135,6 +136,11 @@ main(int argc, char **argv)
|
|||
i++;
|
||||
evas_set_scale_smoothness(e, atoi(argv[i]));
|
||||
}
|
||||
else if ((!strcmp(argv[i], "-v")) && (i < (argc - 1)))
|
||||
{
|
||||
i++;
|
||||
save_file = argv[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Usage:\n");
|
||||
|
@ -145,6 +151,7 @@ main(int argc, char **argv)
|
|||
printf(" -m [x11 | soft | hard | buf] - rendering mode\n");
|
||||
printf(" -c colors - maximum colors allocated\n");
|
||||
printf(" -s [1 | 0] - smooth scaling / rendering\n");
|
||||
printf(" -v file.png - save buffer to file.png\n");
|
||||
printf("\n");
|
||||
printf("Examples:\n");
|
||||
printf(" %s -x 640 -y 480 -m soft - run test in 640x480 in software mode\n", argv[0]);
|
||||
|
@ -388,14 +395,11 @@ main(int argc, char **argv)
|
|||
}
|
||||
evas_set_angle(e, o_grad, (double)a * 360 / 1000);
|
||||
evas_render(e);
|
||||
if ((argc == 5) && (!strcmp(argv[4], "save")) && (buffer))
|
||||
if ((save_file) && (buffer))
|
||||
{
|
||||
imlib_context_set_image(buffer);
|
||||
imlib_image_set_format("png");
|
||||
imlib_save_image("output.png");
|
||||
printf("save done\n");
|
||||
sleep(1);
|
||||
printf("run\n");
|
||||
imlib_save_image(save_file);
|
||||
}
|
||||
a++;
|
||||
m++;
|
||||
|
|
Loading…
Reference in New Issue