evas: forgotten patch for enabling colorspace properly.
authorcedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 4 Sep 2011 14:31:24 +0000 (14:31 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 4 Sep 2011 14:31:24 +0000 (14:31 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@63152 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/engines/common/evas_image_data.c

index 94257f1..10b3988 100644 (file)
@@ -21,6 +21,8 @@ evas_common_rgba_image_from_data(Image_Entry* ie_dst, int w, int h, DATA32 *imag
       case EVAS_COLORSPACE_YCBCR422P601_PL:
       case EVAS_COLORSPACE_YCBCR422P709_PL:
       case EVAS_COLORSPACE_YCBCR422601_PL:
+      case EVAS_COLORSPACE_YCBCR420TM12601_PL:
+      case EVAS_COLORSPACE_YCBCR420NV12601_PL:
        w &= ~0x1;
        dst->cache_entry.w = w;
        dst->cache_entry.h = h;
@@ -45,21 +47,23 @@ evas_common_rgba_image_from_copied_data(Image_Entry* ie_dst, int w, int h, DATA3
    /* FIXME: Is dst->image.data valid. */
    switch (cspace)
      {
-     case EVAS_COLORSPACE_ARGB8888:
-       dst->cache_entry.flags.alpha = alpha ? 1 : 0;
-        if (image_data)
-          memcpy(dst->image.data, image_data, w * h * sizeof(DATA32));
-        break;
-     case EVAS_COLORSPACE_YCBCR422P601_PL:
-     case EVAS_COLORSPACE_YCBCR422P709_PL:
-     case EVAS_COLORSPACE_YCBCR422601_PL:
-        dst->cs.data = calloc(1, dst->cache_entry.h * sizeof(unsigned char*) * 2);
-        if (image_data && (dst->cs.data))
-          memcpy(dst->cs.data,  image_data, dst->cache_entry.h * sizeof(unsigned char*) * 2);
-        break;
-     default:
-        abort();
-        break;
+      case EVAS_COLORSPACE_ARGB8888:
+         dst->cache_entry.flags.alpha = alpha ? 1 : 0;
+         if (image_data)
+           memcpy(dst->image.data, image_data, w * h * sizeof(DATA32));
+         break;
+      case EVAS_COLORSPACE_YCBCR422P601_PL:
+      case EVAS_COLORSPACE_YCBCR422P709_PL:
+      case EVAS_COLORSPACE_YCBCR422601_PL:
+      case EVAS_COLORSPACE_YCBCR420TM12601_PL:
+      case EVAS_COLORSPACE_YCBCR420NV12601_PL:
+         dst->cs.data = calloc(1, dst->cache_entry.h * sizeof(unsigned char*) * 2);
+         if (image_data && (dst->cs.data))
+           memcpy(dst->cs.data,  image_data, dst->cache_entry.h * sizeof(unsigned char*) * 2);
+         break;
+      default:
+         abort();
+         break;
      }
 
    dst->cache_entry.space = cspace;
@@ -76,15 +80,16 @@ evas_common_rgba_image_size_set(Image_Entry *ie_dst, const Image_Entry *ie_im, u
 
    if ((im->cache_entry.space == EVAS_COLORSPACE_YCBCR422P601_PL) ||
        (im->cache_entry.space == EVAS_COLORSPACE_YCBCR422P709_PL) ||
-       (im->cache_entry.space == EVAS_COLORSPACE_YCBCR422601_PL))
-     w &= ~0x1;
+       (im->cache_entry.space == EVAS_COLORSPACE_YCBCR422601_PL) ||
+       (im->cache_entry.space == EVAS_COLORSPACE_YCBCR420TM12601_PL) ||
+       (im->cache_entry.space == EVAS_COLORSPACE_YCBCR420NV12601_PL))
+     {
+        w &= ~0x1;
+        dst->cs.data = calloc(1, dst->cache_entry.h * sizeof(unsigned char *) * 2);
+     }
 
    dst->flags = im->flags;
    dst->cs.no_free = 0;
-   if ((im->cache_entry.space == EVAS_COLORSPACE_YCBCR422P601_PL) ||
-       (im->cache_entry.space == EVAS_COLORSPACE_YCBCR422P709_PL) ||
-       (im->cache_entry.space == EVAS_COLORSPACE_YCBCR422601_PL))
-     dst->cs.data = calloc(1, dst->cache_entry.h * sizeof(unsigned char *) * 2);
    evas_common_image_colorspace_dirty(dst);
 
    _evas_common_rgba_image_post_surface(ie_dst);
@@ -109,6 +114,8 @@ evas_common_rgba_image_colorspace_set(Image_Entry* ie_dst, int cspace)
       case EVAS_COLORSPACE_YCBCR422P601_PL:
       case EVAS_COLORSPACE_YCBCR422P709_PL:
       case EVAS_COLORSPACE_YCBCR422601_PL:
+      case EVAS_COLORSPACE_YCBCR420TM12601_PL:
+      case EVAS_COLORSPACE_YCBCR420NV12601_PL:
        if (dst->image.no_free)
          {
              ie_dst->allocated.w = 0;