Enlightenment CVS committal

Author  : barbieri
Project : e17
Module  : libs/evas

Dir     : e17/libs/evas/src/modules/engines/software_16


Modified Files:
        evas_engine.c evas_soft16.h evas_soft16_font.c 
        evas_soft16_main.c 


Log Message:
Fix image alpha_set() and fix compiler warning, minor fixes.

===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/software_16/evas_engine.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- evas_engine.c       25 Oct 2007 16:17:18 -0000      1.9
+++ evas_engine.c       25 Oct 2007 22:09:49 -0000      1.10
@@ -14,9 +14,6 @@
    fprintf(stderr, "NOT_IMPLEMENTED: %s() at %s:%d\n",                  \
            __FUNCTION__, __FILE__, __LINE__)
 
-
-static int cpunum = 0;
-
 static void *
 eng_context_new(void *data)
 {
@@ -333,8 +330,7 @@
 
    if (!image) return 0;
    im = image;
-   if (im->have_alpha) return 1;
-   return 0;
+   return im->have_alpha;
 }
 
 static int
@@ -348,7 +344,7 @@
 {
    if (!image) return NULL;
    have_alpha = !!have_alpha;
-   soft16_image_alpha_set(image, have_alpha);
+   image = soft16_image_alpha_set(image, have_alpha);
    return image;
 }
 
@@ -372,6 +368,7 @@
 static char *
 eng_image_format_get(void *data, void *image)
 {
+   NOT_IMPLEMENTED();
    return NULL;
 }
 
@@ -384,11 +381,13 @@
 static void
 eng_image_native_set(void *data, void *image, void *native)
 {
+   NOT_IMPLEMENTED();
 }
 
 static void *
 eng_image_native_get(void *data, void *image)
 {
+   NOT_IMPLEMENTED();
    return NULL;
 }
 
@@ -843,7 +842,6 @@
 {
    if (!em) return 0;
    em->functions = (void *)(&func);
-   cpunum = evas_common_cpu_count();
    return 1;
 }
 
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/software_16/evas_soft16.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- evas_soft16.h       25 Oct 2007 16:17:18 -0000      1.10
+++ evas_soft16.h       25 Oct 2007 22:09:49 -0000      1.11
@@ -88,7 +88,7 @@
 Soft16_Image *soft16_image_load(const char *file, const char *key, int *error, 
Evas_Image_Load_Opts *lo);
 void soft16_image_load_data(Soft16_Image *im);
 void 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);
-void soft16_image_alpha_set(Soft16_Image *im, int have_alpha);
+Soft16_Image *soft16_image_alpha_set(Soft16_Image *im, int have_alpha);
 Soft16_Image *soft16_image_size_set(Soft16_Image *im, int w, int h);
 
 
@@ -123,6 +123,6 @@
  */
 void *soft16_font_glyph_new(void *data, RGBA_Font_Glyph *fg);
 void  soft16_font_glyph_free(void *ext_dat);
-void  soft16_font_glyph_draw(Soft16_Image *dst, void *data, RGBA_Draw_Context 
*dc, RGBA_Font_Glyph *fg, int x, int y);
+void  soft16_font_glyph_draw(void *data, void *dest, void *context, 
RGBA_Font_Glyph *fg, int x, int y);
 
 #endif
===================================================================
RCS file: 
/cvs/e/e17/libs/evas/src/modules/engines/software_16/evas_soft16_font.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- evas_soft16_font.c  10 Oct 2007 19:22:26 -0000      1.3
+++ evas_soft16_font.c  25 Oct 2007 22:09:49 -0000      1.4
@@ -246,15 +246,19 @@
 }
 
 void
-soft16_font_glyph_draw(Soft16_Image *dst, void *data,
-                      RGBA_Draw_Context *dc, RGBA_Font_Glyph *fg,
-                      int x, int y)
+soft16_font_glyph_draw(void *data, void *dest, void *context,
+                      RGBA_Font_Glyph *fg, int x, int y)
 {
+   Soft16_Image *dst;
+   RGBA_Draw_Context *dc;
    const DATA8 *bitmap;
    DATA8 alpha, r, g, b;
    DATA16 rgb565;
    Evas_Rectangle ext;
    int bpitch, bw, bh;
+
+   dst = data;
+   dc = context;
 
    alpha = A_VAL(&dc->col.col) >> 3;
    if (alpha == 0) return; /* precision is 5 bits, 3 bits lost */
===================================================================
RCS file: 
/cvs/e/e17/libs/evas/src/modules/engines/software_16/evas_soft16_main.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- evas_soft16_main.c  25 Oct 2007 16:17:18 -0000      1.15
+++ evas_soft16_main.c  25 Oct 2007 22:09:49 -0000      1.16
@@ -447,10 +447,10 @@
    dc->clip = clip_bkp;
 }
 
-void
+Soft16_Image *
 soft16_image_alpha_set(Soft16_Image *im, int have_alpha)
 {
-   if (im->have_alpha == have_alpha) return;
+   if (im->have_alpha == have_alpha) return im;
    im->have_alpha = have_alpha;
 
    if ((im->pixels) && (im->free_pixels))
@@ -469,6 +469,16 @@
             im->alpha = (DATA8*)(im->pixels + size);
             memset(im->alpha, 0x1f, size);
          }
+       return im;
+     }
+   else
+     {
+       Soft16_Image *im_new;
+
+       im_new = soft16_image_new(im->w, im->h, im->stride, have_alpha,
+                                 im->pixels, 1);
+       soft16_image_free(im);
+       return im_new;
      }
 }
 



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to