summaryrefslogtreecommitdiff
path: root/src/lib/ector/software/ector_software_surface.c
diff options
context:
space:
mode:
authorJunsuChoi <jsuya.choi@samsung.com>2019-06-20 16:07:05 +0900
committerHermet Park <hermetpark@gmail.com>2019-06-20 16:07:05 +0900
commitc7b1a40b5ec2d63ce32be3d78e60ea1f3206140a (patch)
tree08ff2ad827d7258ae93cd3205f46a0fd75119dc2 /src/lib/ector/software/ector_software_surface.c
parentc27c4692043140fef014dad3ff18c88c929772d8 (diff)
ector: Fix precomp layer rendering issue when it has alpha value
Summary: When the precomp layer(parent layer) has alpha transparency and has more than 1 child layer and they overlap each other if vg object just propagate the alpha to child layer it will be applied twice in overlapped area. Even if the child layer does not have alpha transparency, parent alpha is applied to each child. Test Plan: N/A Reviewers: Hermet, smohanty Reviewed By: Hermet Subscribers: cedric, #reviewers, kimcinoo, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9072
Diffstat (limited to 'src/lib/ector/software/ector_software_surface.c')
-rw-r--r--src/lib/ector/software/ector_software_surface.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/lib/ector/software/ector_software_surface.c b/src/lib/ector/software/ector_software_surface.c
index 10cf9962fd..08a2786f16 100644
--- a/src/lib/ector/software/ector_software_surface.c
+++ b/src/lib/ector/software/ector_software_surface.c
@@ -245,5 +245,31 @@ _ector_software_surface_ector_surface_reference_point_set(Eo *obj EINA_UNUSED,
245 pd->y = y; 245 pd->y = y;
246} 246}
247 247
248static Eina_Bool
249_ector_software_surface_ector_surface_draw_image(Eo *obj EINA_UNUSED,
250 Ector_Software_Surface_Data *pd,
251 Ector_Buffer *buffer, int x, int y, int alpha)
252{
253 if (!buffer || !pd->rasterizer || !pd->rasterizer->fill_data.raster_buffer->pixels.u32)
254 return EINA_FALSE;
255
256 Ector_Software_Buffer_Base_Data *bd = efl_data_scope_get(buffer, ECTOR_SOFTWARE_BUFFER_BASE_MIXIN);
257 const int pix_stride = pd->rasterizer->fill_data.raster_buffer->stride / 4;
258
259 uint32_t *src = bd->pixels.u32;
260 for (unsigned int local_y = 0; local_y < bd->generic->h; local_y++)
261 {
262 uint32_t *dst = pd->rasterizer->fill_data.raster_buffer->pixels.u32 + (x + ((local_y + y) * pix_stride));
263 for (unsigned int local_x = 0; local_x < bd->generic->w; local_x++)
264 {
265 *src = draw_mul_256(alpha, *src);
266 int inv_alpha = 255 - ((*src) >> 24);
267 *dst = *src + draw_mul_256(inv_alpha, *dst);
268 dst++;
269 src++;
270 }
271 }
272 return EINA_TRUE;
273}
248#include "ector_software_surface.eo.c" 274#include "ector_software_surface.eo.c"
249#include "ector_renderer_software.eo.c" 275#include "ector_renderer_software.eo.c"