forked from enlightenment/efl
optimize! software enigne image objects will keep a pre-scaled copy IF:
1. they are rendered completely unclipped by clip obejcts or edges of the canvas for more than 16 iterations at the same size with no border scaling 2. it will throw thme out if things chnage 3. it will share image objects only of original size :) SVN revision: 5139
This commit is contained in:
parent
bfd707ce99
commit
55bba3ab5e
|
@ -1,5 +1,5 @@
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
E V A S - 0.5.0
|
E V A S - 0.6.0
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
This is the ``E Canvas'' - a rip off of some of the other canvas's floating
|
This is the ``E Canvas'' - a rip off of some of the other canvas's floating
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# SETUP
|
# SETUP
|
||||||
AC_INIT(src/Evas.h)
|
AC_INIT(src/Evas.h)
|
||||||
AM_CONFIG_HEADER(config.h)
|
AM_CONFIG_HEADER(config.h)
|
||||||
AM_INIT_AUTOMAKE(evas, 0.5.0)
|
AM_INIT_AUTOMAKE(evas, 0.6.0)
|
||||||
|
|
||||||
IMLIB2_CONFIG_IN_PATH=xyes
|
IMLIB2_CONFIG_IN_PATH=xyes
|
||||||
AC_PROGRAM_CHECK(IMLIB2_CONFIG_IN_PATH, imlib2-config, xyes, xno)
|
AC_PROGRAM_CHECK(IMLIB2_CONFIG_IN_PATH, imlib2-config, xyes, xno)
|
||||||
|
|
|
@ -1,2 +1,5 @@
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
evas.sdw evas.pdf
|
evas.sdw evas.pdf
|
||||||
|
evasdir = $(datadir)/evas/doc
|
||||||
|
evas_DATA = \
|
||||||
|
evas.sdw evas.pdf
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# this is NOT relocatable, unless you alter the patch!
|
# this is NOT relocatable, unless you alter the patch!
|
||||||
%define name evas
|
%define name evas
|
||||||
%define ver 0.5.0
|
%define ver 0.6.0
|
||||||
%define rel 1
|
%define rel 1
|
||||||
%define prefix /usr
|
%define prefix /usr
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ Packager: Term <kempler@utdallas.edu>
|
||||||
Vendor: The Enlightenment Development Team <e-develop@enlightenment.org>
|
Vendor: The Enlightenment Development Team <e-develop@enlightenment.org>
|
||||||
Source: ftp://ftp.enlightenment.org/enlightenment/%{name}-%{ver}.tar.gz
|
Source: ftp://ftp.enlightenment.org/enlightenment/%{name}-%{ver}.tar.gz
|
||||||
BuildRoot: /var/tmp/%{name}-root
|
BuildRoot: /var/tmp/%{name}-root
|
||||||
Requires: imlib2 >= 1.0.3
|
Requires: imlib2 >= 1.0.4
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Evas is an advanced canvas library, providing three backends for
|
Evas is an advanced canvas library, providing three backends for
|
||||||
|
@ -67,7 +67,8 @@ rm -rf $RPM_BUILD_ROOT
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
%{prefix}/lib/libevas.so.*
|
%{prefix}/lib/libevas.so.*
|
||||||
%{prefix}/bin/evas_*
|
%{prefix}/bin/evas_*
|
||||||
%{prefix}/share/evas/*
|
%{prefix}/share/evas/fnt
|
||||||
|
%{prefix}/share/evas/img
|
||||||
|
|
||||||
%files devel
|
%files devel
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
|
@ -75,3 +76,4 @@ rm -rf $RPM_BUILD_ROOT
|
||||||
%{prefix}/lib/libevas.*a
|
%{prefix}/lib/libevas.*a
|
||||||
%{prefix}/include/Evas.h
|
%{prefix}/include/Evas.h
|
||||||
%{prefix}/bin/evas-config
|
%{prefix}/bin/evas-config
|
||||||
|
%{prefix}/share/evas/doc
|
||||||
|
|
|
@ -59,4 +59,4 @@ Evas_private.h
|
||||||
|
|
||||||
libevas_la_LIBADD = $(LIBS_ALL)
|
libevas_la_LIBADD = $(LIBS_ALL)
|
||||||
libevas_la_DEPENDENCIES = $(top_builddir)/config.h
|
libevas_la_DEPENDENCIES = $(top_builddir)/config.h
|
||||||
libevas_la_LDFLAGS = -version-info 5:0:5
|
libevas_la_LDFLAGS = -version-info 6:0:6
|
||||||
|
|
|
@ -55,7 +55,7 @@ __evas_imlib_image_cache_clean(void)
|
||||||
__evas_image_cache_used -=
|
__evas_image_cache_used -=
|
||||||
imlib_image_get_width() *
|
imlib_image_get_width() *
|
||||||
imlib_image_get_height() * 4;
|
imlib_image_get_height() * 4;
|
||||||
imlib_free_image_and_decache();
|
imlib_free_image();
|
||||||
if (last->scaled.image)
|
if (last->scaled.image)
|
||||||
{
|
{
|
||||||
imlib_context_set_image(last->scaled.image);
|
imlib_context_set_image(last->scaled.image);
|
||||||
|
@ -113,17 +113,16 @@ __evas_imlib_image_new_from_file(Display *disp, char *file)
|
||||||
Evas_Imlib_Image *im;
|
Evas_Imlib_Image *im;
|
||||||
Imlib_Image image;
|
Imlib_Image image;
|
||||||
|
|
||||||
im = __evas_imlib_image_cache_find(file);
|
|
||||||
if (im) return im;
|
|
||||||
|
|
||||||
image = imlib_load_image(file);
|
image = imlib_load_image(file);
|
||||||
if (!image) return NULL;
|
if (!image) return NULL;
|
||||||
im = malloc(sizeof(Evas_Imlib_Image));
|
im = malloc(sizeof(Evas_Imlib_Image));
|
||||||
im->file = strdup(file);
|
im->file = strdup(file);
|
||||||
im->image = image;
|
im->image = image;
|
||||||
im->scaled.aa = 0;
|
im->scaled.aa = 0;
|
||||||
|
im->scaled.w = 0;
|
||||||
|
im->scaled.h = 0;
|
||||||
im->scaled.image = NULL;
|
im->scaled.image = NULL;
|
||||||
im->life = 0;
|
im->scaled.usage = 0;
|
||||||
im->references = 1;
|
im->references = 1;
|
||||||
images = evas_list_prepend(images, im);
|
images = evas_list_prepend(images, im);
|
||||||
return im;
|
return im;
|
||||||
|
@ -216,7 +215,6 @@ __evas_imlib_image_draw(Evas_Imlib_Image *im,
|
||||||
imlib_context_set_direction(IMLIB_TEXT_TO_RIGHT);
|
imlib_context_set_direction(IMLIB_TEXT_TO_RIGHT);
|
||||||
imlib_context_set_anti_alias(__evas_anti_alias);
|
imlib_context_set_anti_alias(__evas_anti_alias);
|
||||||
imlib_context_set_blend(1);
|
imlib_context_set_blend(1);
|
||||||
/* if (im->life < 65536) im->life++;*/
|
|
||||||
for(l = drawable_list; l; l = l->next)
|
for(l = drawable_list; l; l = l->next)
|
||||||
{
|
{
|
||||||
Evas_Imlib_Drawable *dr;
|
Evas_Imlib_Drawable *dr;
|
||||||
|
@ -247,8 +245,7 @@ __evas_imlib_image_draw(Evas_Imlib_Image *im,
|
||||||
if (!up->image)
|
if (!up->image)
|
||||||
up->image = imlib_create_image(up->w, up->h);
|
up->image = imlib_create_image(up->w, up->h);
|
||||||
/* if our src and dest are 1:1 scaling.. use original */
|
/* if our src and dest are 1:1 scaling.. use original */
|
||||||
if (((dst_w == src_w) && (dst_h == src_h)) ||
|
if ((dst_w == src_w) && (dst_h == src_h))
|
||||||
(im->life < 2))
|
|
||||||
{
|
{
|
||||||
imlib_context_set_image(up->image);
|
imlib_context_set_image(up->image);
|
||||||
imlib_blend_image_onto_image(im->image, 0,
|
imlib_blend_image_onto_image(im->image, 0,
|
||||||
|
@ -256,6 +253,7 @@ __evas_imlib_image_draw(Evas_Imlib_Image *im,
|
||||||
dst_x - up->x, dst_y - up->y, dst_w, dst_h);
|
dst_x - up->x, dst_y - up->y, dst_w, dst_h);
|
||||||
if (im->scaled.image)
|
if (im->scaled.image)
|
||||||
{
|
{
|
||||||
|
im->scaled.usage = 0;
|
||||||
imlib_context_set_image(im->scaled.image);
|
imlib_context_set_image(im->scaled.image);
|
||||||
imlib_free_image();
|
imlib_free_image();
|
||||||
im->scaled.image = NULL;
|
im->scaled.image = NULL;
|
||||||
|
@ -352,6 +350,29 @@ __evas_imlib_image_draw(Evas_Imlib_Image *im,
|
||||||
iw = imlib_image_get_width();
|
iw = imlib_image_get_width();
|
||||||
ih = imlib_image_get_height();
|
ih = imlib_image_get_height();
|
||||||
|
|
||||||
|
if ((dst_w == im->scaled.w) &&
|
||||||
|
(dst_h == im->scaled.h) &&
|
||||||
|
(__evas_anti_alias == im->scaled.aa))
|
||||||
|
{
|
||||||
|
Imlib_Border bd;
|
||||||
|
|
||||||
|
imlib_context_set_image(im->image);
|
||||||
|
imlib_image_get_border(&bd);
|
||||||
|
if ((bd.left != 0) ||
|
||||||
|
(bd.right != 0) ||
|
||||||
|
(bd.top != 0) ||
|
||||||
|
(bd.bottom != 0))
|
||||||
|
im->scaled.usage = 0;
|
||||||
|
else
|
||||||
|
im->scaled.usage++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
im->scaled.usage = 0;
|
||||||
|
im->scaled.w = dst_w;
|
||||||
|
im->scaled.h = dst_h;
|
||||||
|
im->scaled.aa = __evas_anti_alias;
|
||||||
|
}
|
||||||
/* if we are using the WHOLE src image */
|
/* if we are using the WHOLE src image */
|
||||||
if ((src_x == 0) && (src_y == 0) &&
|
if ((src_x == 0) && (src_y == 0) &&
|
||||||
(src_w == iw) && (src_h == ih) &&
|
(src_w == iw) && (src_h == ih) &&
|
||||||
|
@ -360,7 +381,8 @@ __evas_imlib_image_draw(Evas_Imlib_Image *im,
|
||||||
(dst_w + dst_x <= win_w) && (dst_h + dst_y <= win_h) &&
|
(dst_w + dst_x <= win_w) && (dst_h + dst_y <= win_h) &&
|
||||||
((!__evas_clip) ||
|
((!__evas_clip) ||
|
||||||
((dst_x >= __evas_clip_x) && (dst_y >= __evas_clip_y) &&
|
((dst_x >= __evas_clip_x) && (dst_y >= __evas_clip_y) &&
|
||||||
(dst_w + dst_x <= __evas_clip_w) && (dst_h + dst_y <= __evas_clip_h)))))
|
(dst_w + dst_x <= __evas_clip_w) && (dst_h + dst_y <= __evas_clip_h)))) &&
|
||||||
|
(im->scaled.usage > 15))
|
||||||
{
|
{
|
||||||
imlib_context_set_image(im->image);
|
imlib_context_set_image(im->image);
|
||||||
im->scaled.image = imlib_create_cropped_scaled_image(0, 0, iw, ih,
|
im->scaled.image = imlib_create_cropped_scaled_image(0, 0, iw, ih,
|
||||||
|
|
|
@ -38,9 +38,10 @@ struct _evas_imlib_image
|
||||||
Imlib_Image image;
|
Imlib_Image image;
|
||||||
struct {
|
struct {
|
||||||
int aa;
|
int aa;
|
||||||
|
int w, h;
|
||||||
Imlib_Image image;
|
Imlib_Image image;
|
||||||
|
int usage;
|
||||||
} scaled;
|
} scaled;
|
||||||
int life;
|
|
||||||
int references;
|
int references;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -910,12 +910,16 @@ evas_render_updates(Evas e)
|
||||||
void *im;
|
void *im;
|
||||||
|
|
||||||
oo = o;
|
oo = o;
|
||||||
if (o->renderer_data.method[e->current.render_method])
|
im = NULL;
|
||||||
im = (void *)o->renderer_data.method[e->current.render_method];
|
if (oo->current.file)
|
||||||
else
|
{
|
||||||
o->renderer_data.method[e->current.render_method] =
|
if (o->renderer_data.method[e->current.render_method])
|
||||||
im =
|
im = (void *)o->renderer_data.method[e->current.render_method];
|
||||||
func_image_new_from_file(e->current.display, oo->current.file);
|
else
|
||||||
|
o->renderer_data.method[e->current.render_method] =
|
||||||
|
im =
|
||||||
|
func_image_new_from_file(e->current.display, oo->current.file);
|
||||||
|
}
|
||||||
if (im)
|
if (im)
|
||||||
{
|
{
|
||||||
int visx, visy, visw, vish;
|
int visx, visy, visw, vish;
|
||||||
|
|
Loading…
Reference in New Issue