evas/cserve2: Fix scaling options
authorJean-Philippe Andre <jp.andre@samsung.com>
Tue, 24 Sep 2013 09:46:17 +0000 (18:46 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Mon, 28 Oct 2013 06:47:15 +0000 (15:47 +0900)
Be more careful when selecting the original image for scaling.
Most load opts must remain the same, only smooth can be toyed with.
Also, fix alpha when scaling.

src/bin/evas/evas_cserve2_cache.c

index d0589dd..87ea2d2 100644 (file)
@@ -842,6 +842,7 @@ _scaling_do(Shm_Handle *scale_shm, Image_Data *idata, Image_Entry *original)
        0, 0,
        idata->opts.scale_load.dst_w, idata->opts.scale_load.dst_h);
 
+   idata->alpha = orig_idata->alpha;
    cserve2_rgba_image_scale_do(
             src_data, orig_idata->w, orig_idata->h,
             dst_data,
@@ -2721,10 +2722,10 @@ try_again:
         goto do_scaling;
      }
 
-   if (first_attempt)
+   if (first_attempt && unscaled.scale_load.smooth)
      {
         first_attempt = EINA_FALSE;
-        memset(&unscaled, 0, sizeof(unscaled));
+        unscaled.scale_load.smooth = 0;
         goto try_again;
      }