ector: fix a wrong target buffer size. 58/213358/1
authorHermet Park <hermetpark@gmail.com>
Wed, 4 Sep 2019 10:56:57 +0000 (19:56 +0900)
committerHermet Park <hermetpark@gmail.com>
Wed, 4 Sep 2019 11:05:03 +0000 (20:05 +0900)
the target buffer is allocated by backend engine,
The buffer size must be specified with the stride, not the width.
It's real dimension can be different with the our request.

Change-Id: Ia17f166176ce67ea03433102f48974b76f05b40b

src/lib/ector/software/ector_software_rasterizer.c

index 62c3eac..399b449 100644 (file)
@@ -316,7 +316,7 @@ _blend_gradient_alpha(int count, const SW_FT_Span *spans, void *user_data)
 
    while (count--)
      {
-        uint32_t *target = buffer + ((sd->raster_buffer->generic->w * spans->y) + spans->x);
+        uint32_t *target = buffer + ((pix_stride * spans->y) + spans->x);
         uint32_t *mtarget = mbuffer + ((mask->generic->w * spans->y) + spans->x);
         int length = spans->len;
 
@@ -364,7 +364,7 @@ _blend_gradient_alpha_inv(int count, const SW_FT_Span *spans, void *user_data)
 
    while (count--)
      {
-        uint32_t *target = buffer + ((sd->raster_buffer->generic->w * spans->y) + spans->x);
+        uint32_t *target = buffer + ((pix_stride * spans->y) + spans->x);
         uint32_t *mtarget = mbuffer + ((mask->generic->w * spans->y) + spans->x);
         int length = spans->len;