summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2007-10-25 22:09:49 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2007-10-25 22:09:49 +0000
commit3209b5f4e83f9bf66bc02f60fff3b8a51e0bca76 (patch)
tree9c8492fd0f742549da4c82ea93f7ac21133776a6
parent8ee9f51f5b74b6cfbe3f066c70fe06e09c446c4a (diff)
Fix image alpha_set() and fix compiler warning, minor fixes.
SVN revision: 32165
Diffstat (limited to '')
-rw-r--r--legacy/evas/src/modules/engines/software_16/evas_engine.c12
-rw-r--r--legacy/evas/src/modules/engines/software_16/evas_soft16.h4
-rw-r--r--legacy/evas/src/modules/engines/software_16/evas_soft16_font.c10
-rw-r--r--legacy/evas/src/modules/engines/software_16/evas_soft16_main.c14
4 files changed, 26 insertions, 14 deletions
diff --git a/legacy/evas/src/modules/engines/software_16/evas_engine.c b/legacy/evas/src/modules/engines/software_16/evas_engine.c
index 9ee268a5b5..5073531aeb 100644
--- a/legacy/evas/src/modules/engines/software_16/evas_engine.c
+++ b/legacy/evas/src/modules/engines/software_16/evas_engine.c
@@ -14,9 +14,6 @@
14 fprintf(stderr, "NOT_IMPLEMENTED: %s() at %s:%d\n", \ 14 fprintf(stderr, "NOT_IMPLEMENTED: %s() at %s:%d\n", \
15 __FUNCTION__, __FILE__, __LINE__) 15 __FUNCTION__, __FILE__, __LINE__)
16 16
17
18static int cpunum = 0;
19
20static void * 17static void *
21eng_context_new(void *data) 18eng_context_new(void *data)
22{ 19{
@@ -333,8 +330,7 @@ eng_image_alpha_get(void *data, void *image)
333 330
334 if (!image) return 0; 331 if (!image) return 0;
335 im = image; 332 im = image;
336 if (im->have_alpha) return 1; 333 return im->have_alpha;
337 return 0;
338} 334}
339 335
340static int 336static int
@@ -348,7 +344,7 @@ eng_image_alpha_set(void *data, void *image, int have_alpha)
348{ 344{
349 if (!image) return NULL; 345 if (!image) return NULL;
350 have_alpha = !!have_alpha; 346 have_alpha = !!have_alpha;
351 soft16_image_alpha_set(image, have_alpha); 347 image = soft16_image_alpha_set(image, have_alpha);
352 return image; 348 return image;
353} 349}
354 350
@@ -372,6 +368,7 @@ eng_image_comment_get(void *data, void *image, char *key)
372static char * 368static char *
373eng_image_format_get(void *data, void *image) 369eng_image_format_get(void *data, void *image)
374{ 370{
371 NOT_IMPLEMENTED();
375 return NULL; 372 return NULL;
376} 373}
377 374
@@ -384,11 +381,13 @@ eng_image_colorspace_set(void *data, void *image, int cspace)
384static void 381static void
385eng_image_native_set(void *data, void *image, void *native) 382eng_image_native_set(void *data, void *image, void *native)
386{ 383{
384 NOT_IMPLEMENTED();
387} 385}
388 386
389static void * 387static void *
390eng_image_native_get(void *data, void *image) 388eng_image_native_get(void *data, void *image)
391{ 389{
390 NOT_IMPLEMENTED();
392 return NULL; 391 return NULL;
393} 392}
394 393
@@ -843,7 +842,6 @@ module_open(Evas_Module *em)
843{ 842{
844 if (!em) return 0; 843 if (!em) return 0;
845 em->functions = (void *)(&func); 844 em->functions = (void *)(&func);
846 cpunum = evas_common_cpu_count();
847 return 1; 845 return 1;
848} 846}
849 847
diff --git a/legacy/evas/src/modules/engines/software_16/evas_soft16.h b/legacy/evas/src/modules/engines/software_16/evas_soft16.h
index 993de6818f..9030928f53 100644
--- a/legacy/evas/src/modules/engines/software_16/evas_soft16.h
+++ b/legacy/evas/src/modules/engines/software_16/evas_soft16.h
@@ -88,7 +88,7 @@ void soft16_image_free(Soft16_Image *im);
88Soft16_Image *soft16_image_load(const char *file, const char *key, int *error, Evas_Image_Load_Opts *lo); 88Soft16_Image *soft16_image_load(const char *file, const char *key, int *error, Evas_Image_Load_Opts *lo);
89void soft16_image_load_data(Soft16_Image *im); 89void soft16_image_load_data(Soft16_Image *im);
90void soft16_image_draw(Soft16_Image *src, Soft16_Image *dst, RGBA_Draw_Context *dc, int src_region_x, int src_region_y, int src_region_w, int src_region_h, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h, int smooth); 90void soft16_image_draw(Soft16_Image *src, Soft16_Image *dst, RGBA_Draw_Context *dc, int src_region_x, int src_region_y, int src_region_w, int src_region_h, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h, int smooth);
91void soft16_image_alpha_set(Soft16_Image *im, int have_alpha); 91Soft16_Image *soft16_image_alpha_set(Soft16_Image *im, int have_alpha);
92Soft16_Image *soft16_image_size_set(Soft16_Image *im, int w, int h); 92Soft16_Image *soft16_image_size_set(Soft16_Image *im, int w, int h);
93 93
94 94
@@ -123,6 +123,6 @@ soft16_line_draw(Soft16_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x
123 */ 123 */
124void *soft16_font_glyph_new(void *data, RGBA_Font_Glyph *fg); 124void *soft16_font_glyph_new(void *data, RGBA_Font_Glyph *fg);
125void soft16_font_glyph_free(void *ext_dat); 125void soft16_font_glyph_free(void *ext_dat);
126void soft16_font_glyph_draw(Soft16_Image *dst, void *data, RGBA_Draw_Context *dc, RGBA_Font_Glyph *fg, int x, int y); 126void soft16_font_glyph_draw(void *data, void *dest, void *context, RGBA_Font_Glyph *fg, int x, int y);
127 127
128#endif 128#endif
diff --git a/legacy/evas/src/modules/engines/software_16/evas_soft16_font.c b/legacy/evas/src/modules/engines/software_16/evas_soft16_font.c
index 0ea8093f3e..0b218ac7e4 100644
--- a/legacy/evas/src/modules/engines/software_16/evas_soft16_font.c
+++ b/legacy/evas/src/modules/engines/software_16/evas_soft16_font.c
@@ -246,16 +246,20 @@ _soft16_font_glyph_draw_mono(Soft16_Image *dst,
246} 246}
247 247
248void 248void
249soft16_font_glyph_draw(Soft16_Image *dst, void *data, 249soft16_font_glyph_draw(void *data, void *dest, void *context,
250 RGBA_Draw_Context *dc, RGBA_Font_Glyph *fg, 250 RGBA_Font_Glyph *fg, int x, int y)
251 int x, int y)
252{ 251{
252 Soft16_Image *dst;
253 RGBA_Draw_Context *dc;
253 const DATA8 *bitmap; 254 const DATA8 *bitmap;
254 DATA8 alpha, r, g, b; 255 DATA8 alpha, r, g, b;
255 DATA16 rgb565; 256 DATA16 rgb565;
256 Evas_Rectangle ext; 257 Evas_Rectangle ext;
257 int bpitch, bw, bh; 258 int bpitch, bw, bh;
258 259
260 dst = data;
261 dc = context;
262
259 alpha = A_VAL(&dc->col.col) >> 3; 263 alpha = A_VAL(&dc->col.col) >> 3;
260 if (alpha == 0) return; /* precision is 5 bits, 3 bits lost */ 264 if (alpha == 0) return; /* precision is 5 bits, 3 bits lost */
261 265
diff --git a/legacy/evas/src/modules/engines/software_16/evas_soft16_main.c b/legacy/evas/src/modules/engines/software_16/evas_soft16_main.c
index 2008f96f56..656284c45d 100644
--- a/legacy/evas/src/modules/engines/software_16/evas_soft16_main.c
+++ b/legacy/evas/src/modules/engines/software_16/evas_soft16_main.c
@@ -447,10 +447,10 @@ soft16_image_draw(Soft16_Image *src, Soft16_Image *dst,
447 dc->clip = clip_bkp; 447 dc->clip = clip_bkp;
448} 448}
449 449
450void 450Soft16_Image *
451soft16_image_alpha_set(Soft16_Image *im, int have_alpha) 451soft16_image_alpha_set(Soft16_Image *im, int have_alpha)
452{ 452{
453 if (im->have_alpha == have_alpha) return; 453 if (im->have_alpha == have_alpha) return im;
454 im->have_alpha = have_alpha; 454 im->have_alpha = have_alpha;
455 455
456 if ((im->pixels) && (im->free_pixels)) 456 if ((im->pixels) && (im->free_pixels))
@@ -469,6 +469,16 @@ soft16_image_alpha_set(Soft16_Image *im, int have_alpha)
469 im->alpha = (DATA8*)(im->pixels + size); 469 im->alpha = (DATA8*)(im->pixels + size);
470 memset(im->alpha, 0x1f, size); 470 memset(im->alpha, 0x1f, size);
471 } 471 }
472 return im;
473 }
474 else
475 {
476 Soft16_Image *im_new;
477
478 im_new = soft16_image_new(im->w, im->h, im->stride, have_alpha,
479 im->pixels, 1);
480 soft16_image_free(im);
481 return im_new;
472 } 482 }
473} 483}
474 484