forked from enlightenment/efl
parent
8d9987f87b
commit
f6f41ce6c1
|
@ -1,11 +1,10 @@
|
|||
# SETUP
|
||||
AC_INIT
|
||||
AC_CONFIG_SRCDIR([src/Evas.h])
|
||||
AC_INIT(src/Evas.h)
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AM_INIT_AUTOMAKE(evas, 0.6.0)
|
||||
|
||||
IMLIB2_CONFIG_IN_PATH=xyes
|
||||
AC_CHECK_PROG([IMLIB2_CONFIG_IN_PATH],[imlib2-config],[xyes],[xno])
|
||||
AC_PROGRAM_CHECK(IMLIB2_CONFIG_IN_PATH, imlib2-config, xyes, xno)
|
||||
if test $IMLIB2_CONFIG_IN_PATH = xno; then
|
||||
echo "ERROR:"
|
||||
echo "The imlib2-config development script was not found in your execute"
|
||||
|
@ -275,7 +274,7 @@ AC_SUBST(imlib2_libs)
|
|||
AC_SUBST(ttf_includes)
|
||||
AC_SUBST(ttf_libs)
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
AC_OUTPUT([
|
||||
Makefile
|
||||
src/Makefile
|
||||
test/Makefile
|
||||
|
@ -284,8 +283,6 @@ test/fnt/Makefile
|
|||
evas-config
|
||||
doc/Makefile
|
||||
debian/Makefile
|
||||
])
|
||||
AC_CONFIG_COMMANDS([default],[[
|
||||
], [
|
||||
chmod +x evas-config
|
||||
]],[[]])
|
||||
AC_OUTPUT
|
||||
])
|
||||
|
|
|
@ -91,6 +91,10 @@ struct _Evas
|
|||
double x, y, w, h;
|
||||
} viewport;
|
||||
|
||||
struct {
|
||||
double mult_x, mult_y;
|
||||
} val_cache;
|
||||
|
||||
Evas_Render_Method render_method;
|
||||
|
||||
Evas_Render_Data renderer_data;
|
||||
|
@ -264,6 +268,40 @@ struct _Evas_Object_Poly
|
|||
} current, previous;
|
||||
};
|
||||
|
||||
static void
|
||||
_evas_get_current_clipped_geometry(Evas e, Evas_Object o, double *x, double *y, double *w, double *h)
|
||||
{
|
||||
if (!o->current.visible)
|
||||
{
|
||||
*x = 0.0;
|
||||
*y = 0.0;
|
||||
*w = 0.0;
|
||||
*h = 0.0;
|
||||
return;
|
||||
}
|
||||
if (o->clip.object)
|
||||
_evas_get_current_clipped_geometry(e, o->clip.object, x, y, w, h);
|
||||
CLIP_TO(*x, *y, *w, *h,
|
||||
o->current.x, o->current.y, o->current.w, o->current.h);
|
||||
}
|
||||
|
||||
static void
|
||||
_evas_get_previous_clipped_geometry(Evas e, Evas_Object o, double *x, double *y, double *w, double *h)
|
||||
{
|
||||
if (!o->previous.visible)
|
||||
{
|
||||
*x = 0.0;
|
||||
*y = 0.0;
|
||||
*w = 0.0;
|
||||
*h = 0.0;
|
||||
return;
|
||||
}
|
||||
if (o->clip.object)
|
||||
_evas_get_current_clipped_geometry(e, o->clip.object, x, y, w, h);
|
||||
CLIP_TO(*x, *y, *w, *h,
|
||||
o->previous.x, o->previous.y, o->previous.w, o->previous.h);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -152,7 +152,7 @@ __evas_image_image_draw(Evas_Image_Image *im,
|
|||
}
|
||||
}
|
||||
imlib_context_set_image(up->image);
|
||||
imlib_blend_image_onto_image(im, 0,
|
||||
imlib_blend_image_onto_image(im, 1,
|
||||
src_x, src_y, src_w, src_h,
|
||||
dst_x - up->x, dst_y - up->y, dst_w, dst_h);
|
||||
}
|
||||
|
@ -928,6 +928,9 @@ __evas_image_flush_draw(Display *disp, Imlib_Image dstim, Window win)
|
|||
Evas_List l;
|
||||
|
||||
imlib_context_set_blend(1);
|
||||
imlib_context_set_color_modifier(NULL);
|
||||
imlib_context_set_cliprect(0, 0, 0, 0);
|
||||
imlib_context_set_angle(0);
|
||||
|
||||
for(l = drawable_list; l; l = l->next)
|
||||
{
|
||||
|
|
|
@ -123,6 +123,8 @@ evas_new(void)
|
|||
e->previous.drawable_height = 1;
|
||||
e->current.render_method = RENDER_METHOD_ALPHA_SOFTWARE;
|
||||
e->current.colors = 216;
|
||||
e->current.val_cache.mult_x = (double)e->current.drawable_width / e->current.viewport.w;
|
||||
e->current.val_cache.mult_y = (double)e->current.drawable_height / e->current.viewport.h;
|
||||
return e;
|
||||
}
|
||||
|
||||
|
@ -618,25 +620,21 @@ int
|
|||
evas_world_x_to_screen(Evas e, double x)
|
||||
{
|
||||
if (!e) return 0;
|
||||
return (int)((x - e->current.viewport.x) *
|
||||
((double)e->current.drawable_width / e->current.viewport.w));
|
||||
return (int)((x - e->current.viewport.x) * e->current.val_cache.mult_x);
|
||||
}
|
||||
|
||||
int
|
||||
evas_world_y_to_screen(Evas e, double y)
|
||||
{
|
||||
if (!e) return 0;
|
||||
return (int)((y - e->current.viewport.y) *
|
||||
((double)e->current.drawable_height / e->current.viewport.h));
|
||||
return (int)((y - e->current.viewport.y) * e->current.val_cache.mult_y);
|
||||
}
|
||||
|
||||
double
|
||||
evas_screen_x_to_world(Evas e, int x)
|
||||
{
|
||||
if (!e) return 0;
|
||||
return (double)((double)x *
|
||||
(e->current.viewport.w /
|
||||
(double)e->current.drawable_width))
|
||||
return (double)((double)x * e->current.val_cache.mult_x)
|
||||
+ e->current.viewport.x;
|
||||
}
|
||||
|
||||
|
@ -644,8 +642,6 @@ double
|
|||
evas_screen_y_to_world(Evas e, int y)
|
||||
{
|
||||
if (!e) return 0;
|
||||
return (double)((double)y *
|
||||
(e->current.viewport.h /
|
||||
(double)e->current.drawable_height))
|
||||
return (double)((double)y * e->current.val_cache.mult_y)
|
||||
+ e->current.viewport.y;
|
||||
}
|
||||
|
|
|
@ -139,40 +139,6 @@ _evas_cleanup_clip(Evas e, Evas_Object o)
|
|||
o->clip.object->clip.list = evas_list_remove(o->clip.object->clip.list, o);
|
||||
}
|
||||
|
||||
void
|
||||
_evas_get_current_clipped_geometry(Evas e, Evas_Object o, double *x, double *y, double *w, double *h)
|
||||
{
|
||||
if (!o->current.visible)
|
||||
{
|
||||
*x = 0.0;
|
||||
*y = 0.0;
|
||||
*w = 0.0;
|
||||
*h = 0.0;
|
||||
return;
|
||||
}
|
||||
if (o->clip.object)
|
||||
_evas_get_current_clipped_geometry(e, o->clip.object, x, y, w, h);
|
||||
CLIP_TO(*x, *y, *w, *h,
|
||||
o->current.x, o->current.y, o->current.w, o->current.h);
|
||||
}
|
||||
|
||||
void
|
||||
_evas_get_previous_clipped_geometry(Evas e, Evas_Object o, double *x, double *y, double *w, double *h)
|
||||
{
|
||||
if (!o->previous.visible)
|
||||
{
|
||||
*x = 0.0;
|
||||
*y = 0.0;
|
||||
*w = 0.0;
|
||||
*h = 0.0;
|
||||
return;
|
||||
}
|
||||
if (o->clip.object)
|
||||
_evas_get_current_clipped_geometry(e, o->clip.object, x, y, w, h);
|
||||
CLIP_TO(*x, *y, *w, *h,
|
||||
o->previous.x, o->previous.y, o->previous.w, o->previous.h);
|
||||
}
|
||||
|
||||
int
|
||||
_evas_point_in_object(Evas e, Evas_Object o, int x, int y)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
#include "Evas_private.h"
|
||||
#include "Evas.h"
|
||||
#include <stdio.h>
|
||||
|
@ -18,59 +17,38 @@
|
|||
((SPANS_COMMON((x), (w), (xx), (ww))) && (SPANS_COMMON((y), (h), (yy), (hh))))
|
||||
#endif
|
||||
|
||||
void _evas_get_current_clipped_geometry(Evas e, Evas_Object o, double *x, double *y, double *w, double *h);
|
||||
void _evas_get_previous_clipped_geometry(Evas e, Evas_Object o, double *x, double *y, double *w, double *h);
|
||||
|
||||
void
|
||||
_evas_object_get_current_translated_coords(Evas e, Evas_Object o,
|
||||
int *x, int *y, int *w, int *h, int clip)
|
||||
{
|
||||
double ox, oy, ow, oh;
|
||||
double ox, oy, ow, oh, mx, my;
|
||||
|
||||
ox = o->current.x; oy = o->current.y;
|
||||
ow = o->current.w; oh = o->current.h;
|
||||
if (clip)
|
||||
_evas_get_current_clipped_geometry(e, o, &ox, &oy, &ow, &oh);
|
||||
*x = (int)
|
||||
(((ox - e->current.viewport.x) *
|
||||
(double)e->current.drawable_width) /
|
||||
e->current.viewport.w);
|
||||
*y = (int)
|
||||
(((oy - e->current.viewport.y) *
|
||||
(double)e->current.drawable_height) /
|
||||
e->current.viewport.h);
|
||||
*w = (int)
|
||||
((ow * (double)e->current.drawable_width) /
|
||||
e->current.viewport.w);
|
||||
*h = (int)
|
||||
((oh * (double)e->current.drawable_height) /
|
||||
e->current.viewport.h);
|
||||
if (clip) _evas_get_current_clipped_geometry(e, o, &ox, &oy, &ow, &oh);
|
||||
mx = e->current.val_cache.mult_x;
|
||||
my = e->current.val_cache.mult_y;
|
||||
*x = (int)((ox - e->current.viewport.x) * mx);
|
||||
*y = (int)((oy - e->current.viewport.y) * my);
|
||||
*w = (int)(ow * mx);
|
||||
*h = (int)(oh * my);
|
||||
}
|
||||
|
||||
void
|
||||
_evas_object_get_previous_translated_coords(Evas e, Evas_Object o,
|
||||
int *x, int *y, int *w, int *h, int clip)
|
||||
{
|
||||
double ox, oy, ow, oh;
|
||||
double ox, oy, ow, oh, mx, my;
|
||||
|
||||
ox = o->previous.x; oy = o->previous.y;
|
||||
ow = o->previous.w; oh = o->previous.h;
|
||||
if (clip)
|
||||
_evas_get_previous_clipped_geometry(e, o, &ox, &oy, &ow, &oh);
|
||||
*x = (int)
|
||||
(((ox - e->previous.viewport.x) *
|
||||
(double)e->previous.drawable_width) /
|
||||
e->previous.viewport.w);
|
||||
*y = (int)
|
||||
(((oy - e->previous.viewport.y) *
|
||||
(double)e->previous.drawable_height) /
|
||||
e->previous.viewport.h);
|
||||
*w = (int)
|
||||
((ow * (double)e->previous.drawable_width) /
|
||||
e->previous.viewport.w);
|
||||
*h = (int)
|
||||
((oh * (double)e->previous.drawable_height) /
|
||||
e->previous.viewport.h);
|
||||
if (clip) _evas_get_previous_clipped_geometry(e, o, &ox, &oy, &ow, &oh);
|
||||
mx = e->current.val_cache.mult_x;
|
||||
my = e->current.val_cache.mult_y;
|
||||
*x = (int)((ox - e->previous.viewport.x) * mx);
|
||||
*y = (int)((oy - e->previous.viewport.y) * my);
|
||||
*w = (int)(ow * mx);
|
||||
*h = (int)(oh * my);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1426,6 +1404,8 @@ evas_set_output_size(Evas e, int w, int h)
|
|||
if ((e->current.drawable_width == w) && (e->current.drawable_height == h)) return;
|
||||
e->current.drawable_width = w;
|
||||
e->current.drawable_height = h;
|
||||
e->current.val_cache.mult_x = (double)e->current.drawable_width / e->current.viewport.w;
|
||||
e->current.val_cache.mult_y = (double)e->current.drawable_height / e->current.viewport.h;
|
||||
e->changed = 1;
|
||||
}
|
||||
|
||||
|
@ -1441,6 +1421,8 @@ evas_set_output_viewport(Evas e, double x, double y, double w, double h)
|
|||
e->current.viewport.y = y;
|
||||
e->current.viewport.w = w;
|
||||
e->current.viewport.h = h;
|
||||
e->current.val_cache.mult_x = (double)e->current.drawable_width / e->current.viewport.w;
|
||||
e->current.val_cache.mult_y = (double)e->current.drawable_height / e->current.viewport.h;
|
||||
e->changed = 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ main(int argc, char **argv)
|
|||
Evas_Object o[128], o_rect, o_line, o_grad, o_fps, o_text, o_poly;
|
||||
Evas_Gradient grad;
|
||||
int down;
|
||||
double t1, t2;
|
||||
double t0, t1, t2;
|
||||
char *save_file = NULL;
|
||||
char *imgs[8] =
|
||||
{
|
||||
|
@ -324,7 +324,7 @@ main(int argc, char **argv)
|
|||
evas_set_image_fill(e, o[0], 0, 0, win_w, win_h);
|
||||
a = 0;
|
||||
down = 0;
|
||||
t1 = get_time();
|
||||
t0 = t1 = get_time();
|
||||
m = 0;
|
||||
for (;;)
|
||||
{
|
||||
|
@ -356,6 +356,8 @@ main(int argc, char **argv)
|
|||
button = ev.xbutton.button;
|
||||
if (button == 3)
|
||||
{
|
||||
t2 = get_time() - t0;
|
||||
printf("Avg FPS: %3.3f\n", a / t2);
|
||||
evas_free(e);
|
||||
exit(0);
|
||||
}
|
||||
|
@ -430,9 +432,5 @@ main(int argc, char **argv)
|
|||
evas_get_geometry(e, o_fps, NULL, NULL, &gw, &gh);
|
||||
evas_move(e, o_fps, win_w - gw, win_h - gh);
|
||||
}
|
||||
if (a >= 1000)
|
||||
{
|
||||
a = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue