hermet pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=6f3841e4b4fd17485789ae142d1e9b373235d858

commit 6f3841e4b4fd17485789ae142d1e9b373235d858
Author: Hermet Park <hermetp...@gmail.com>
Date:   Thu Sep 19 13:59:05 2019 +0900

    evas mask: refactoring code.
    
    This clearly separate the condition cases clear so that
    the analizyer tool doesn't bother us anymore.
    
    No logical changes.
---
 src/lib/evas/common/evas_scale_sample.c | 35 +++++++++++++++++----------------
 1 file changed, 18 insertions(+), 17 deletions(-)

diff --git a/src/lib/evas/common/evas_scale_sample.c 
b/src/lib/evas/common/evas_scale_sample.c
index 136813e208..cfd59726fc 100644
--- a/src/lib/evas/common/evas_scale_sample.c
+++ b/src/lib/evas/common/evas_scale_sample.c
@@ -103,34 +103,35 @@ _evas_common_scale_rgba_sample_scale_nomask(int y,
                                             DATA32 *dptr, RGBA_Gfx_Func func, 
unsigned int mul_col,
                                             DATA32 *srcptr, int src_w)
 {
-   DATA32 *buf = NULL;
    int x;
-
-   /* a scanline buffer */
-   if (!srcptr)
-     buf = alloca(dst_clip_w * sizeof(DATA32));
-
    dptr = dptr + dst_w * y;
-   for (; y < dst_clip_h; y++)
+
+   if (srcptr)
      {
-        if (!srcptr)
+        for (; y < dst_clip_h; y++)
+          {
+             /* * blend here [clip_w *] buf -> dptr * */
+             func(srcptr, NULL, mul_col, dptr, dst_clip_w);
+             dptr += dst_w;
+             srcptr += src_w;
+          }
+     }
+   else
+     {
+        DATA32 *buf = alloca(dst_clip_w * sizeof(DATA32));
+        for (; y < dst_clip_h; y++)
           {
              DATA32 *dst_ptr = buf;
              for (x = 0; x < dst_clip_w; x++)
                {
-                  DATA32 *ptr;
-
-                  ptr = row_ptr[y] + lin_ptr[x];
+                  DATA32 *ptr = row_ptr[y] + lin_ptr[x];
                   *dst_ptr = *ptr;
                   dst_ptr++;
                }
+             /* * blend here [clip_w *] buf -> dptr * */
+             func(buf, NULL, mul_col, dptr, dst_clip_w);
+             dptr += dst_w;
           }
-
-        /* * blend here [clip_w *] buf -> dptr * */
-        func(srcptr ?: buf, NULL, mul_col, dptr, dst_clip_w);
-
-        dptr += dst_w;
-        if (srcptr) srcptr += src_w;
      }
 }
 

-- 


Reply via email to