* evas: Use eina_log.

Patch from Matthieu.


SVN revision: 42598
This commit is contained in:
Cedric BAIL 2009-09-21 16:08:51 +00:00
parent db6bee8c04
commit c259d8addd
53 changed files with 478 additions and 424 deletions

View File

@ -15,3 +15,4 @@ Gustavo Sverzut Barbieri <barbieri@gmail.com>
Vincent Torri <vtorri at univ-evry dot fr>
Tim Horton <hortont424@gmail.com>
Tom Hacohen <tom@stosb.com>
Mathieu Taillefumier <mathieu.taillefumier@free.fr>

View File

@ -17,7 +17,18 @@
#include "evas_cs.h"
#define D(...) EINA_LOG_DBG(__VA_ARGS__)
#ifdef ERR
#undef ERR
#endif
#define ERR(...) EINA_LOG_DOM_ERR(_evas_cserve_bin_log_dom, __VA_ARGS__)
#ifdef DBG
#undef DBG
#endif
#define DBG(...) EINA_LOG_DOM_DBG(_evas_cserve_bin_log_dom, __VA_ARGS__)
#ifdef CSERVE_BIN_DEFAULT_COLOR
#undef CSERVE_BIN_DEFAULT_COLOR
#endif
#define CSERVE_BIN_DEFAULT_COLOR "\033[36m"
// fixme:'s
//
// preload - make it work (both)
@ -102,7 +113,7 @@ static int cache_max_adjust = 0;
static int cache_item_timeout = -1;
static int cache_item_timeout_check = -1;
static Mem *stat_mem = NULL;
static int _evas_cserve_bin_log_dom = -1;
static int stat_mem_num = 0;
static Eina_List *stat_mems = NULL;
@ -468,16 +479,16 @@ img_new(const char *file, const char *key, RGBA_Image_Loadopts *load_opts, const
int err = 0;
double t;
D("... stat %s", file);
DBG("... stat %s", file);
ret = stat(file, &st);
if (ret < 0) return NULL;
D("... load header");
DBG("... load header");
t = get_time();
ie = evas_cache_image_request(cache, file, key, load_opts, &err);
t = get_time() - t;
D("... header done");
DBG("... header done");
if (!ie) return NULL;
D("... ie->cache = %p", ie->cache);
DBG("... ie->cache = %p", ie->cache);
img = (Img *)ie;
img->stats.load1 = t;
img->key = eina_stringshare_add(bufkey);
@ -528,10 +539,10 @@ img_free(Img *img)
{
if (img->incache > 0)
{
printf("EEEEEEEEEEEEEEEEK!\n");
printf("EEEEEEEEEEEEEEEEK! %p '%s' still in cache\n",
ERR("EEEEEEEEEEEEEEEEK!");
ERR("EEEEEEEEEEEEEEEEK! %p '%s' still in cache",
img, img->file.file);
printf("EEEEEEEEEEEEEEEEK!\n");
ERR("EEEEEEEEEEEEEEEEK!");
return;
}
stats_lifetime_update(img);
@ -555,7 +566,7 @@ img_free(Img *img)
static void
cache_clean(void)
{
D("... cache clean!!! do");
DBG("... cache clean!!! do");
LKL(cache_lock);
while ((cache_usage > ((cache_max_usage + cache_max_adjust) * 1024)) &&
(cache_images))
@ -563,13 +574,13 @@ cache_clean(void)
Img *img;
Eina_List *l;
D("... clean loop %i > %i", cache_usage, (cache_max_usage + cache_max_adjust) * 1024);
DBG("... clean loop %i > %i", cache_usage, (cache_max_usage + cache_max_adjust) * 1024);
l = eina_list_last(cache_images); // THREAD: called from thread. happens to be safe as it uses no unlocked shared resources
if (!l) break;
img = l->data;
if (!img) break;
LKL(img->lock);
D("... REMOVE %p '%s'", img, img->file.file);
DBG("... REMOVE %p '%s'", img, img->file.file);
#ifdef BUILD_PTHREAD
img->killme = 1;
img->useless = 1;
@ -580,7 +591,7 @@ cache_clean(void)
cache_images = eina_list_remove_list(cache_images, l); // FIXME: called from thread
img->incache--;
cache_usage -= img->usage;
D("... IMG FREE %p", img);
DBG("... IMG FREE %p", img);
img_free(img);
#endif
}
@ -636,10 +647,10 @@ mem_cache_adjust(void)
if (cache_max_adjust < -cache_max_usage)
cache_max_adjust = -cache_max_usage;
D("... cache_max_adjust = %i", cache_max_adjust);
DBG("... cache_max_adjust = %i", cache_max_adjust);
if (pval != cache_max_adjust)
{
D("... cache clean");
DBG("... cache clean");
// FIXME lock problem
cache_clean();
}
@ -651,23 +662,23 @@ img_cache(Img *img)
eina_hash_del(active_images, img->key, img);
if (img->dead)
{
D("... img %p '%s' dead", img , img->file.file);
DBG("... img %p '%s' dead", img , img->file.file);
img_free(img);
return;
}
if ((cache_usage + img->usage) > ((cache_max_usage + cache_max_adjust) * 1024))
{
D("... img %p '%s' too big for cache", img , img->file.file);
DBG("... img %p '%s' too big for cache", img , img->file.file);
img_free(img);
return;
}
D("... img %p '%s' cached += %i", img , img->file.file, img->usage);
DBG("... img %p '%s' cached += %i", img , img->file.file, img->usage);
if (img->incache > 0)
{
printf("EEEEEEEEEEEEEEEEK!\n");
printf("EEEEEEEEEEEEEEEEK! %p '%s' already in cache\n",
ERR("EEEEEEEEEEEEEEEEK!");
ERR("EEEEEEEEEEEEEEEEK! %p '%s' already in cache",
img, img->file.file);
printf("EEEEEEEEEEEEEEEEK!\n");
ERR("EEEEEEEEEEEEEEEEK!");
return;
}
LKL(cache_lock);
@ -729,8 +740,8 @@ img_load(const char *file, const char *key, RGBA_Image_Loadopts *load_opts)
Eina_List *l, *l_next;
if (!file) return NULL;
D("... img_load '%s'", file);
if (key) D("... ... key '%s'", key);
DBG("... img_load '%s'", file);
if (key) DBG("... ... key '%s'", key);
if (key)
snprintf(buf, sizeof(buf), "%s///::/%s/\001/%i/%1.8f/%ix%i",
file, key,
@ -743,16 +754,16 @@ img_load(const char *file, const char *key, RGBA_Image_Loadopts *load_opts)
load_opts->scale_down_by,
load_opts->dpi,
load_opts->w, load_opts->h);
D("... find '%s'", buf);
DBG("... find '%s'", buf);
img = eina_hash_find(active_images, buf);
if ((img) && (img_ok(img)))
{
D("... found!");
DBG("... found!");
img->stats.load1saved++;
img->ref++;
D("... sats update");
DBG("... stats update");
stats_update();
D("... return %p", img);
DBG("... return %p", img);
return img;
}
@ -765,7 +776,7 @@ img_load(const char *file, const char *key, RGBA_Image_Loadopts *load_opts)
LKL(img->lock);
if (img_ok(img))
{
D("... found cached");
DBG("... found cached");
cache_images = eina_list_remove_list(cache_images, l);
img->incache--;
cache_usage -= img->usage;
@ -773,9 +784,9 @@ img_load(const char *file, const char *key, RGBA_Image_Loadopts *load_opts)
img->stats.load1saved++;
img->ref++;
eina_hash_direct_add(active_images, img->key, img);
D("... sats update");
DBG("... sats update");
stats_update();
D("... return %p", img);
DBG("... return %p", img);
LKU(img->lock);
LKU(cache_lock);
return img;
@ -784,7 +795,7 @@ img_load(const char *file, const char *key, RGBA_Image_Loadopts *load_opts)
}
}
LKU(cache_lock);
D("... ned new img");
DBG("... ned new img");
return img_new(file, key, load_opts, buf);
}
@ -793,17 +804,17 @@ img_unload(Img *img)
{
if (img->ref == 0)
{
printf("EEEEEEEEEEEEEEEEK!\n");
printf("EEEEEEEEEEEEEEEEK! %p '%s' already @ ref 0\n",
ERR("EEEEEEEEEEEEEEEEK!");
ERR("EEEEEEEEEEEEEEEEK! %p '%s' already @ ref 0",
img, img->file.file);
printf("EEEEEEEEEEEEEEEEK!\n");
ERR("EEEEEEEEEEEEEEEEK!");
return;
}
img->ref--;
D("... img ref-- = %i", img->ref);
DBG("... img ref-- = %i", img->ref);
if (img->ref == 0)
{
D("... img cache %p '%s'", img, img->file.file);
DBG("... img cache %p '%s'", img, img->file.file);
img_cache(img);
}
}
@ -811,12 +822,12 @@ img_unload(Img *img)
static void
img_unloaddata(Img *img)
{
D("img_unloaddata() %p '%s'", img, img->file.file);
DBG("img_unloaddata() %p '%s'", img, img->file.file);
if ((img->dref <= 0) && (img->useless) && (img->mem))
{
Image_Entry *ie = (Image_Entry *)img;
D("... really do forced unload");
DBG("... really do forced unload");
if (!img->active) cache_usage -= img->usage;
img->usage -=
(4096 * (((img->image.w * img->image.h * sizeof(DATA32)) + 4095) / 4096)) +
@ -827,7 +838,7 @@ img_unloaddata(Img *img)
img->mem = NULL;
img->image.data = NULL;
img->dref = 0;
D("... done");
DBG("... done");
ie->flags.loaded = 0;
ie->allocated.w = 0;
@ -838,7 +849,7 @@ img_unloaddata(Img *img)
static void
img_useless(Img *img)
{
D("img_useless() %p", img);
DBG("img_useless() %p", img);
img->useless = 1;
if (img->dref <= 0) img_unloaddata(img);
}
@ -846,7 +857,7 @@ img_useless(Img *img)
static void
img_forcedunload(Img *img)
{
D("img_forcedunload() %p", img);
DBG("img_forcedunload() %p", img);
img->dead = 1;
img_unload(img);
}
@ -854,7 +865,7 @@ img_forcedunload(Img *img)
static void
img_preload(Img *img)
{
D("img_preload() %p", img);
DBG("img_preload() %p", img);
}
static void
@ -864,12 +875,12 @@ client_del(void *data, Client *c)
Img *img;
images = data;
D("... CLIENT DEL %i", c->pid);
DBG("... CLIENT DEL %i", c->pid);
EINA_LIST_FREE(images, img)
{
D("... unloaddata img %p", img);
DBG("... unloaddata img %p", img);
img_unloaddata(img);
D("... unload img %p", img);
DBG("... unload img %p", img);
img_unload(img);
}
}
@ -903,7 +914,7 @@ load_data_thread(void *data)
msg.mem.id = img->mem->id;
msg.mem.offset = img->mem->offset;
msg.mem.size = img->mem->size;
D("... reply");
DBG("... reply");
evas_cserve_client_send(c, OP_LOADDATA, sizeof(msg), (unsigned char *)(&msg));
LKU(c->lock);
return NULL;
@ -919,7 +930,7 @@ load_data_thread(void *data)
else
msg.mem.id = msg.mem.offset = msg.mem.size = 0;
LKU(img->lock);
D("... reply");
DBG("... reply");
evas_cserve_client_send(c, OP_LOADDATA, sizeof(msg), (unsigned char *)(&msg));
LKU(c->lock);
return NULL;
@ -930,7 +941,7 @@ static int
message(void *fdata, Server *s, Client *c, int opcode, int size, unsigned char *data)
{
t_now = time(NULL);
D("message @ %i...", (int)t_now);
DBG("message @ %i...", (int)t_now);
switch (opcode)
{
case OP_INIT:
@ -950,8 +961,8 @@ message(void *fdata, Server *s, Client *c, int opcode, int size, unsigned char *
}
c->func = client_del;
c->data = NULL;
D("OP_INIT %i", c->pid);
D("... reply");
DBG("OP_INIT %i", c->pid);
DBG("... reply");
evas_cserve_client_send(c, OP_INIT, sizeof(msg), (unsigned char *)(&msg));
}
break;
@ -963,7 +974,7 @@ message(void *fdata, Server *s, Client *c, int opcode, int size, unsigned char *
RGBA_Image_Loadopts lopt = {0, 0.0, 0, 0, 0, 0, 0, 0};
char *file = NULL, *key = NULL;
D("OP_LOAD %i", c->pid);
DBG("OP_LOAD %i", c->pid);
rep = (Op_Load *)data;
file = data + sizeof(Op_Load);
key = file + strlen(file) + 1;
@ -976,17 +987,17 @@ message(void *fdata, Server *s, Client *c, int opcode, int size, unsigned char *
lopt.region.y = rep->lopt.region.y;
lopt.region.w = rep->lopt.region.w;
lopt.region.h = rep->lopt.region.h;
D("... img_load '%s'", file);
if (key) D("'%s'", key);
else D(" '%s'", NULL);
D(" lopt { %i %1.1f %i %i { %i %i %i %i}}",
DBG("... img_load '%s'", file);
if (key) DBG("'%s'", key);
else DBG(" '%s'", NULL);
DBG(" lopt { %i %1.1f %i %i { %i %i %i %i}}",
lopt.scale_down_by, lopt.dpi, lopt.w, lopt.h,
lopt.region.x, lopt.region.y, lopt.region.w, lopt.region.h);
img = img_load(file, key, &lopt);
D("... img_load = %p", img);
DBG("... img_load = %p", img);
if (img)
{
D("... add image to client list");
DBG("... add image to client list");
if (c->client_main)
c->client_main->data = eina_list_append(c->client_main->data, img);
else
@ -1010,7 +1021,7 @@ message(void *fdata, Server *s, Client *c, int opcode, int size, unsigned char *
msg.image.h = img->image.h;
msg.image.alpha = img->image.alpha;
}
D("... reply");
DBG("... reply");
evas_cserve_client_send(c, OP_LOAD, sizeof(msg), (unsigned char *)(&msg));
}
break;
@ -1019,19 +1030,19 @@ message(void *fdata, Server *s, Client *c, int opcode, int size, unsigned char *
Op_Unload *rep;
Img *img;
D("OP_UNLOAD %i", c->pid);
DBG("OP_UNLOAD %i", c->pid);
rep = (Op_Unload *)data;
img = rep->handle;
if ((img) && (rep->server_id == server_id))
{
Eina_Bool doflush = 0;
D("... remove %p from list", img);
DBG("... remove %p from list", img);
if (c->client_main)
c->client_main->data = eina_list_remove(c->client_main->data, img);
else
c->data = eina_list_remove(c->data, img);
D("... unload %p", img);
DBG("... unload %p", img);
LKL(img->lock);
img->ref++;
img_unload(img);
@ -1050,14 +1061,14 @@ message(void *fdata, Server *s, Client *c, int opcode, int size, unsigned char *
Op_Loaddata_Reply msg;
Img *img;
D("OP_LOADDATA %i", c->pid);
DBG("OP_LOADDATA %i", c->pid);
rep = (Op_Loaddata *)data;
img = rep->handle;
if ((img) && (rep->server_id == server_id))
{
if (img->mem)
{
D("... load saved - cached %p", img);
DBG("... load saved - cached %p", img);
img->stats.load2saved++;
stats_update();
memset(&msg, 0, sizeof(msg));
@ -1069,7 +1080,7 @@ message(void *fdata, Server *s, Client *c, int opcode, int size, unsigned char *
}
else
msg.mem.id = msg.mem.offset = msg.mem.size = 0;
D("... reply");
DBG("... reply");
evas_cserve_client_send(c, OP_LOADDATA, sizeof(msg), (unsigned char *)(&msg));
}
else
@ -1079,7 +1090,7 @@ message(void *fdata, Server *s, Client *c, int opcode, int size, unsigned char *
pthread_attr_t attr;
Load_Inf *li;
D("... load data %p", img);
DBG("... load data %p", img);
pthread_attr_init(&attr);
li = calloc(1, sizeof(Load_Inf));
if (li)
@ -1106,7 +1117,7 @@ message(void *fdata, Server *s, Client *c, int opcode, int size, unsigned char *
}
else
msg.mem.id = msg.mem.offset = msg.mem.size = 0;
D("... reply");
DBG("... reply");
evas_cserve_client_send(c, OP_LOADDATA, sizeof(msg), (unsigned char *)(&msg));
#endif
}
@ -1123,16 +1134,16 @@ message(void *fdata, Server *s, Client *c, int opcode, int size, unsigned char *
Op_Unloaddata *rep;
Img *img;
D("OP_UNLOADDATA %i", c->pid);
DBG("OP_UNLOADDATA %i", c->pid);
rep = (Op_Unloaddata *)data;
img = rep->handle;
if ((img) && (rep->server_id == server_id))
{
D("... dref--");
DBG("... dref--");
LKL(img->lock);
img->dref--;
if (img->dref < 0) img->dref = 0;
D("... unload data %p '%s'", img, img->file.file);
DBG("... unload data %p '%s'", img, img->file.file);
img_unloaddata(img);
LKU(img->lock);
}
@ -1143,16 +1154,16 @@ message(void *fdata, Server *s, Client *c, int opcode, int size, unsigned char *
Op_Unloaddata *rep;
Img *img;
D("OP_USELESSDATA %i", c->pid);
DBG("OP_USELESSDATA %i", c->pid);
rep = (Op_Unloaddata *)data;
img = rep->handle;
if ((img) && (rep->server_id == server_id))
{
D("... dref--");
DBG("... dref--");
LKL(img->lock);
img->dref--;
if (img->dref < 0) img->dref = 0;
D("... useless %p", img);
DBG("... useless %p", img);
img_useless(img);
LKU(img->lock);
}
@ -1163,7 +1174,7 @@ message(void *fdata, Server *s, Client *c, int opcode, int size, unsigned char *
Op_Preload *rep;
Img *img;
D("OP_PRELOAD %i", c->pid);
DBG("OP_PRELOAD %i", c->pid);
rep = (Op_Preload *)data;
img = rep->handle;
if ((img) && (rep->server_id == server_id))
@ -1183,7 +1194,7 @@ message(void *fdata, Server *s, Client *c, int opcode, int size, unsigned char *
Op_Forcedunload *rep;
Img *img;
D("OP_FORCEDUNLOAD %i", c->pid);
DBG("OP_FORCEDUNLOAD %i", c->pid);
rep = (Op_Forcedunload *)data;
img = rep->handle;
if ((img) && (rep->server_id == server_id))
@ -1191,12 +1202,12 @@ message(void *fdata, Server *s, Client *c, int opcode, int size, unsigned char *
Eina_Bool doflush = 0;
LKL(img->lock);
D("remove %p from list", img);
DBG("remove %p from list", img);
if (c->client_main)
c->client_main->data = eina_list_remove(c->client_main->data, img);
else
c->data = eina_list_remove(c->data, img);
D("... forced unload now");
DBG("... forced unload now");
img->ref++;
img_forcedunload(img);
img->ref--;
@ -1212,11 +1223,11 @@ message(void *fdata, Server *s, Client *c, int opcode, int size, unsigned char *
{
Op_Getconfig_Reply msg;
D("OP_GETCONFIG %i", c->pid);
DBG("OP_GETCONFIG %i", c->pid);
msg.cache_max_usage = cache_max_usage;
msg.cache_item_timeout = cache_item_timeout;
msg.cache_item_timeout_check = cache_item_timeout_check;
D("... reply");
DBG("... reply");
evas_cserve_client_send(c, OP_GETCONFIG, sizeof(msg), (unsigned char *)(&msg));
}
break;
@ -1224,14 +1235,14 @@ message(void *fdata, Server *s, Client *c, int opcode, int size, unsigned char *
{
Op_Setconfig *rep;
D("OP_SETCONFIG %i", c->pid);
DBG("OP_SETCONFIG %i", c->pid);
rep = (Op_Setconfig *)data;
cache_max_usage = rep->cache_max_usage;
cache_item_timeout = rep->cache_item_timeout;
cache_item_timeout_check = rep->cache_item_timeout_check;
D("... cache timeout");
DBG("... cache timeout");
cache_timeout(t_now);
D("... cache clean");
DBG("... cache clean");
cache_clean();
}
break;
@ -1239,7 +1250,7 @@ message(void *fdata, Server *s, Client *c, int opcode, int size, unsigned char *
{
Op_Getstats_Reply msg;
D("OP_GETSTATS %i", c->pid);
DBG("OP_GETSTATS %i", c->pid);
stats_calc();
msg.saved_memory = saved_memory;
msg.wasted_memory = (real_memory - alloced_memory);
@ -1247,7 +1258,7 @@ message(void *fdata, Server *s, Client *c, int opcode, int size, unsigned char *
msg.wasted_memory_peak = (real_memory_peak - alloced_memory_peak);
msg.saved_time_image_header_load = saved_load_lifetime + saved_load_time;
msg.saved_time_image_data_load = saved_loaddata_lifetime + saved_loaddata_time;
D("... reply");
DBG("... reply");
evas_cserve_client_send(c, OP_GETSTATS, sizeof(msg), (unsigned char *)(&msg));
}
break;
@ -1258,19 +1269,19 @@ message(void *fdata, Server *s, Client *c, int opcode, int size, unsigned char *
Eina_List *imgs = NULL, *l;
Img *img;
D("OP_GETINFO %i", c->pid);
DBG("OP_GETINFO %i", c->pid);
len = sizeof(Op_Getinfo_Reply);
D("... foreach");
DBG("... foreach");
if (active_images)
eina_hash_foreach(active_images, getinfo_hash_image_cb, &imgs);
D("... walk foreach list output");
DBG("... walk foreach list output");
LKL(cache_lock);
EINA_LIST_FOREACH(cache_images, l, img)
{
imgs = eina_list_append(imgs, img);
}
LKU(cache_lock);
D("... walk image cache");
DBG("... walk image cache");
EINA_LIST_FOREACH(imgs, l, img)
{
len += sizeof(Op_Getinfo_Item);
@ -1279,13 +1290,13 @@ message(void *fdata, Server *s, Client *c, int opcode, int size, unsigned char *
if (img->file.key) len += strlen(img->file.key);
len++;
}
D("... malloc msg");
DBG("... malloc msg");
msg = malloc(len);
if (msg)
{
unsigned char *p;
D("... init msg");
DBG("... init msg");
memset(msg, 0, len);
p = (unsigned char *)msg;
msg->active.mem_total = 0;
@ -1293,13 +1304,13 @@ message(void *fdata, Server *s, Client *c, int opcode, int size, unsigned char *
msg->cached.mem_total = 0;
msg->cached.count = 0;
p += sizeof(Op_Getinfo_Reply);
D("... walk all imgs");
DBG("... walk all imgs");
EINA_LIST_FOREACH(imgs, l, img)
{
Op_Getinfo_Item *itt, it;
LKL(img->lock);
D("... img %p", img);
DBG("... img %p", img);
memset(&it, 0, sizeof(Op_Getinfo_Item));
itt = (Op_Getinfo_Item *)p;
it.file_key_size = 0;
@ -1349,33 +1360,33 @@ message(void *fdata, Server *s, Client *c, int opcode, int size, unsigned char *
}
it.dead = img->dead;
it.useless = img->useless;
D("... memcpy %p %p %i ",
DBG("... memcpy %p %p %i ",
itt, &it, sizeof(Op_Getinfo_Item));
memcpy(itt, &it, sizeof(Op_Getinfo_Item));
D("... memcpy done n", img);
DBG("... memcpy done n", img);
p += sizeof(Op_Getinfo_Item) + it.file_key_size;
LKU(img->lock);
}
D("... walk all imgs done");
DBG("... walk all imgs done");
msg->active.mem_total =
(msg->active.mem_total + 1023) / 1024;
msg->cached.mem_total =
(msg->cached.mem_total + 1023) / 1024;
D("... reply");
DBG("... reply");
evas_cserve_client_send(c, OP_GETINFO, len, msg);
free(msg);
}
else
{
D("... reply empty");
DBG("... reply empty");
evas_cserve_client_send(c, OP_GETINFO, 0, NULL);
}
D("... free imgs list");
DBG("... free imgs list");
if (imgs) eina_list_free(imgs);
}
break;
default:
D("OP_... UNKNOWN??? %i opcode: %i", c->pid, opcode);
DBG("OP_... UNKNOWN??? %i opcode: %i", c->pid, opcode);
break;
}
return 0;
@ -1500,59 +1511,65 @@ main(int argc, char **argv)
unsetenv("EVAS_CSERVE");
D("eina init...");
DBG("eina init...");
eina_init();
D("evas init...");
evas_init();
_evas_cserve_bin_log_dom = eina_log_domain_register("Evas_cserve_bin", CSERVE_BIN_DEFAULT_COLOR);
if(_evas_cserve_bin_log_dom < 0) {
DBG("Problem with eina_log : impossible to create a log domain");
eina_shutdown();
exit(1);
}
D("img init...");
DBG("evas init...");
evas_init();
DBG("img init...");
img_init();
D("signal init...");
DBG("signal init...");
signal_init();
D("cserve add...");
DBG("cserve add...");
s = evas_cserve_server_add();
if (!s)
{
printf("ERROR: server socket init fail. abort.");
ERR("ERROR: server socket init fail. abort.");
goto error;
}
D("mem open (status)...");
DBG("mem open (status)...");
stat_mem = evas_cserve_mem_open(0, 0, "status", sizeof(int), 0);
if (stat_mem)
{
printf("WARNING: previous evas_cserve left garbage. cleaning up.");
WRN("WARNING: previous evas_cserve left garbage. cleaning up.");
stat_clean(stat_mem);
evas_cserve_mem_close(stat_mem);
stat_mem = NULL;
}
D("mem new (status)...");
DBG("mem new (status)...");
stat_mem = evas_cserve_mem_new(sizeof(int), "status");
if (!stat_mem)
{
printf("ERROR: cannot create status shmseg. abort.");
ERR("ERROR: cannot create status shmseg. abort.");
goto error;
}
D("init status...");
DBG("init status...");
if (!stat_init(stat_mem))
{
printf("ERROR: cannot init status shmseg. abort.");
ERR("cannot init status shmseg. abort.");
evas_cserve_mem_free(stat_mem);
stat_mem = NULL;
goto error;
}
D("cset server message handler...");
DBG("cset server message handler...");
evas_cserve_server_message_handler_set(s, message, NULL);
last_check = time(NULL);
t_next = 0;
if (cache_item_timeout_check > 0) t_next = cache_item_timeout_check;
D("LOOP!!! ...");
DBG("LOOP!!! ...");
for (;;)
{
/* fixme: timeout 0 only her - future use timeouts for timed
* housekeping */
if (exit_flag) break;
D("wait for messages...");
DBG("wait for messages...");
evas_cserve_server_wait(s, t_next * 1000000);
if (exit_flag) break;
t = time(NULL);
@ -1560,20 +1577,20 @@ main(int argc, char **argv)
if ((cache_item_timeout_check > 0) &&
((t_next) >= cache_item_timeout_check))
{
D("check timeout of items...");
DBG("check timeout of items...");
t_next = cache_item_timeout_check;
last_check = t;
D("cache timeout...");
DBG("cache timeout...");
cache_timeout(t);
D("meminfo check...");
DBG("meminfo check...");
meminfo_check();
D("mem cache adjust...");
DBG("mem cache adjust...");
mem_cache_adjust();
}
if ((t_next <= 0) && (cache_item_timeout_check > 0))
t_next = 1;
D("sleep for %isec...", t_next);
DBG("sleep for %isec...", t_next);
LKL(strshr_freeme_lock);
if (strshr_freeme_count > 0)
@ -1608,40 +1625,41 @@ main(int argc, char **argv)
cache_images = eina_list_remove(cache_images, img);
img->incache--;
cache_usage -= img->usage;
D("... IMG FREE %p", img);
DBG("... IMG FREE %p", img);
img_free(img);
}
cache_cleanme = 0;
}
LKU(cache_lock);
}
D("end loop...");
DBG("end loop...");
error:
D("cleanup...");
DBG("cleanup...");
if (stat_mem)
{
D("clean mem stat...");
DBG("clean mem stat...");
stat_clean(stat_mem);
}
D("signal shutdown...");
DBG("signal shutdown...");
signal_shutdown();
D("img shutdown...");
DBG("img shutdown...");
img_shutdown();
if (stat_mem)
{
D("free stat mem...");
DBG("free stat mem...");
evas_cserve_mem_free(stat_mem);
stat_mem = NULL;
}
if (s)
{
D("del server...");
DBG("del server...");
evas_cserve_server_del(s);
}
D("evas shutdown...");
DBG("evas shutdown...");
evas_shutdown();
D("eina shutdown...");
eina_log_domain_unregister(_evas_cserve_bin_log_dom);
DBG("eina shutdown...");
eina_shutdown();
D("exit..");
DBG("exit..");
return 0;
}

View File

@ -4,6 +4,8 @@
#include "evas_cs.h"
int _cserve_tool_log_dom = -1;
int
main(int argc, char **argv)
{

View File

@ -398,13 +398,13 @@ evas_event_feed_mouse_up(Evas *e, int b, Evas_Button_Flags flags, unsigned int t
if (e->pointer.mouse_grabbed < 0)
{
fprintf(stderr, "BUG? e->pointer.mouse_grabbed (=%d) < 0!\n",
e->pointer.mouse_grabbed);
ERROR("BUG? e->pointer.mouse_grabbed (=%d) < 0!",
e->pointer.mouse_grabbed);
}
if ((e->pointer.button == 0) && (e->pointer.mouse_grabbed != 0))
{
printf("restore to 0 grabs (from %i)\n", e->pointer.mouse_grabbed);
INFO("restore to 0 grabs (from %i)", e->pointer.mouse_grabbed);
e->pointer.mouse_grabbed = 0;
}
_evas_unwalk(e);

View File

@ -394,7 +394,7 @@ evas_font_load(Evas *evas, const char *name, const char *source, int size)
set = FcFontSort(NULL, p_nm, FcTrue, NULL, &res);
if (!set)
{
fprintf(stderr, "ERROR: no fontconfig font matches '%s'. It was the last resource, no font found!\n", name);
ERROR("No fontconfig font matches '%s'. It was the last resource, no font found!", name);
goto fc_end;
}

View File

@ -3,7 +3,7 @@
#include "evas_cs.h"
static int initcount = 0;
int _evas_log_dom_global = -1;
/**
* Initialize Evas
*
@ -22,6 +22,13 @@ evas_init(void)
{
if (!eina_init())
return 0;
_evas_log_dom_global = eina_log_domain_register("evas_main",EVAS_DEFAULT_LOG_COLOR);
if(_evas_log_dom_global < 0)
{
fprintf(stderr,"Error: Evas could not create a default log domain\n");
eina_shutdown();
return 0;
}
evas_module_init();
#ifdef BUILD_ASYNC_EVENTS
if (!evas_async_events_init())
@ -36,6 +43,7 @@ evas_init(void)
#ifdef BUILD_ASYNC_EVENTS
shutdown_module:
evas_module_shutdown();
eina_log_domain_unregister(_evas_log_dom_global);
eina_shutdown();
return 0;
@ -69,6 +77,7 @@ evas_shutdown(void)
evas_font_dir_cache_free();
evas_common_shutdown();
evas_module_shutdown();
eina_log_domain_unregister(_evas_log_dom_global);
eina_shutdown();
}
return initcount;
@ -477,7 +486,7 @@ evas_output_viewport_set(Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas
if (h <= 0) return;
if ((x != 0) || (y != 0))
{
printf("EVAS: compat error. viewport x,y != 0,0 not supported\n");
ERROR("EVAS: compat error. viewport x,y != 0,0 not supported");
x = 0;
y = 0;
}

View File

@ -32,8 +32,8 @@ struct _Evas_Object_Box_Accessor
EVAS_OBJECT_BOX_DATA_GET(o, ptr); \
if (!ptr) \
{ \
fprintf(stderr, "CRITICAL: no widget data for object %p (%s)\n", \
o, evas_object_type_get(o)); \
CRITICAL("no widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
fflush(stderr); \
abort(); \
return; \
@ -43,7 +43,7 @@ struct _Evas_Object_Box_Accessor
EVAS_OBJECT_BOX_DATA_GET(o, ptr); \
if (!ptr) \
{ \
fprintf(stderr, "CRITICAL: no widget data for object %p (%s)\n", \
CRITICAL("no widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
fflush(stderr); \
abort(); \
@ -355,7 +355,7 @@ _evas_object_box_remove_at_default(Evas_Object *o, Evas_Object_Box_Data *priv, u
node = eina_list_nth_list(priv->children, pos);
if (!node)
{
fprintf(stderr, "ERROR: no item to be removed at position %d\n", pos);
ERROR("ERROR: no item to be removed at position %d\n", pos);
return NULL;
}
@ -451,7 +451,7 @@ _evas_object_box_smart_calculate(Evas_Object *o)
if (priv->layout.cb)
priv->layout.cb(o, priv, priv->layout.data);
else
fprintf(stderr, "ERROR: no layout function set for %p box.\n", o);
ERROR("No layout function set for %p box.", o);
}
static Evas_Smart *

View File

@ -2496,9 +2496,8 @@ evas_object_image_render_pre(Evas_Object *obj)
if ((o->cur.fill.w < 1) || (o->cur.fill.h < 1))
{
fprintf(stderr,
"ERROR: evas image: %p has invalid fill size: %dx%d. Ignored\n",
obj, o->cur.fill.w, o->cur.fill.h);
ERROR("evas image: %p has invalid fill size: %dx%d. Ignored",
obj, o->cur.fill.w, o->cur.fill.h);
return;
}

View File

@ -174,20 +174,20 @@ evas_object_smart_member_add(Evas_Object *obj, Evas_Object *smart_obj)
if (obj->delete_me)
{
printf("EVAS ERROR: Adding deleted object %p to smart obj %p\n", obj, smart_obj);
ERROR("Adding deleted object %p to smart obj %p", obj, smart_obj);
abort();
return;
}
if (smart_obj->delete_me)
{
printf("EVAS ERROR: Adding object %p to deleted smart obj %p\n", obj, smart_obj);
ERROR("Adding object %p to deleted smart obj %p", obj, smart_obj);
abort();
return;
}
if (obj->layer && smart_obj->layer
&& obj->layer->evas != smart_obj->layer->evas)
{
printf("EVAS ERROR: Adding object %p from Evas (%p) from another Evas (%p)\n", obj, obj->layer->evas, smart_obj->layer->evas);
ERROR("EVAS ERROR: Adding object %p from Evas (%p) from another Evas (%p)", obj, obj->layer->evas, smart_obj->layer->evas);
abort();
return;
}

View File

@ -91,9 +91,8 @@ struct _Evas_Object_Table_Accessor
EVAS_OBJECT_TABLE_DATA_GET(o, ptr); \
if (!ptr) \
{ \
fprintf(stderr, "CRITICAL: no widget data for object %p (%s)\n", \
CRITICAL("CRITICAL: no widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
fflush(stderr); \
abort(); \
return; \
}
@ -102,9 +101,8 @@ struct _Evas_Object_Table_Accessor
EVAS_OBJECT_TABLE_DATA_GET(o, ptr); \
if (!ptr) \
{ \
fprintf(stderr, "CRITICAL: no widget data for object %p (%s)\n", \
CRITICAL("No widget data for object %p (%s)", \
o, evas_object_type_get(o)); \
fflush(stderr); \
abort(); \
return val; \
}
@ -170,9 +168,8 @@ _evas_object_table_cache_alloc(int cols, int rows)
cache = malloc(size);
if (!cache)
{
fprintf(stderr,
"ERROR: could not allocate table cache %dx%d (%d bytes): %s\n",
cols, rows, size, strerror(errno));
ERROR("Could not allocate table cache %dx%d (%d bytes): %s",
cols, rows, size, strerror(errno));
return NULL;
}
@ -319,8 +316,7 @@ _evas_object_table_calculate_cell(const Evas_Object_Table_Option *opt, Evas_Coor
/* } */
/* else if (min < 1) */
/* { */
/* fprintf(stderr, */
/* "WARNING: child %p [%s, %s] has no minimum width " */
/* WARN("Child %p [%s, %s] has no minimum width " */
/* "and no %s expand (weight is not > 0.0). " */
/* "Assuming weight > 0.0\n", */
/* child, evas_object_type_get(child), evas_object_name_get(child), */
@ -419,16 +415,14 @@ _evas_object_table_calculate_hints_homogeneous(Evas_Object *o, Evas_Object_Table
{
if (o_minw < 1)
{
fputs("ERROR: homogeneous table based on item size but no "
"horizontal mininum size specified! Using expand.\n",
stderr);
ERROR("homogeneous table based on item size but no "
"horizontal mininum size specified! Using expand.");
expand_h = 1;
}
if (o_minh < 1)
{
fputs("ERROR: homogeneous table based on item size but no "
"vertical mininum size specified! Using expand.\n",
stderr);
ERROR("homogeneous table based on item size but no "
"vertical mininum size specified! Using expand.");
expand_v = 1;
}
}
@ -730,9 +724,8 @@ _evas_object_table_calculate_layout_regular(Evas_Object *o, Evas_Object_Table_Da
cols = malloc(size);
if (!cols)
{
fprintf(stderr,
"ERROR: could not allocate temp columns (%d bytes): %s\n",
size, strerror(errno));
ERROR("Could not allocate temp columns (%d bytes): %s",
size, strerror(errno));
return;
}
memcpy(cols, c->sizes.h, size);
@ -754,8 +747,7 @@ _evas_object_table_calculate_layout_regular(Evas_Object *o, Evas_Object_Table_Da
rows = malloc(size);
if (!rows)
{
fprintf(stderr,
"ERROR: could not allocate temp rows (%d bytes): %s\n",
ERROR("could not allocate temp rows (%d bytes): %s",
size, strerror(errno));
goto end;
}
@ -812,7 +804,7 @@ _evas_object_table_smart_add(Evas_Object *o)
priv = calloc(1, sizeof(*priv));
if (!priv)
{
fputs("ERROR: could not allocate object private data.\n", stderr);
ERROR("could not allocate object private data.");
return;
}
evas_object_smart_data_set(o, priv);
@ -870,8 +862,8 @@ _evas_object_table_smart_calculate(Evas_Object *o)
if ((priv->size.cols < 1) || (priv->size.rows < 1))
{
fprintf(stderr, "DBG: nothing to do: cols=%d, rows=%d\n",
priv->size.cols, priv->size.rows);
DEBUG("Nothing to do: cols=%d, rows=%d",
priv->size.cols, priv->size.rows);
return;
}
@ -1103,27 +1095,26 @@ evas_object_table_pack(Evas_Object *o, Evas_Object *child, unsigned short col, u
if (rowspan < 1)
{
fputs("ERROR: rowspan < 1\n", stderr);
ERROR("rowspan < 1");
return EINA_FALSE;
}
if (colspan < 1)
{
fputs("ERROR: colspan < 1\n", stderr);
ERROR("colspan < 1");
return EINA_FALSE;
}
opt = _evas_object_table_option_get(child);
if (opt)
{
fputs("ERROR: cannot add object that is already part of a table!\n",
stderr);
ERROR("cannot add object that is already part of a table!");
return EINA_FALSE;
}
opt = malloc(sizeof(*opt));
if (!opt)
{
fputs("ERROR: could not allocate table option data.\n", stderr);
ERROR("could not allocate table option data.");
return EINA_FALSE;
}
@ -1226,14 +1217,14 @@ evas_object_table_unpack(Evas_Object *o, Evas_Object *child)
if (o != evas_object_smart_parent_get(child))
{
fputs("ERROR: cannot unpack child from incorrect table!\n", stderr);
ERROR("cannot unpack child from incorrect table!");
return EINA_FALSE;
}
opt = _evas_object_table_option_del(child);
if (!opt)
{
fputs("ERROR: cannot unpack child with no packing option!\n", stderr);
ERROR("cannot unpack child with no packing option!");
return EINA_FALSE;
}

View File

@ -404,7 +404,7 @@ evas_render_updates_internal(Evas *e, unsigned char make_updates, unsigned char
}
if ((e->output.w != e->viewport.w) || (e->output.h != e->viewport.h))
{
printf("EVAS: error: viewport size != output size!\n");
ERROR("viewport size != output size!");
}
/* phase 5. add obscures */
EINA_LIST_FOREACH(e->obscures, ll, r)

View File

@ -65,8 +65,8 @@ evas_smart_new(const char *name,
Evas_Smart *s;
Evas_Smart_Class *sc;
printf("----- WARNING. evas_smart_new() will be deprecated and removed soon\n"
"----- Please use evas_smart_class_new() instead\n");
WARN("----- WARNING. evas_smart_new() will be deprecated and removed soon"
"----- Please use evas_smart_class_new() instead");
if (!name) return NULL;

View File

@ -187,7 +187,7 @@ evas_object_stack_above(Evas_Object *obj, Evas_Object *above)
{
if (obj->smart.parent != above->smart.parent)
{
// printf("BITCH! evas_object_stack_above(), %p not inside same smart as %p!\n", obj, above);
// ERROR("BITCH! evas_object_stack_above(), %p not inside same smart as %p!", obj, above);
return;
}
evas_object_smart_member_stack_above(obj, above);
@ -275,7 +275,7 @@ evas_object_stack_below(Evas_Object *obj, Evas_Object *below)
{
if (obj->smart.parent != below->smart.parent)
{
// printf("BITCH! evas_object_stack_below(), %p not inside same smart as %p!\n", obj, below);
// ERROR("BITCH! evas_object_stack_below(), %p not inside same smart as %p!", obj, below);
return;
}
evas_object_smart_member_stack_below(obj, below);

View File

@ -145,8 +145,8 @@ server_read(Server *s, int channel, int *opcode, int *size)
if ((*size < 0) || (*size > (1024 * 1024))) return NULL;
if (ints[2] != (s->ch[channel].req_from + 1))
{
printf("EEK! sequence number mismatch from serer with pid: %i\n"
"---- num %i is not 1 more than %i\n"
ERROR("EEK! sequence number mismatch from serer with pid: %i\n"
"---- num %i is not 1 more than %i"
,
s->pid, ints[2], s->ch[channel].req_from);
return NULL;

View File

@ -225,8 +225,8 @@ server_parse(Server *s, Client *c)
data = c->inbuf + (sizeof(int) * 3);
if (ints[2] != (c->req_from + 1))
{
printf("EEK! sequence number mismatch from client with pid: %i\n"
"---- num %i is not 1 more than %i\n"
ERROR("EEK! sequence number mismatch from client with pid: %i\n"
"---- num %i is not 1 more than %i"
,
c->pid, ints[2], c->req_from);
return 0;

View File

@ -591,7 +591,7 @@ evas_common_convert_func_get(DATA8 *dest, int w, int h, int depth, DATA32 rmask,
}
#endif
}
printf("depth = %i mode = %i\n", depth, pal_mode);
INFO("depth = %i mode = %i", depth, pal_mode);
if (depth == 8)
{
#ifdef BUILD_CONVERT_8_RGB_332

View File

@ -715,7 +715,7 @@ evas_common_convert_rgba_to_16bpp_bgr_565_dith_rot_180 (DATA32 *src, DATA8 *dst,
dst_ptr = (DATA16 *)dst;
fprintf(stderr, "evas_common_convert_rgba_to_16bpp_bgr_565_dith_rot_180\n");
ERROR("evas_common_convert_rgba_to_16bpp_bgr_565_dith_rot_180");
CONVERT_LOOP_START_ROT_180();

View File

@ -3,7 +3,6 @@
*/
#include "evas_common.h"
#if defined BUILD_MMX || defined BUILD_SSE
#include "evas_mmx.h"
#endif
@ -222,7 +221,7 @@ evas_common_cpu_can_do(int *mmx, int *sse, int *sse2)
if (cpu_feature_mask & CPU_FEATURE_MMX2) do_sse = 1;
if (cpu_feature_mask & CPU_FEATURE_SSE) do_sse = 1;
}
// printf("%i %i %i\n", do_mmx, do_sse, do_sse2);
// INFO("%i %i %i", do_mmx, do_sse, do_sse2);
*mmx = do_mmx;
*sse = do_sse;
*sse2 = do_sse2;

View File

@ -8,6 +8,7 @@
#include "evas_common.h"
#include "evas_private.h"
#include "evas_blend_private.h"
#include "evas_intl_utils.h" /*defines INTERNATIONAL_SUPPORT if possible */

View File

@ -3,7 +3,7 @@
*/
#include "evas_common.h"
#include "evas_private.h"
FT_Library evas_ft_lib = 0;
static int initialised = 0;

View File

@ -147,11 +147,11 @@ evas_common_font_query_inset(RGBA_Font *fn, const char *text)
fg = evas_common_font_int_cache_glyph_get(fi, index);
if (!fg) return 0;
/*
printf("fg->glyph_out->left = %i\n"
INFO("fg->glyph_out->left = %i\n"
"fi->src->ft.face->glyph->bitmap_left = %i\n"
"fi->src->ft.face->glyph->metrics.horiBearingX = %i\n"
"fi->src->ft.face->glyph->metrics.horiBearingY = %i\n"
"fi->src->ft.face->glyph->metrics.horiAdvance = %i\n"
"fi->src->ft.face->glyph->metrics.horiAdvance = %i"
,
(int)fg->glyph_out->left,
(int)fi->src->ft.face->glyph->bitmap_left,

View File

@ -53,7 +53,7 @@ static int _evas_common_rgba_image_dirty(Image_Entry* dst, const I
static void
_evas_common_rgba_image_debug(const char* context, Image_Entry *eim)
{
fprintf(stderr, "%p = [%s] {%s,%s} %i [%i|%i]\n", eim, context, eim->file, eim->key, eim->references, eim->w, eim->h);
DEBUG("%p = [%s] {%s,%s} %i [%i|%i]", eim, context, eim->file, eim->key, eim->references, eim->w, eim->h);
}
static const Evas_Cache_Image_Func _evas_common_image_func =
@ -83,7 +83,7 @@ evas_common_image_init(void)
if (!eci)
eci = evas_cache_image_init(&_evas_common_image_func);
reference++;
//// printf("REF++=%i\n", reference);
//// ERROR("REF++=%i", reference);
#ifdef BUILD_LOADER_EET
eet_init();

View File

@ -118,7 +118,7 @@ evas_common_rgba_image_scalecache_dirty(Image_Entry *ie)
im->cache.list = eina_list_remove(im->cache.list, sci);
if (sci->im)
{
// printf(" 0- %i\n", sci->dst_w * sci->dst_h * 4);
// INFO(" 0- %i", sci->dst_w * sci->dst_h * 4);
LKL(cache_lock);
evas_common_rgba_image_free(&sci->im->cache_entry);
if (!sci->forced_unload)
@ -185,7 +185,7 @@ _sci_fix_newest(RGBA_Image *im)
if (sci->usage_count > im->cache.newest_usage_count)
im->cache.newest_usage_count = sci->usage_count;
}
// printf("_sci_fix_newest! -> %i\n", im->cache.newest_usage);
// INFO("_sci_fix_newest! -> %i", im->cache.newest_usage);
}
static Scaleitem *
@ -233,7 +233,7 @@ _sci_find(RGBA_Image *im,
cache_size -= sci->dst_w * sci->dst_h * 4;
else
cache_size -= sci->size_adjust;
// printf(" 1- %i\n", sci->dst_w * sci->dst_h * 4);
// INFO(" 1- %i", sci->dst_w * sci->dst_h * 4);
cache_list = eina_inlist_remove(cache_list, (Eina_Inlist *)sci);
}
if (max_scale_items < 1) return NULL;
@ -291,11 +291,11 @@ _cache_prune(Scaleitem *notsci, Eina_Bool copies_only)
cache_size -= sci->dst_w * sci->dst_h * 4;
else
cache_size -= sci->size_adjust;
// printf(" 2- %i\n", sci->dst_w * sci->dst_h * 4);
// INFO(" 2- %i", sci->dst_w * sci->dst_h * 4);
cache_list = eina_inlist_remove(cache_list, (Eina_Inlist *)sci);
memset(sci, 0, sizeof(Eina_Inlist));
}
// printf("FLUSH %i > %i\n", cache_size, max_cache_size);
// INFO("FLUSH %i > %i", cache_size, max_cache_size);
}
}
#endif
@ -385,7 +385,7 @@ evas_common_rgba_image_scalecache_prepare(Image_Entry *ie, RGBA_Image *dst,
LKU(im->cache.lock);
return;
}
// printf("%10i | %4i %4i %4ix%4i -> %4i %4i %4ix%4i | %i\n",
// INFO("%10i | %4i %4i %4ix%4i -> %4i %4i %4ix%4i | %i",
// (int)use_counter,
// src_region_x, src_region_y, src_region_w, src_region_h,
// dst_region_x, dst_region_y, dst_region_w, dst_region_h,
@ -413,12 +413,12 @@ evas_common_rgba_image_scalecache_prepare(Image_Entry *ie, RGBA_Image *dst,
LKU(cache_lock);
if (sci->usage > im->cache.newest_usage)
im->cache.newest_usage = sci->usage;
// printf("newset? %p %i > %i\n", im,
// INFO("newset? %p %i > %i", im,
// (int)sci->usage,
// (int)im->cache.newest_usage);
if (sci->usage_count > im->cache.newest_usage_count)
im->cache.newest_usage_count = sci->usage_count;
// printf(" -------------- used %8i#, %8i@\n", (int)sci->usage, (int)sci->usage_count);
// INFO(" -------------- used %8i#, %8i@", (int)sci->usage, (int)sci->usage_count);
LKU(im->cache.lock);
#endif
}
@ -449,7 +449,7 @@ evas_common_rgba_image_scalecache_do(Image_Entry *ie, RGBA_Image *dst,
i++;
if (i > 2000)
{
printf("p: %6i, h: %6i, m: %6i, n: %6i\n",
INFO("p: %6i, h: %6i, m: %6i, n: %6i",
pops, hits, misses, noscales);
i = 0;
}
@ -552,7 +552,7 @@ evas_common_rgba_image_scalecache_do(Image_Entry *ie, RGBA_Image *dst,
}
if (sci->populate_me)
{
// printf("##! populate!\n");
// INFO("##! populate!");
sci->im = evas_common_image_new
(dst_region_w, dst_region_h, im->cache_entry.flags.alpha);
if (sci->im)
@ -625,7 +625,7 @@ evas_common_rgba_image_scalecache_do(Image_Entry *ie, RGBA_Image *dst,
{
cache_size += sci->dst_w * sci->dst_h * 4;
}
// printf(" + %i @ flop: %i (%ix%i)\n",
// INFO(" + %i @ flop: %i (%ix%i)",
// sci->dst_w * sci->dst_h * 4, sci->flop,
// sci->dst_w, sci->dst_h);
cache_list = eina_inlist_append(cache_list, (Eina_Inlist *)sci);
@ -645,7 +645,7 @@ evas_common_rgba_image_scalecache_do(Image_Entry *ie, RGBA_Image *dst,
{
if (sci->flop > 0) sci->flop -= FLOP_DEL;
}
// printf("use cached!\n");
// INFO("use cached!");
evas_common_scale_rgba_in_to_out_clip_sample
(sci->im, dst, dc,
0, 0,
@ -653,7 +653,7 @@ evas_common_rgba_image_scalecache_do(Image_Entry *ie, RGBA_Image *dst,
dst_region_x, dst_region_y,
dst_region_w, dst_region_h);
// hits++;
// printf("check %p %i < %i\n",
// INFO("check %p %i < %i",
// im,
// (int)im->cache.orig_usage,
// (int)im->cache.newest_usage);

View File

@ -3,7 +3,6 @@
*/
#include "evas_common.h"
static RGBA_Gfx_Func op_add_span_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
static RGBA_Gfx_Pt_Func op_add_pt_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];

View File

@ -73,7 +73,7 @@ evas_common_pipe_thread(void *data)
{
Thinfo *thinfo;
// printf("TH [...........\n");
// INFO("TH [...........");
thinfo = data;
for (;;)
{
@ -81,13 +81,13 @@ evas_common_pipe_thread(void *data)
RGBA_Pipe *p;
/* wait for start signal */
// printf(" TH %i START...\n", thinfo->thread_num);
// INFO(" TH %i START...", thinfo->thread_num);
pthread_barrier_wait(&(thinfo->barrier[0]));
info = thinfo->info;
// if (info)
// {
// thinfo->info = NULL;
// printf(" TH %i GO\n", thinfo->thread_num);
// INFO(" TH %i GO", thinfo->thread_num);
EINA_INLIST_FOREACH(EINA_INLIST_GET(info->im->pipe), p)
{
int i;
@ -100,7 +100,7 @@ evas_common_pipe_thread(void *data)
}
free(info);
// }
// printf(" TH %i DONE\n", thinfo->thread_num);
// INFO(" TH %i DONE", thinfo->thread_num);
/* send finished signal */
pthread_barrier_wait(&(thinfo->barrier[1]));
}

View File

@ -1,5 +1,4 @@
#include "evas_common.h"
#ifdef EVAS_RECT_SPLIT
static const list_node_t list_node_zeroed = { NULL };
@ -95,7 +94,7 @@ rect_init(rect_t *r, int x, int y, int w, int h)
void
rect_print(const rect_t r)
{
printf("<rect(%d, %d, %d, %d)>", r.left, r.top, r.width, r.height);
INFO("<rect(%d, %d, %d, %d)>", r.left, r.top, r.width, r.height);
}
void
@ -107,7 +106,7 @@ rect_list_print(const list_t rects)
len = 0;
for (node = rects.head; node != NULL; node = node->next) len++;
printf("[");
putchar('[');
for (node = rects.head; node != NULL; node = node->next)
{
rect_print(((rect_node_t *)node)->rect);
@ -122,7 +121,7 @@ rect_list_print(const list_t rects)
}
}
}
printf("]\n");
putchar(']');
}
inline void
@ -717,7 +716,7 @@ rect_list_add_split_fuzzy(list_t *rects, list_node_t *node, int accepted_error)
*/
/* prev_cur_node = cur_node; */
/* cur_node = cur_node->next; */
printf("Should not get here!\n");
WARN("Should not get here!");
abort();
}
@ -920,7 +919,7 @@ _add_redraw(list_t *rects, int max_w, int max_h, int x, int y, int w, int h)
rn = (rect_node_t *)rect_list_node_pool_get();
rn->_lst = list_node_zeroed;
rect_init(&rn->rect, x, y, w, h);
//fprintf(stderr, "ACCOUNTING: add_redraw: %4d,%4d %3dx%3d\n", x, y, w, h);
//INFO(stderr, "ACCOUNTING: add_redraw: %4d,%4d %3dx%3d", x, y, w, h);
//testing on my core2 duo desktop - fuzz of 32 or 48 is best.
#define FUZZ 32
rect_list_add_split_fuzzy_and_merge(rects, (list_node_t *)rn,
@ -1008,7 +1007,7 @@ evas_common_tilebuf_del_redraw(Tilebuf *tb, int x, int y, int w, int h)
if ((w <= 0) || (h <= 0)) return 0;
rect_init(&r, x, y, w, h);
//fprintf(stderr, "ACCOUNTING: del_redraw: %4d,%4d %3dx%3d\n", x, y, w, h);
//ERROR("ACCOUNTING: del_redraw: %4d,%4d %3dx%3d", x, y, w, h);
rect_list_del_split_strict(&tb->rects, r);
tb->need_merge = 1;

View File

@ -101,9 +101,8 @@ _soft16_image_draw_scaled_no_mul(Soft16_Image *src, Soft16_Image *dst,
_soft16_image_draw_scaled_solid_solid
(src, dst, dc, dst_offset, w, h, offset_x, offset_y);
else
fprintf(stderr,
"Unsupported draw of scaled images src->cache_entry.flags.alpha=%d, "
"dst->cache_entry.flags.alpha=%d, WITHOUT COLOR MUL\n",
ERROR("Unsupported draw of scaled images src->cache_entry.flags.alpha=%d, "
"dst->cache_entry.flags.alpha=%d, WITHOUT COLOR MUL",
src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha);
}
@ -214,10 +213,9 @@ _soft16_image_draw_scaled_mul_alpha(Soft16_Image *src, Soft16_Image *dst,
_soft16_image_draw_scaled_solid_solid_mul_alpha
(src, dst, dc, dst_offset, w, h, offset_x, offset_y, a);
else
fprintf(stderr,
"Unsupported draw of scaled images src->cache_entry.flags.alpha=%d, "
"dst->cache_entry.flags.alpha=%d, WITH ALPHA MUL %d\n",
src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha, A_VAL(&dc->mul.col));
ERROR("Unsupported draw of scaled images src->cache_entry.flags.alpha=%d, "
"dst->cache_entry.flags.alpha=%d, WITH ALPHA MUL %d",
src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha, A_VAL(&dc->mul.col));
}
static void
@ -397,9 +395,8 @@ _soft16_image_draw_scaled_mul_color(Soft16_Image *src, Soft16_Image *dst,
_soft16_image_draw_scaled_solid_solid_mul_color
(src, dst, dc, dst_offset, w, h, offset_x, offset_y, r, g, b, a);
else
fprintf(stderr,
"Unsupported draw of scaled images src->cache_entry.flags.alpha=%d, "
"dst->cache_entry.flags.alpha=%d, WITH COLOR MUL 0x%08x\n",
ERROR("Unsupported draw of scaled images src->cache_entry.flags.alpha=%d, "
"dst->cache_entry.flags.alpha=%d, WITH COLOR MUL 0x%08x",
src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha, dc->mul.col);
}

View File

@ -60,9 +60,8 @@ _soft16_image_draw_unscaled_no_mul(Soft16_Image *src, Soft16_Image *dst,
src_offset, dst_offset,
width, height);
else
fprintf(stderr,
"Unsupported draw of unscaled images src->cache_entry.flags.alpha=%d, "
"dst->cache_entry.flags.alpha=%d, WITHOUT COLOR MUL\n",
ERROR("Unsupported draw of unscaled images src->cache_entry.flags.alpha=%d, "
"dst->cache_entry.flags.alpha=%d, WITHOUT COLOR MUL",
src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha);
}
@ -128,9 +127,8 @@ _soft16_image_draw_unscaled_mul_alpha(Soft16_Image *src, Soft16_Image *dst,
_soft16_image_draw_unscaled_solid_solid_mul_alpha
(src, dst, dc, src_offset, dst_offset, width, height, a);
else
fprintf(stderr,
"Unsupported draw of unscaled images src->cache_entry.flags.alpha=%d, "
"dst->cache_entry.flags.alpha=%d, WITH ALPHA MUL %d\n",
ERROR("Unsupported draw of unscaled images src->cache_entry.flags.alpha=%d, "
"dst->cache_entry.flags.alpha=%d, WITH ALPHA MUL %d",
src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha, A_VAL(&dc->mul.col));
}
@ -219,9 +217,8 @@ _soft16_image_draw_unscaled_mul_color(Soft16_Image *src, Soft16_Image *dst,
_soft16_image_draw_unscaled_solid_solid_mul_color
(src, dst, dc, src_offset, dst_offset, width, height, r, g, b, a);
else
fprintf(stderr,
"Unsupported draw of unscaled images src->cache_entry.flags.alpha=%d, "
"dst->cache_entry.flags.alpha=%d, WITH COLOR MUL 0x%08x\n",
ERROR("Unsupported draw of unscaled images src->cache_entry.flags.alpha=%d, "
"dst->cache_entry.flags.alpha=%d, WITH COLOR MUL 0x%08x",
src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha, dc->mul.col);
}

View File

@ -28,7 +28,7 @@ static int _evas_common_load_soft16_image_data_from_file(Image_Ent
/* static void */
/* _evas_common_soft16_image_debug(const char* context, Image_Entry *eim) */
/* { */
/* fprintf(stderr, "[16] %p = [%s] {%s,%s} %i [%i|%i]\n", eim, context, eim->file, eim->key, eim->references, eim->w, eim->h); */
/* DEBUG("[16] %p = [%s] {%s,%s} %i [%i|%i]", eim, context, eim->file, eim->key, eim->references, eim->w, eim->h); */
/* } */
static const Evas_Cache_Image_Func _evas_common_soft16_image_func =

View File

@ -71,9 +71,7 @@ _soft16_rectangle_draw_int(Soft16_Image *dst, RGBA_Draw_Context *dc,
(dst, dst_offset, dr.w, dr.h, rgb565, alpha);
}
else
fprintf(stderr,
"Unsupported feature: drawing rectangle to non-opaque "
"destination.\n");
ERROR("Unsupported feature: drawing rectangle to non-opaque destination.");
}
void

View File

@ -12,6 +12,64 @@
#include <Eina.h>
#include "Evas.h"
/* macros needed to log message through eina_log */
extern int _evas_log_dom_global;
#ifdef _EVAS_DEFAULT_MODULE_LOG_DOM
#undef _EVAS_DEFAULT_MODULE_LOG_DOM
#endif
#define _EVAS_DEFAULT_MODULE_LOG_DOM _evas_log_dom_global
#ifdef EVAS_DEFAULT_LOG_COLOR
#undef EVAS_DEFAULT_LOG_COLOR
#endif
#define EVAS_DEFAULT_LOG_COLOR "\033[36m"
#ifdef ERROR
#undef ERROR
#endif
#define ERROR(...) EINA_LOG_DOM_ERR(_evas_log_dom_global, __VA_ARGS__)
#ifdef DEBUG
#undef DEBUG
#endif
#define DEBUG(...) EINA_LOG_DOM_DBG(_evas_log_dom_global, __VA_ARGS__)
#ifdef INFO
#undef INFO
#endif
#define INFO(...) EINA_LOG_DOM_INFO(_evas_log_dom_global, __VA_ARGS__)
#ifdef WARN
#undef WARN
#endif
#define WARN(...) EINA_LOG_DOM_WARN(_evas_log_dom_global, __VA_ARGS__)
#ifdef CRITICAL
#undef CRITICAL
#endif
#define CRITICAL(...) EINA_LOG_DOM_CRIT(_evas_log_dom_global, __VA_ARGS__)
/**
* macros that are used all around the code for message processing
* four macros are defined ERR, WRN, DGB, INF.
* EFREET_MODULE_LOG_DOM should be defined individually for each module
*/
#ifdef ERR
#undef ERR
#endif
#define ERR(...) EINA_LOG_DOM_ERR(_EVAS_DEFAULT_MODULE_LOG_DOM, __VA_ARGS__)
#ifdef DBG
#undef DBG
#endif
#define DBG(...) EINA_LOG_DOM_DBG(_EVAS_DEFAULT_MODULE_LOG_DOM, __VA_ARGS__)
#ifdef INF
#undef INF
#endif
#define INF(...) EINA_LOG_DOM_INFO(_EVAS_DEFAULT__MODULE_LOG_DOM, __VA_ARGS__)
#ifdef WRN
#undef WRN
#endif
#define WRN(...) EINA_LOG_DOM_WARN(_EVAS_DEFAULT_MODULE_LOG_DOM, __VA_ARGS__)
#ifdef CRIT
#undef CRIT
#endif
#define CRIT(...) EINA_LOG_DOM_CRIT(_EVAS_DEFAULT_MODULE_LOG_DOM, __VA_ARGS__)
/*****************************************************************************/
#include "evas_options.h"
@ -1156,5 +1214,4 @@ void evas_font_dir_cache_free(void);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -101,8 +101,7 @@ evas_debug_error(void)
_evas_debug_init = 1;
}
if (_evas_debug_show)
fprintf(stderr,
"*** EVAS ERROR: Evas Magic Check Failed!!!\n");
DEBUG("*** EVAS ERROR: Evas Magic Check Failed!!!");
}
void
@ -115,8 +114,7 @@ evas_debug_input_null(void)
_evas_debug_init = 1;
}
if (_evas_debug_show)
fprintf(stderr,
" Input object pointer is NULL!\n");
DEBUG("Input object pointer is NULL!");
if (_evas_debug_abort) abort();
}
@ -130,8 +128,7 @@ evas_debug_magic_null(void)
_evas_debug_init = 1;
}
if (_evas_debug_show)
fprintf(stderr,
" Input object is zero'ed out (maybe a freed object or zero-filled RAM)!\n");
DEBUG("Input object is zero'ed out (maybe a freed object or zero-filled RAM)!");
if (_evas_debug_abort) abort();
}
@ -145,12 +142,11 @@ evas_debug_magic_wrong(DATA32 expected, DATA32 supplied)
_evas_debug_init = 1;
}
if (_evas_debug_show)
fprintf(stderr,
" Input object is wrong type\n"
" Expected: %08x - %s\n"
" Supplied: %08x - %s\n",
expected, evas_debug_magic_string_get(expected),
supplied, evas_debug_magic_string_get(supplied));
DEBUG(" Input object is wrong type\n"
" Expected: %08x - %s\n"
" Supplied: %08x - %s",
expected, evas_debug_magic_string_get(expected),
supplied, evas_debug_magic_string_get(supplied));
if (_evas_debug_abort) abort();
}
@ -164,9 +160,8 @@ evas_debug_generic(const char *str)
_evas_debug_init = 1;
}
if (_evas_debug_show)
fprintf(stderr,
"*** EVAS ERROR:\n"
"%s", (char *)str);
DEBUG("*** EVAS ERROR:\n"
"%s", (char *)str);
if (_evas_debug_abort) abort();
}

View File

@ -257,7 +257,7 @@ eng_info(Evas *e)
info = calloc(1, sizeof(Evas_Engine_Info_Cairo_X11));
if (!info) return NULL;
info->magic.magic = rand();
printf("CAIRO: create info...\n");
INFO("CAIRO: create info...");
return info;
e = NULL;
}
@ -278,7 +278,7 @@ eng_setup(Evas *e, void *in)
Evas_Engine_Info_Cairo_X11 *info;
info = (Evas_Engine_Info_Cairo_X11 *)in;
printf("CAIRO: setup info...\n");
INFO("CAIRO: setup info...");
if (!e->engine.data.output)
e->engine.data.output =
eng_output_setup(e->output.w,
@ -314,7 +314,7 @@ eng_output_setup(int w, int h, Display *disp, Drawable draw, Visual *vis, Colorm
free(re);
return NULL;
}
printf("CAIRO: cairo window setup done.\n");
INFO("CAIRO: cairo window setup done.");
evas_common_cpu_init();
evas_common_blend_init();

View File

@ -22,7 +22,7 @@ extern "C" {
//#define ENABLE_LOG_PRINTF
#ifdef ENABLE_LOG_PRINTF
#define Log(str, ...) printf("D3D "str"\n", __VA_ARGS__)
#define Log(str, ...) INFO("D3D "str, __VA_ARGS__)
#else
#define Log(str, ...)
#endif

View File

@ -69,8 +69,8 @@ _dfb_surface_clear(IDirectFBSurface *surface, int x, int y, int w, int h)
return;
error:
fprintf(stderr, "ERROR: could not clear surface: %s\n",
DirectFBErrorString(r));
ERROR("DirectFB: could not clear surface: %s",
DirectFBErrorString(r));
}
static void
@ -93,7 +93,7 @@ _image_autoset_alpha(DirectFB_Engine_Image_Entry *image)
r = surface->GetPixelFormat(surface, &fmt);
if (r != DFB_OK)
{
fprintf(stderr, "ERROR: could not get pixel format: %s\n",
ERROR("DirectFB: could not get pixel format: %s",
DirectFBErrorString(r));
return;
}
@ -114,8 +114,8 @@ _dfb_surface_update(IDirectFBSurface *surface, int x, int y, int w, int h)
cr.y2 = y + h - 1;
r = surface->Flip(surface, &cr, DSFLIP_NONE);
if (r != DFB_OK)
fprintf(stderr, "ERROR: could not update surface: %s\n",
DirectFBErrorString(r));
WARN("DirectFB: could not update surface: %s",
DirectFBErrorString(r));
}
static IDirectFBSurface *
@ -138,7 +138,7 @@ _dfb_surface_from_data(IDirectFB *dfb, int w, int h, void *data)
r = dfb->CreateSurface(dfb, &desc, &s);
if (r != DFB_OK)
{
fprintf(stderr, "ERROR: cannot create DirectFB surface: %s\n",
ERROR("DirectFB: cannot create DirectFB surface: %s",
DirectFBErrorString(r));
return NULL;
}
@ -165,14 +165,14 @@ _dfb_blit_accel_caps_print(IDirectFBSurface *dst, IDirectFBSurface *src)
r = dst->GetAccelerationMask(dst, src, &mask);
if (r != DFB_OK)
{
fprintf(stderr, "ERROR: Could not retrieve acceleration mask: %s\n",
ERROR("DirectFB: Could not retrieve acceleration mask: %s",
DirectFBErrorString(r));
return;
}
fputs("Acceleration: ", stderr);
DEBUG("Acceleration: ");
#define O(m) if (mask & m) fputs(#m " ", stderr)
#define O(m) if (mask & m) DEBUG(#m " ")
O(DFXL_FILLRECTANGLE);
O(DFXL_DRAWRECTANGLE);
O(DFXL_DRAWLINE);
@ -183,8 +183,7 @@ _dfb_blit_accel_caps_print(IDirectFBSurface *dst, IDirectFBSurface *src)
O(DFXL_DRAWSTRING);
#undef O
if (mask == DFXL_NONE) fputs("<NONE>", stderr);
fputc('\n', stderr);
if (mask == DFXL_NONE) DEBUG("<NONE>");
#endif /* DFB_DEBUG_ACCELERATION */
}
@ -300,14 +299,14 @@ _dfb_surface_set_color_from_context(IDirectFBSurface *surface, RGBA_Draw_Context
goto error;
#ifdef DFB_DEBUG_FLAGS
printf("DRAW: color=%d %d %d %d, flags=%s\n",
DEBUG("DirectFB DRAW: color=%d %d %d %d, flags=%s",
r, g, b, a, _dfb_draw_flags_str(flags));
#endif /* DFB_DEBUG_FLAGS */
return 1;
error:
fprintf(stderr, "ERROR: could not set color from context: %s\n",
ERROR("DirectFB: could not set color from context: %s",
DirectFBErrorString(res));
return 0;
}
@ -354,7 +353,7 @@ _dfb_surface_set_blit_params(DirectFB_Engine_Image_Entry *d, DirectFB_Engine_Ima
goto error;
#ifdef DFB_DEBUG_FLAGS
printf("BLIT: sfunc=%s, dfunc=%s, color=%d %d %d %d\n\tblit=%s\n\tdraw=%s\n",
DEBUG("DirectFB BLIT: sfunc=%s, dfunc=%s, color=%d %d %d %d\n\tblit=%s\n\tdraw=%s",
_dfb_blend_func_str(src_func), _dfb_blend_func_str(dst_func),
r, g, b, a,
_dfb_blit_flags_str(blit_flags), _dfb_draw_flags_str(draw_flags));
@ -363,8 +362,8 @@ _dfb_surface_set_blit_params(DirectFB_Engine_Image_Entry *d, DirectFB_Engine_Ima
return 1;
error:
fprintf(stderr, "ERROR: Could not set blit params: %s\n",
DirectFBErrorString(res));
ERROR("DirectFB: Could not set blit params: %s",
DirectFBErrorString(res));
return 0;
}
@ -386,9 +385,8 @@ _dfb_lock_and_sync_image(IDirectFBSurface *surface, RGBA_Image *image, DFBSurfac
if (pitch != (sw * 4))
{
/* XXX TODO: support other pixel formats. */
fprintf(stderr,
"ERROR: IDirectFBSurface pitch(%d) is not supported: "
"should be %d.\n",
ERROR("DirectFB: IDirectFBSurface pitch(%d) is not supported: "
"should be %d.",
pitch, sw * 4);
surface->Unlock(surface);
return 0;
@ -613,7 +611,7 @@ evas_cache_image_dfb_mem_size_get(Engine_Image_Entry *eie)
r = deie->surface->GetSize(deie->surface, &w, &h);
if (r != DFB_OK)
{
fprintf(stderr, "ERROR: Could not get surface size: %s\n",
ERROR("DirectFB: Could not get surface size: %s",
DirectFBErrorString(r));
return size;
}
@ -629,22 +627,20 @@ evas_cache_image_dfb_debug(const char *context, Engine_Image_Entry* eie)
{
DirectFB_Engine_Image_Entry *eim = (DirectFB_Engine_Image_Entry *)eie;
fprintf(stderr, "*** %s image (%p) ***\n", context, eim);
DEBUG("*** %s image (%p) ***", context, eim);
if (eim)
{
fprintf(stderr,
"* W: %d\n"
DEBUG("* W: %d\n"
"* H: %d\n"
"* R: %d\n"
"* Key: %s\n"
"* DFB Surface: %p\n",
"* DFB Surface: %p",
eie->w, eie->h, eie->references, eie->cache_key, eim->surface);
if (eie->src)
fprintf(stderr,
"* Pixels: %p\n", ((RGBA_Image*) eie->src)->image.data);
DEBUG("* Pixels: %p", ((RGBA_Image*) eie->src)->image.data);
}
fputs("*** ***\n", stderr);
DEBUG("*** ***");
}
#endif
@ -701,29 +697,28 @@ _is_dfb_data_ok(IDirectFB *idfb, IDirectFBSurface *surface, int w, int h)
if (!idfb)
{
fputs("ERROR: missing IDirectFB\n", stderr);
ERROR("missing IDirectFB");
return EINA_FALSE;
}
dfb = idfb;
if (!surface)
{
fputs("ERROR: missing IDirectFBSurface\n", stderr);
ERROR("missing IDirectFBSurface");
return EINA_FALSE;
}
r = surface->GetSize(surface, &sw, &sh);
if (r != DFB_OK)
{
fprintf(stderr, "ERROR: could not get surface %p size: %s\n",
surface, DirectFBErrorString(r));
ERROR("DirectFB: could not get surface %p size: %s",
surface, DirectFBErrorString(r));
return EINA_FALSE;
}
if ((w > sw) || (h > sh))
{
fprintf(stderr,
"ERROR: requested size is larger than surface: %dx%d > %dx%d\n",
ERROR("DirectFB: requested size is larger than surface: %dx%d > %dx%d",
w, h, sw, sh);
return EINA_FALSE;
}
@ -750,7 +745,7 @@ _evas_common_init(void)
evas_common_line_init();
evas_common_font_init();
evas_common_draw_init();
evas_common_tilebuf_init();
evas_common_tilebuf_init();
}
static int
@ -765,7 +760,7 @@ evas_engine_dfb_output_reconfigure(Render_Engine *re, int w, int h)
re->tb = evas_common_tilebuf_new(w, h);
if (!re->tb)
{
fputs("ERROR: could not allocate tile buffer.\n", stderr);
ERROR("DirectFB: could not allocate tile buffer.");
goto failed_tilebuf;
}
evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE);
@ -778,7 +773,7 @@ evas_engine_dfb_output_reconfigure(Render_Engine *re, int w, int h)
evas_cache_engine_image_engine(re->cache, re->spec->surface);
if (!re->screen_image)
{
fputs("ERROR: RGBA_Image allocation from DFB failed\n", stderr);
ERROR("DirectFB: RGBA_Image allocation from DFB failed");
goto failed_image;
}
re->screen_image->flags.engine_surface = 1;
@ -793,7 +788,7 @@ evas_engine_dfb_output_reconfigure(Render_Engine *re, int w, int h)
re->tb = NULL;
failed_tilebuf:
re->screen_image = NULL;
fputs("ERROR: Evas DirectFB reconfigure failed\n", stderr);
ERROR("DirectFB: Evas DirectFB reconfigure failed");
return 0;
}
@ -819,13 +814,13 @@ _dfb_output_setup(int w, int h, const struct Evas_Engine_DirectFB_Spec *spec)
evas_common_image_cache_get());
if (!re->cache)
{
fputs("ERROR: Evas_Cache_Engine_Image allocation failed!\n", stderr);
ERROR("DirectFB: Evas_Cache_Engine_Image allocation failed!");
goto fatal_after_engine;
}
if (!evas_engine_dfb_output_reconfigure(re, w, h))
{
fputs("ERROR: Could not reconfigure evas engine.\n", stderr);
ERROR("DirectFB: Could not reconfigure evas engine.");
goto fatal_after_reconfigure;
}
@ -839,7 +834,7 @@ _dfb_output_setup(int w, int h, const struct Evas_Engine_DirectFB_Spec *spec)
fatal_after_engine:
free(re);
fatal:
fputs("FATAL: unable to continue, abort()!\n", stderr);
CRITICAL("DirectFB: unable to continue, abort()!");
abort();
return NULL;
}
@ -887,7 +882,7 @@ static void
evas_engine_dfb_output_resize(void *data, int w, int h)
{
if (!evas_engine_dfb_output_reconfigure(data, w, h))
fputs("ERROR: failed to resize DirectFB evas\n", stderr);
ERROR("DirectFB: failed to resize DirectFB evas");
}
static void
@ -1031,7 +1026,7 @@ evas_engine_dfb_output_idle_flush(void *data)
Render_Engine *re = data;
if (re->update_regions_count != 0)
fputs("ERROR: update_regions_count not 0 as it should be!\n", stderr);
ERROR("DirectFB: update_regions_count not 0 as it should be!");
free(re->update_regions);
re->update_regions_count = 0;
@ -1351,7 +1346,7 @@ evas_engine_dfb_image_data_get(void *data __UNUSED__, void *image, int to_write,
break;
error:
fprintf(stderr, "ERROR: could not lock surface %p: %s\n",
ERROR("DirectFB: could not lock surface %p: %s",
s, DirectFBErrorString(r));
*image_data = NULL;
break;

View File

@ -377,8 +377,8 @@ fb_getmode(void)
bpp = mode->fb_var.bits_per_pixel / 8;
break;
default:
fprintf(stderr, "Cannot handle framebuffer of depth %i\n",
mode->fb_var.bits_per_pixel);
ERROR("EvasFB: Cannot handle framebuffer of depth %i",
mode->fb_var.bits_per_pixel);
fb_cleanup();
free(mode);
return NULL;
@ -418,7 +418,7 @@ fb_setvt(int vtno)
chown(vtname, getuid(), getgid());
if (access(vtname,R_OK | W_OK) == -1)
{
fprintf(stderr,"access %s: %s\n",vtname,strerror(errno));
CRITICAL("EvasFB: access %s: %s",vtname,strerror(errno));
exit(1);
}
open(vtname,O_RDWR);
@ -463,7 +463,7 @@ fb_init(int vt, int device)
}
if (fb == -1)
{
fprintf(stderr,"open %s: %s\n", dev, strerror(errno));
CRITICAL("open %s: %s", dev, strerror(errno));
fb_cleanup();
exit(1);
}
@ -495,7 +495,7 @@ fb_init(int vt, int device)
tty = 0;
else if ((tty = open("/dev/tty",O_RDWR)) == -1)
{
fprintf(stderr,"open %s: %s\n", "/dev/tty", strerror(errno));
CITICAL("open %s: %s", "/dev/tty", strerror(errno));
exit(1);
}
if (tty)
@ -527,7 +527,7 @@ fb_postinit(FB_Mode *mode)
if (fb_fix.type != FB_TYPE_PACKED_PIXELS)
{
fprintf(stderr,"can handle only packed pixel frame buffers\n");
CRITICAL("can handle only packed pixel frame buffers");
fb_cleanup();
exit(1);
}

View File

@ -12,7 +12,7 @@ void
evas_fb_outbuf_fb_free(Outbuf *buf)
{
/* FIXME: impliment */
printf("destroying fb info.. not implemented!!!! WARNING. LEAK!\n");
WARN("destroying fb info.. not implemented!!!! WARNING. LEAK!");
if (buf->priv.back_buf)
evas_cache_image_drop(&buf->priv.back_buf->cache_entry);
free(buf);

View File

@ -44,7 +44,7 @@ evas_glew_init(HWND window, HDC *dc, HGLRC *context)
if (GLEW_VERSION_2_0)
{
printf ("2.0\n");
INFO("2.0");
}
return 1;

View File

@ -198,7 +198,7 @@ eng_output_redraws_clear(void *data)
re = (Render_Engine *)data;
re->win->draw.redraw = 0;
// printf("GL: finish update cycle!\n");
// INFO("GL: finish update cycle!");
}
/* at least the nvidia drivers are so abysmal that copying from the backbuffer

View File

@ -686,15 +686,15 @@ eng_gradient_draw(void *data, void *context, void *surface, void *gradient, int
RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
Evas_Quartz_Gradient *gr = (Evas_Quartz_Gradient *)gradient;
printf("#Gradient#\n");
printf("Fill: %i %i %i %i\n", gr->grad->fill.x, gr->grad->fill.y, gr->grad->fill.w, gr->grad->fill.h);
printf("Type: %s %s\n", gr->grad->type.name, gr->grad->type.params);
printf("XYWH: %i %i %i %i\n", x, y, w, h);
printf("Geom: %p %p\n", gr->grad->type.geometer, gr->grad->type.geometer->get_fill_func);
printf("Map: len: %d angle: %f direction: %d offset: %f\n", gr->grad->map.len, gr->grad->map.angle, gr->grad->map.direction, gr->grad->map.offset);
printf("Color: nstops: %d len: %d\n", gr->grad->color.nstops, gr->grad->color.len);
printf("Alpha: nstops: %d len: %d\n", gr->grad->alpha.nstops, gr->grad->alpha.len);
printf("\n");
INFO("#Gradient#");
INFO("Fill: %i %i %i %i", gr->grad->fill.x, gr->grad->fill.y, gr->grad->fill.w, gr->grad->fill.h);
INFO("Type: %s %s", gr->grad->type.name, gr->grad->type.params);
INFO("XYWH: %i %i %i %i", x, y, w, h);
INFO("Geom: %p %p", gr->grad->type.geometer, gr->grad->type.geometer->get_fill_func);
INFO("Map: len: %d angle: %f direction: %d offset: %f", gr->grad->map.len, gr->grad->map.angle, gr->grad->map.direction, gr->grad->map.offset);
INFO("Color: nstops: %d len: %d", gr->grad->color.nstops, gr->grad->color.len);
INFO("Alpha: nstops: %d len: %d", gr->grad->alpha.nstops, gr->grad->alpha.len);
INFO("");
if ((gr->sw != w) || (gr->sh != h))
gr->changed = 1;

View File

@ -11,7 +11,7 @@
*/
#define NOT_IMPLEMENTED() \
fprintf(stderr, "NOT_IMPLEMENTED: %s() at %s:%d\n", \
WARN("NOT_IMPLEMENTED: %s() at %s:%d", \
__FUNCTION__, __FILE__, __LINE__)
static void *
@ -509,7 +509,7 @@ eng_image_new_from_data(void *data __UNUSED__, int w, int h, DATA32 *image_data,
{
if ((image_data) && (cspace != EVAS_COLORSPACE_RGB565_A5P))
{
fprintf(stderr, "Unsupported colorspace %d in %s() (%s:%d)\n",
WARN("Unsupported colorspace %d in %s() (%s:%d)",
cspace, __FUNCTION__, __FILE__, __LINE__);
return NULL;
}
@ -521,7 +521,7 @@ eng_image_new_from_copied_data(void *data __UNUSED__, int w, int h, DATA32 *imag
{
if ((image_data) && (cspace != EVAS_COLORSPACE_RGB565_A5P))
{
fprintf(stderr, "Unsupported colorspace %d in %s() (%s:%d)\n",
WARN("Unsupported colorspace %d in %s() (%s:%d)",
cspace, __FUNCTION__, __FILE__, __LINE__);
return NULL;
}

View File

@ -5,6 +5,7 @@
#include <time.h>
#include <SDL/SDL.h>
#include "evas_common.h"
#include "evas_engine.h"
/* function tables - filled in later (func and parent func) */
@ -143,7 +144,7 @@ _sdl16_output_setup(int w, int h, int rotation, int fullscreen, int noframe, int
re->cache = evas_cache_engine_image_init(&_sdl16_cache_engine_image_cb, evas_common_soft16_image_cache_get());
if (!re->cache)
{
fprintf(stderr, "Evas_Cache_Engine_Image allocation failed!\n");
ERROR("Evas_Cache_Engine_Image allocation failed!");
free(re);
return NULL;
}
@ -169,7 +170,7 @@ _sdl16_output_setup(int w, int h, int rotation, int fullscreen, int noframe, int
| (noframe ? SDL_NOFRAME : 0));
if (!surface)
{
fprintf(stderr, "SDL_SetVideoMode [ %i x %i x 16 ] failed\n", w, h);
ERROR("SDL_SetVideoMode [ %i x %i x 16 ] failed", w, h);
evas_cache_engine_image_shutdown(re->cache);
free(re);
return NULL;
@ -181,7 +182,7 @@ _sdl16_output_setup(int w, int h, int rotation, int fullscreen, int noframe, int
re->soft16_engine_image = (SDL_Engine_Image_Entry *) evas_cache_engine_image_engine(re->cache, surface);
if (!re->soft16_engine_image)
{
fprintf(stderr, "Soft16_Image allocation from SDL failed\n");
ERROR("Soft16_Image allocation from SDL failed");
evas_cache_engine_image_shutdown(re->cache);
free(re);
return NULL;
@ -203,7 +204,7 @@ evas_engine_sdl16_setup(Evas *e, void *in)
if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0)
{
fprintf(stderr, "SDL_Init failed with %s\n", SDL_GetError());
ERROR("SDL_Init failed with %s", SDL_GetError());
SDL_Quit();
return 0;
}
@ -262,13 +263,13 @@ evas_engine_sdl16_output_resize(void *data, int w, int h)
| (re->flags.noframe ? SDL_NOFRAME : 0));
if (!surface)
{
fprintf(stderr, "Unable to change the resolution to : %ix%i\n", w, h);
ERROR("Unable to change the resolution to : %ix%i", w, h);
exit(-1);
}
re->soft16_engine_image = (SDL_Engine_Image_Entry *) evas_cache_engine_image_engine(re->cache, surface);
if (!re->soft16_engine_image)
{
fprintf(stderr, "RGBA_Image allocation from SDL failed\n");
ERROR("RGBA_Image allocation from SDL failed");
exit(-1);
}
@ -611,12 +612,12 @@ evas_engine_sdl16_image_new_from_copied_data(void *data,
if (cspace != EVAS_COLORSPACE_RGB565_A5P)
{
fprintf(stderr, "Unsupported colorspace %d in %s() (%s:%d)\n",
WARN("Unsupported colorspace %d in %s() (%s:%d)",
cspace, __FUNCTION__, __FILE__, __LINE__);
return NULL;
}
fprintf(stderr, "s image_data: %p\n", image_data);
WARN("s image_data: %p", image_data);
return evas_cache_engine_image_copied_data(re->cache,
w, h,
@ -631,7 +632,7 @@ evas_engine_sdl16_image_new_from_data(void *data, int w, int h, DATA32* image_da
if (cspace != EVAS_COLORSPACE_RGB565_A5P)
{
fprintf(stderr, "Unsupported colorspace %d in %s() (%s:%d)\n",
WARN("Unsupported colorspace %d in %s() (%s:%d)",
cspace, __FUNCTION__, __FILE__, __LINE__);
return NULL;
}

View File

@ -38,32 +38,32 @@ evas_software_wince_ddraw_init(HWND window,
priv = (Evas_Engine_WinCE_DDraw_Priv *)malloc(sizeof(Evas_Engine_WinCE_DDraw_Priv));
if (!priv)
return NULL;
priv->module = LoadLibrary(L"ddraw.dll");
if (!priv->module)
{
fprintf(stderr, "[Evas] [Engine] [WinCE DDraw] Can not load ddraw.dll\n");
CRITICAL("[Engine] [WinCE DDraw] Can not load ddraw.dll");
goto free_priv;
}
lib_DirectDrawCreate = (fct_DirectDrawCreate)GetProcAddress(priv->module, L"DirectDrawCreate");
if (!lib_DirectDrawCreate)
{
fprintf(stderr, "[Evas] [Engine] [WinCE DDraw] Can not initialize DirectDraw\n");
CRITICAL("[Engine] [WinCE DDraw] Can not initialize DirectDraw");
goto free_lib;
}
res = lib_DirectDrawCreate(NULL, (IUnknown**)&priv->object, NULL);
if (FAILED(res))
{
fprintf(stderr, "[Evas] [Engine] [WinCE DDraw] Can not create DirectDraw object\n");
CRITICAL("[Engine] [WinCE DDraw] Can not create DirectDraw object");
goto free_lib;
}
res = priv->object->SetCooperativeLevel(window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
if (FAILED(res))
{
fprintf(stderr, "[Evas] [Engine] [WinCE DDraw] Can not set window to fullscreen\n");
CRITICAL("[Engine] [WinCE DDraw] Can not set window to fullscreen");
goto release_object;
}
@ -75,7 +75,7 @@ evas_software_wince_ddraw_init(HWND window,
res = priv->object->CreateSurface(&surface_desc, &priv->surface, NULL);
if (FAILED(res))
{
fprintf(stderr, "[Evas] [Engine] [WinCE DDraw] Can not create surface\n");
CRITICAL("[Engine] [WinCE DDraw] Can not create surface");
goto release_object;
}
@ -84,7 +84,7 @@ evas_software_wince_ddraw_init(HWND window,
res = priv->surface->Lock(NULL, &surface_desc, DDLOCK_READONLY, NULL);
if (FAILED(res))
{
fprintf(stderr, "[Evas] [Engine] [WinCE DDraw] Can not lock surface\n");
CRITICAL("[Evas] [Engine] [WinCE DDraw] Can not lock surface");
goto release_surface;
}
@ -95,16 +95,16 @@ evas_software_wince_ddraw_init(HWND window,
if ((priv->width != width) ||
(priv->height != height))
{
fprintf(stderr, "[Evas] [Engine] [WinCE DDraw] Size mismatch\n");
fprintf(stderr, "[Evas] [Engine] [WinCE DDraw] asked : %dx%d\n", width, height);
fprintf(stderr, "[Evas] [Engine] [WinCE DDraw] got : %dx%d\n", priv->width, priv->height);
CRITICAL("[Engine] [WinCE DDraw] Size mismatch");
CRITICAL("[Engine] [WinCE DDraw] asked : %dx%d", width, height);
CRITICAL("[Engine] [WinCE DDraw] got : %dx%d", priv->width, priv->height);
goto release_surface;
}
res = priv->surface->Unlock(NULL);
if (FAILED(res))
{
fprintf(stderr, "[Evas] [Engine] [WinCE DDraw] Can not unlock surface\n");
CRITICAL("[Engine] [WinCE DDraw] Can not unlock surface");
goto release_surface;
}

View File

@ -51,7 +51,7 @@ _evas_software_wince_gxinfo_init(HDC dc, int *width, int *height, void **buffer)
(char *) &gxInfo);
if (result <= 0)
{
fprintf (stderr, "[Evas] [Engine] [WinCE FB] ExtEscape() with GETGXINFO failed\n");
ERROR("[Engine] [WinCE FB] ExtEscape() with GETGXINFO failed");
return 0;
}
@ -79,7 +79,7 @@ evas_software_wince_fb_init(HWND window,
dc = GetDC (window);
if (!dc)
{
fprintf (stderr, "[Evas] [Engine] [WinCE FB] Can not get DC\n");
ERROR("[Engine] [WinCE FB] Can not get DC");
free(priv);
return NULL;
}
@ -102,9 +102,9 @@ evas_software_wince_fb_init(HWND window,
if ((priv->width != width) ||
(priv->height != height))
{
fprintf (stderr, "[Evas] [Engine] [WinCE FB] Size mismatch\n");
fprintf (stderr, "[Evas] [Engine] [WinCE FB] asked: %dx%d\n", width, height);
fprintf (stderr, "[Evas] [Engine] [WinCE FB] got : %dx%d\n", priv->width, priv->height);
ERROR("[Engine] [WinCE FB] Size mismatch");
ERROR("[Engine] [WinCE FB] asked: %dx%d", width, height);
ERROR("[Engine] [WinCE FB] got : %dx%d", priv->width, priv->height);
ReleaseDC(window, dc);
free(priv);
return NULL;
@ -119,8 +119,8 @@ evas_software_wince_fb_init(HWND window,
(rfbi.wBPP != 16) ||
(rfbi.wFormat != 1))
{
fprintf (stderr, "[Evas] [Engine] [WinCE FB] ExtEscape() with GETRAWFRAMEBUFFER failed\n");
fprintf (stderr, "[Evas] [Engine] [WinCE FB] trying ExtEscape() with GETGXINFO\n");
ERRPR("[Engine] [WinCE FB] ExtEscape() with GETRAWFRAMEBUFFER failed");
ERROR("[Engine] [WinCE FB] trying ExtEscape() with GETGXINFO");
if (!_evas_software_wince_gxinfo_init(dc, &priv->width, &priv->height, &priv->buffer))
{
ReleaseDC(window, dc);
@ -139,9 +139,9 @@ evas_software_wince_fb_init(HWND window,
if ((priv->width != width) ||
(priv->height != height))
{
fprintf (stderr, "[Evas] [Engine] [WinCE FB] Size mismatch\n");
fprintf (stderr, "[Evas] [Engine] [WinCE FB] asked: %dx%d\n", width, height);
fprintf (stderr, "[Evas] [Engine] [WinCE FB] got : %dx%d\n", priv->width, priv->height);
ERROR("[Engine] [WinCE FB] Size mismatch");
ERROR("[Engine] [WinCE FB] asked: %dx%d", width, height);
ERROR("[Engine] [WinCE FB] got : %dx%d", priv->width, priv->height);
ReleaseDC(window, dc);
free(priv);
return NULL;

View File

@ -110,7 +110,7 @@ evas_software_wince_gapi_init(HWND window,
gapi_lib = LoadLibrary(L"gx.dll");
if (!gapi_lib)
{
fprintf (stderr, "[Evas] [Engine] [WinCE GAPI] Can not load gx.dll\n");
ERROR("[Engine] [WinCE GAPI] Can not load gx.dll");
goto free_priv;
}
}
@ -131,13 +131,13 @@ evas_software_wince_gapi_init(HWND window,
!suspend ||
!resume)
{
fprintf (stderr, "[Evas] [Engine] [WinCE GAPI] Can not find valid symbols\n");
ERROR("[Engine] [WinCE GAPI] Can not find valid symbols");
goto free_lib;
}
if (!display_open(window, GX_FULLSCREEN))
{
fprintf (stderr, "[Evas] [Engine] [WinCE GAPI] Can not open display\n");
ERROR("[Engine] [WinCE GAPI] Can not open display");
goto free_lib;
}
@ -146,7 +146,7 @@ evas_software_wince_gapi_init(HWND window,
// verify pixel format
if(!(prop.ffFormat & kfDirect565) || (prop.cBPP != 16))
{
fprintf (stderr, "[Evas] [Engine] [WinCE GAPI] display format mismatch\n");
ERROR("[Engine] [WinCE GAPI] display format mismatch");
goto close_display;
}
@ -154,7 +154,7 @@ evas_software_wince_gapi_init(HWND window,
if ((GetSystemMetrics(SM_CXSCREEN) != (int)prop.cxWidth) ||
(GetSystemMetrics(SM_CYSCREEN) != (int)prop.cyHeight))
{
fprintf (stderr, "[Evas] [Engine] [WinCE GAPI] display size mismatch\n");
ERROR("[Engine] [WinCE GAPI] display size mismatch");
goto close_display;
}
@ -221,7 +221,7 @@ v | |
dc = GetDC (window);
if (!dc)
{
fprintf (stderr, "[Evas] [Engine] [WinCE GAPI] Can not get device\n");
ERROR("[Engine] [WinCE GAPI] Can not get device");
goto close_display;
}
@ -230,7 +230,7 @@ v | |
(char *) &gxInfo);
if (result <= 0)
{
fprintf (stderr, "[Evas] [Engine] [WinCE GAPI] ExtEscape failed\n");
ERROR("[Engine] [WinCE GAPI] ExtEscape failed");
ReleaseDC(window, dc);
goto close_display;
}
@ -249,9 +249,9 @@ v | |
if ((priv->width != width) ||
(priv->height != height))
{
fprintf (stderr, "[Evas] [Engine] [WinCE GAPI] Size mismatch\n");
fprintf (stderr, "[Evas] [Engine] [WinCE GAPI] asked: %dx%d\n", width, height);
fprintf (stderr, "[Evas] [Engine] [WinCE GAPI] got : %dx%d\n", priv->width, priv->height);
WARN("[Engine] [WinCE GAPI] Size mismatch");
WARN("[Engine] [WinCE GAPI] asked: %dx%d", width, height);
WARN("[Engine] [WinCE GAPI] got : %dx%d", priv->width, priv->height);
goto close_display;
}

View File

@ -37,7 +37,7 @@ evas_software_wince_gdi_init(HWND window,
priv->dc = GetDC(window);
if (!priv->dc)
{
fprintf (stderr, "[Evas] [Engine] [WinCE GDI] Can not get DC\n");
WARN("[Engine] [WinCE GDI] Can not get DC");
free(priv);
return NULL;
}
@ -56,7 +56,7 @@ evas_software_wince_gdi_init(HWND window,
priv->bitmap_info = (BITMAPINFO_16bpp *)malloc(sizeof(BITMAPINFO_16bpp));
if (!priv->bitmap_info)
{
fprintf (stderr, "[Evas] [Engine] [WinCE GDI] Can not allocate bitmap info\n");
WARN("[Engine] [WinCE GDI] Can not allocate bitmap info");
ReleaseDC(window, priv->dc);
free(priv);
return NULL;

View File

@ -160,12 +160,12 @@ evas_software_ddraw_outbuf_setup(int width,
if (!conv_func)
{
fprintf(stderr, ".[ Evas Error ].\n"
" {\n"
" At depth %i:\n"
" RGB format mask: %08x, %08x, %08x\n"
" Not supported by and compiled in converters!\n"
" }\n",
ERROR("DDraw engine Error"
" {"
" At depth %i:"
" RGB format mask: %08x, %08x, %08x"
" Not supported by and compiled in converters!"
" }",
buf->priv.dd.depth,
buf->priv.mask.r,
buf->priv.mask.g,

View File

@ -15,7 +15,7 @@ evas_software_gdi_init (HWND window,
if (!window)
{
fprintf (stderr, "[Evas] [Engine] [GDI] Window is NULL\n");
ERROR("[Engine] [GDI] Window is NULL");
return 0;
}
@ -24,14 +24,14 @@ evas_software_gdi_init (HWND window,
buf->priv.gdi.dc = GetDC(window);
if (!buf->priv.gdi.dc)
{
fprintf (stderr, "[Evas] [Engine] [GDI] Can not get DC\n");
ERROR("[Engine] [GDI] Can not get DC");
return 0;
}
/* FIXME: check depth */
if (depth != GetDeviceCaps(buf->priv.gdi.dc, BITSPIXEL))
{
fprintf (stderr, "[Evas] [Engine] [GDI] no compatible depth\n");
ERROR("[Engine] [GDI] no compatible depth");
ReleaseDC(window, buf->priv.gdi.dc);
return 0;
}
@ -58,7 +58,7 @@ evas_software_gdi_init (HWND window,
buf->priv.gdi.bitmap_info = (BITMAPINFO_GDI *)malloc(sizeof(BITMAPINFO_GDI));
if (!buf->priv.gdi.bitmap_info)
{
fprintf (stderr, "[Evas] [Engine] [GDI] Can not allocate bitmap info\n");
ERROR("[Engine] [GDI] Can not allocate bitmap info");
ReleaseDC(window, buf->priv.gdi.dc);
return 0;
}
@ -88,7 +88,7 @@ evas_software_gdi_init (HWND window,
buf->priv.gdi.bitmap_info->masks[2] = 0x000000ff;
break;
default:
fprintf (stderr, "[Evas] [Engine] [GDI] wrong depth\n");
ERROR("[Engine] [GDI] wrong depth");
free(buf->priv.gdi.bitmap_info);
ReleaseDC(window, buf->priv.gdi.dc);
return 0;

View File

@ -193,12 +193,12 @@ evas_software_gdi_outbuf_setup(int width,
if (!conv_func)
{
fprintf(stderr, ".[ Evas Error ].\n"
" {\n"
" At depth %i:\n"
" RGB format mask: %08lx, %08lx, %08lx\n"
" Not supported by and compiled in converters!\n"
" }\n",
ERROR(".[ soft_gdi engine Error ]."
" {"
" At depth %i:"
" RGB format mask: %08lx, %08lx, %08lx"
" Not supported by and compiled in converters!"
" }",
buf->priv.gdi.depth,
buf->priv.gdi.bitmap_info->masks[0],
buf->priv.gdi.bitmap_info->masks[1],

View File

@ -5,6 +5,7 @@
#include <time.h>
#include <SDL/SDL.h>
#include "evas_common.h"
#include "evas_engine.h"
/* #define DEBUG_SDL */
@ -99,7 +100,7 @@ evas_engine_sdl_setup (Evas* e, void* in)
if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0)
{
fprintf(stderr, "SDL_Init failed with %s\n", SDL_GetError());
ERROR("SDL_Init failed with %s", SDL_GetError());
SDL_Quit();
return 0;
}
@ -170,13 +171,13 @@ evas_engine_sdl_output_resize (void *data, int w, int h)
if (!surface)
{
fprintf(stderr, "Unable to change the resolution to : %ix%i\n", w, h);
ERROR("Unable to change the resolution to : %ix%i", w, h);
exit(-1);
}
re->rgba_engine_image = (SDL_Engine_Image_Entry *) evas_cache_engine_image_engine(re->cache, surface);
if (!re->rgba_engine_image)
{
fprintf(stderr, "RGBA_Image allocation from SDL failed\n");
ERROR("RGBA_Image allocation from SDL failed");
exit(-1);
}
@ -924,7 +925,7 @@ _sdl_output_setup (int w, int h, int fullscreen, int noframe, int alpha, int hw
re->cache = evas_cache_engine_image_init(&_sdl_cache_engine_image_cb, evas_common_image_cache_get());
if (!re->cache)
{
fprintf(stderr, "Evas_Cache_Engine_Image allocation failed!\n");
CRITICAL("Evas_Cache_Engine_Image allocation failed!");
exit(-1);
}
@ -939,7 +940,7 @@ _sdl_output_setup (int w, int h, int fullscreen, int noframe, int alpha, int hw
if (!surface)
{
fprintf(stderr, "SDL_SetVideoMode [ %i x %i x 32 ] failed.\n", w, h);
CRITICAL("SDL_SetVideoMode [ %i x %i x 32 ] failed.", w, h);
exit(-1);
}
@ -951,7 +952,7 @@ _sdl_output_setup (int w, int h, int fullscreen, int noframe, int alpha, int hw
re->rgba_engine_image = (SDL_Engine_Image_Entry *) evas_cache_engine_image_engine(re->cache, surface);
if (!re->rgba_engine_image)
{
fprintf(stderr, "RGBA_Image allocation from SDL failed\n");
CRITICAL("RGBA_Image allocation from SDL failed");
exit(-1);
}
@ -1136,17 +1137,17 @@ _sdl_image_debug(const char* context, Engine_Image_Entry* eie)
{
SDL_Engine_Image_Entry *eim = (SDL_Engine_Image_Entry *) eie;
printf ("*** %s image (%p) ***\n", context, eim);
DEBUG("*** %s image (%p) ***", context, eim);
if (eim)
{
printf ("* W: %i\n* H: %i\n* R: %i\n", eim->cache_entry.w, eim->cache_entry.h, eim->cache_entry.references);
DEBUG ("* W: %i\n* H: %i\n* R: %i", eim->cache_entry.w, eim->cache_entry.h, eim->cache_entry.references);
if (eim->cache_entry.src)
printf ("* Pixels: %p\n* SDL Surface: %p\n",((RGBA_Image*) eim->cache_entry.src)->image.data, eim->surface);
DEBUG ("* Pixels: %p\n* SDL Surface: %p",((RGBA_Image*) eim->cache_entry.src)->image.data, eim->surface);
if (eim->surface)
printf ("* Surface->pixels: %p\n", eim->surface->pixels);
printf ("* Key: %s\n", eim->cache_entry.cache_key);
printf ("* Reference: %i\n", eim->cache_entry.references);
DEBUG ("* Surface->pixels: %p", eim->surface->pixels);
DEBUG ("* Key: %s", eim->cache_entry.cache_key);
DEBUG ("* Reference: %i", eim->cache_entry.references);
}
printf ("*** ***\n");
DEBUG ("*** ***");
}
#endif

View File

@ -355,13 +355,13 @@ evas_software_xcb_outbuf_setup_x(int w,
evas_software_xcb_x_output_buffer_free(xcbob, 1);
if (!conv_func)
{
printf(".[ Evas Error ].\n"
" {\n"
" At depth %i:\n"
" RGB format mask: %08x, %08x, %08x\n"
" Palette mode: %i\n"
" Not supported by and compiled in converters!\n"
" }\n",
ERROR("XCB Engine"
" {"
" At depth %i:"
" RGB format mask: %08x, %08x, %08x"
" Palette mode: %i"
" Not supported by and compiled in converters!"
" }",
buf->priv.x11.xcb.depth,
buf->priv.mask.r,
buf->priv.mask.g,

View File

@ -266,17 +266,17 @@ evas_image_load_file_data_tiff(Image_Entry *ie, const char *file, const char *ke
if (!rast)
{
fprintf(stderr, "Evas Tiff loader: out of memory\n");
TIFFRGBAImageEnd((TIFFRGBAImage *) & rgba_image);
TIFFClose(tif);
ERROR("Evas Tiff loader: out of memory");
TIFFRGBAImageEnd((TIFFRGBAImage *) & rgba_image);
TIFFClose(tif);
return 0;
}
if (rgba_image.rgba.put.any == NULL)
{
fprintf(stderr, "Evas Tiff loader: no put function");
ERROR("Evas Tiff loader: no put function");
_TIFFfree(rast);
TIFFRGBAImageEnd((TIFFRGBAImage *) & rgba_image);
@ -312,7 +312,7 @@ evas_image_load_file_data_tiff(Image_Entry *ie, const char *file, const char *ke
}
else
{
printf("channel bits == %i\n", (int)rgba_image.rgba.samplesperpixel);
INFO("channel bits == %i", (int)rgba_image.rgba.samplesperpixel);
}
_TIFFfree(rast);

View File

@ -202,8 +202,7 @@ evas_image_load_file_xpm(Image_Entry *ie, const char *file, const char *key __UN
/* Header */
if (sscanf(line, "%i %i %i %i", &w, &h, &ncolors, &cpp) != 4)
{
fprintf(stderr,
"XPM ERROR: XPM file malformed header\n");
ERROR("XPM ERROR: XPM file malformed header");
free(line);
fclose(f);
xpm_parse_done();
@ -211,8 +210,7 @@ evas_image_load_file_xpm(Image_Entry *ie, const char *file, const char *key __UN
}
if ((ncolors > 32766) || (ncolors < 1))
{
fprintf(stderr,
"XPM ERROR: XPM files with colors > 32766 or < 1 not supported\n");
ERROR("XPM ERROR: XPM files with colors > 32766 or < 1 not supported");
free(line);
fclose(f);
xpm_parse_done();
@ -220,8 +218,7 @@ evas_image_load_file_xpm(Image_Entry *ie, const char *file, const char *key __UN
}
if ((cpp > 5) || (cpp < 1))
{
fprintf(stderr,
"XPM ERROR: XPM files with characters per pixel > 5 or < 1not supported\n");
ERROR("XPM ERROR: XPM files with characters per pixel > 5 or < 1not supported");
free(line);
fclose(f);
xpm_parse_done();
@ -229,8 +226,7 @@ evas_image_load_file_xpm(Image_Entry *ie, const char *file, const char *key __UN
}
if ((w > IMG_MAX_SIZE) || (w < 1))
{
fprintf(stderr,
"XPM ERROR: Image width > IMG_MAX_SIZE or < 1 pixels for file\n");
ERROR("XPM ERROR: Image width > IMG_MAX_SIZE or < 1 pixels for file");
free(line);
fclose(f);
xpm_parse_done();
@ -238,8 +234,7 @@ evas_image_load_file_xpm(Image_Entry *ie, const char *file, const char *key __UN
}
if ((h > IMG_MAX_SIZE) || (h < 1))
{
fprintf(stderr,
"XPM ERROR: Image height > IMG_MAX_SIZE or < 1 pixels for file\n");
ERROR("XPM ERROR: Image height > IMG_MAX_SIZE or < 1 pixels for file");
free(line);
fclose(f);
xpm_parse_done();
@ -248,7 +243,7 @@ evas_image_load_file_xpm(Image_Entry *ie, const char *file, const char *key __UN
if (IMG_TOO_BIG(w, h))
{
fprintf(stderr,
"XPM ERROR: Image just too big to ever allocate\n");
"XPM ERROR: Image just too big to ever allocate");
free(line);
fclose(f);
xpm_parse_done();