summaryrefslogtreecommitdiff
path: root/legacy/evas/src/lib/engines
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2012-07-05 03:11:47 +0000
committerCedric BAIL <cedric.bail@free.fr>2012-07-05 03:11:47 +0000
commita99bf2c9b6f47fde68f627623eec9e7ab86db0f0 (patch)
tree40ffd58ee9588ad55747c9250cdae902831bb9e0 /legacy/evas/src/lib/engines
parenta0141e0afd741d8886afd71a81d00e402501d043 (diff)
evas: fix clipping issue with pipe rendering.
SVN revision: 73322
Diffstat (limited to 'legacy/evas/src/lib/engines')
-rw-r--r--legacy/evas/src/lib/engines/common/evas_font_draw.c49
-rw-r--r--legacy/evas/src/lib/engines/common/evas_pipe.c15
-rw-r--r--legacy/evas/src/lib/engines/common/evas_rectangle_main.c4
-rw-r--r--legacy/evas/src/lib/engines/common/evas_scale_sample.c2
-rw-r--r--legacy/evas/src/lib/engines/common/evas_scale_smooth.c2
5 files changed, 22 insertions, 50 deletions
diff --git a/legacy/evas/src/lib/engines/common/evas_font_draw.c b/legacy/evas/src/lib/engines/common/evas_font_draw.c
index d256cb1fd4..6f0b6e7aa2 100644
--- a/legacy/evas/src/lib/engines/common/evas_font_draw.c
+++ b/legacy/evas/src/lib/engines/common/evas_font_draw.c
@@ -382,9 +382,13 @@ evas_common_font_draw_do(const Cutout_Rects *reuse, const Eina_Rectangle *clip,
382 382
383 if (!reuse) 383 if (!reuse)
384 { 384 {
385 evas_common_draw_context_set_clip(dc, clip->x, clip->y, clip->w, clip->h); 385 evas_common_draw_context_clip_clip(dc,
386 clip->x, clip->y,
387 clip->w, clip->h);
386 evas_common_font_draw_internal(dst, dc, x, y, text_props, 388 evas_common_font_draw_internal(dst, dc, x, y, text_props,
387 func, clip->x, clip->y, clip->w, clip->h, 389 func,
390 dc->clip.x, dc->clip.y,
391 dc->clip.w, dc->clip.h,
388 im_w, im_h); 392 im_w, im_h);
389 return ; 393 return ;
390 } 394 }
@@ -393,7 +397,7 @@ evas_common_font_draw_do(const Cutout_Rects *reuse, const Eina_Rectangle *clip,
393 { 397 {
394 r = reuse->rects + i; 398 r = reuse->rects + i;
395 399
396 EINA_RECTANGLE_SET(&area, r->x, r->y, r->w, r->h); 400 EINA_RECTANGLE_SET(&area, r->x, r->y, r->w - 1, r->h - 1);
397 if (!eina_rectangle_intersection(&area, clip)) continue ; 401 if (!eina_rectangle_intersection(&area, clip)) continue ;
398 evas_common_draw_context_set_clip(dc, area.x, area.y, area.w, area.h); 402 evas_common_draw_context_set_clip(dc, area.x, area.y, area.w, area.h);
399 evas_common_font_draw_internal(dst, dc, x, y, text_props, 403 evas_common_font_draw_internal(dst, dc, x, y, text_props,
@@ -405,7 +409,6 @@ evas_common_font_draw_do(const Cutout_Rects *reuse, const Eina_Rectangle *clip,
405EAPI Eina_Bool 409EAPI Eina_Bool
406evas_common_font_draw_prepare_cutout(Cutout_Rects *reuse, RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Gfx_Func *func) 410evas_common_font_draw_prepare_cutout(Cutout_Rects *reuse, RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Gfx_Func *func)
407{ 411{
408 int ext_x, ext_y, ext_w, ext_h;
409 int im_w, im_h; 412 int im_w, im_h;
410 413
411 im_w = dst->cache_entry.w; 414 im_w = dst->cache_entry.w;
@@ -413,43 +416,13 @@ evas_common_font_draw_prepare_cutout(Cutout_Rects *reuse, RGBA_Image *dst, RGBA_
413 416
414 *func = evas_common_gfx_func_composite_mask_color_span_get(dc->col.col, dst, 1, dc->render_op); 417 *func = evas_common_gfx_func_composite_mask_color_span_get(dc->col.col, dst, 1, dc->render_op);
415 418
416 ext_x = 0; ext_y = 0; ext_w = im_w; ext_h = im_h; 419 evas_common_draw_context_clip_clip(dc, 0, 0, im_w, im_h);
417 if (dc->clip.use) 420 if (dc->clip.w <= 0) return EINA_FALSE;
418 { 421 if (dc->clip.h <= 0) return EINA_FALSE;
419 ext_x = dc->clip.x;
420 ext_y = dc->clip.y;
421 ext_w = dc->clip.w;
422 ext_h = dc->clip.h;
423 if (ext_x < 0)
424 {
425 ext_w += ext_x;
426 ext_x = 0;
427 }
428 if (ext_y < 0)
429 {
430 ext_h += ext_y;
431 ext_y = 0;
432 }
433 if ((ext_x + ext_w) > im_w)
434 ext_w = im_w - ext_x;
435 if ((ext_y + ext_h) > im_h)
436 ext_h = im_h - ext_y;
437 }
438 if (ext_w <= 0) return EINA_FALSE;
439 if (ext_h <= 0) return EINA_FALSE;
440 422
441 if (dc->cutout.rects) 423 if (dc->cutout.rects)
442 { 424 {
443 evas_common_draw_context_clip_clip(dc, 0, 0, dst->cache_entry.w, dst->cache_entry.h); 425 reuse = evas_common_draw_context_apply_cutouts(dc, reuse);
444 /* our clip is 0 size.. abort */
445 if ((dc->clip.w > 0) && (dc->clip.h > 0))
446 {
447 reuse = evas_common_draw_context_apply_cutouts(dc, reuse);
448 }
449 else
450 {
451 return EINA_FALSE;
452 }
453 } 426 }
454 427
455 return EINA_TRUE; 428 return EINA_TRUE;
diff --git a/legacy/evas/src/lib/engines/common/evas_pipe.c b/legacy/evas/src/lib/engines/common/evas_pipe.c
index 44bfc71307..946a29341a 100644
--- a/legacy/evas/src/lib/engines/common/evas_pipe.c
+++ b/legacy/evas/src/lib/engines/common/evas_pipe.c
@@ -287,14 +287,12 @@ evas_common_pipe_rectangle_draw_do(RGBA_Image *dst, const RGBA_Pipe_Op *op, cons
287static Eina_Bool 287static Eina_Bool
288evas_common_pipe_rectangle_prepare(void *data, RGBA_Image *dst, RGBA_Pipe_Op *op) 288evas_common_pipe_rectangle_prepare(void *data, RGBA_Image *dst, RGBA_Pipe_Op *op)
289{ 289{
290 RGBA_Draw_Context context;
291 Cutout_Rects *recycle; 290 Cutout_Rects *recycle;
292 Thinfo *info = data; 291 Thinfo *info = data;
293 Eina_Bool r; 292 Eina_Bool r;
294 293
295 recycle = evas_pipe_cutout_rects_pop(info); 294 recycle = evas_pipe_cutout_rects_pop(info);
296 memcpy(&(context), &(op->context), sizeof(RGBA_Draw_Context)); 295 r = evas_common_rectangle_draw_prepare(recycle, dst, &(op->context),
297 r = evas_common_rectangle_draw_prepare(recycle, dst, &context,
298 op->op.rect.x, op->op.rect.y, 296 op->op.rect.x, op->op.rect.y,
299 op->op.rect.w, op->op.rect.h); 297 op->op.rect.w, op->op.rect.h);
300 if (recycle->active) op->rects = recycle; 298 if (recycle->active) op->rects = recycle;
@@ -436,14 +434,13 @@ evas_common_pipe_text_draw_do(RGBA_Image *dst, const RGBA_Pipe_Op *op, const RGB
436static Eina_Bool 434static Eina_Bool
437evas_common_pipe_text_draw_prepare(void *data, RGBA_Image *dst, RGBA_Pipe_Op *op) 435evas_common_pipe_text_draw_prepare(void *data, RGBA_Image *dst, RGBA_Pipe_Op *op)
438{ 436{
439 RGBA_Draw_Context context;
440 Cutout_Rects *recycle; 437 Cutout_Rects *recycle;
441 Thinfo *info = data; 438 Thinfo *info = data;
442 Eina_Bool r; 439 Eina_Bool r;
443 440
444 recycle = evas_pipe_cutout_rects_pop(info); 441 recycle = evas_pipe_cutout_rects_pop(info);
445 memcpy(&(context), &(op->context), sizeof(RGBA_Draw_Context)); 442 r = evas_common_font_draw_prepare_cutout(recycle, dst, &(op->context),
446 r = evas_common_font_draw_prepare_cutout(recycle, dst, &context, &(op->op.text.func)); 443 &(op->op.text.func));
447 if (recycle->active) op->rects = recycle; 444 if (recycle->active) op->rects = recycle;
448 else evas_pipe_cutout_rects_push(info, recycle); 445 else evas_pipe_cutout_rects_push(info, recycle);
449 446
@@ -485,14 +482,14 @@ evas_common_pipe_op_image_free(RGBA_Pipe_Op *op)
485static Eina_Bool 482static Eina_Bool
486evas_common_pipe_op_image_prepare(void *data, RGBA_Image *dst, RGBA_Pipe_Op *op) 483evas_common_pipe_op_image_prepare(void *data, RGBA_Image *dst, RGBA_Pipe_Op *op)
487{ 484{
488 RGBA_Draw_Context context;
489 Cutout_Rects *recycle; 485 Cutout_Rects *recycle;
490 Thinfo *info = data; 486 Thinfo *info = data;
491 Eina_Bool r; 487 Eina_Bool r;
492 488
493 recycle = evas_pipe_cutout_rects_pop(info); 489 recycle = evas_pipe_cutout_rects_pop(info);
494 memcpy(&(context), &(op->context), sizeof(RGBA_Draw_Context)); 490 r = evas_common_scale_rgba_in_to_out_clip_prepare(recycle,
495 r = evas_common_scale_rgba_in_to_out_clip_prepare(recycle, op->op.image.src, dst, &(context), 491 op->op.image.src, dst,
492 &(op->context),
496 op->op.image.dx, op->op.image.dy, 493 op->op.image.dx, op->op.image.dy,
497 op->op.image.dw, op->op.image.dh); 494 op->op.image.dw, op->op.image.dh);
498 if (recycle->active) op->rects = recycle; 495 if (recycle->active) op->rects = recycle;
diff --git a/legacy/evas/src/lib/engines/common/evas_rectangle_main.c b/legacy/evas/src/lib/engines/common/evas_rectangle_main.c
index 40747613b9..33fb053ac9 100644
--- a/legacy/evas/src/lib/engines/common/evas_rectangle_main.c
+++ b/legacy/evas/src/lib/engines/common/evas_rectangle_main.c
@@ -80,7 +80,9 @@ evas_common_rectangle_draw_do(const Cutout_Rects *reuse,
80 80
81 if (!reuse) 81 if (!reuse)
82 { 82 {
83 evas_common_draw_context_set_clip(dc, clip->x, clip->y, clip->w, clip->h); 83 evas_common_draw_context_clip_clip(dc,
84 clip->x, clip->y,
85 clip->w, clip->h);
84 rectangle_draw_internal(dst, dc, x, y, w, h); 86 rectangle_draw_internal(dst, dc, x, y, w, h);
85 return ; 87 return ;
86 } 88 }
diff --git a/legacy/evas/src/lib/engines/common/evas_scale_sample.c b/legacy/evas/src/lib/engines/common/evas_scale_sample.c
index ea1061802d..5e34a37825 100644
--- a/legacy/evas/src/lib/engines/common/evas_scale_sample.c
+++ b/legacy/evas/src/lib/engines/common/evas_scale_sample.c
@@ -109,7 +109,7 @@ evas_common_scale_rgba_in_to_out_clip_sample_do(const Cutout_Rects *reuse,
109 109
110 if (!reuse) 110 if (!reuse)
111 { 111 {
112 evas_common_draw_context_set_clip(dc, clip->x, clip->y, clip->w, clip->h); 112 evas_common_draw_context_clip_clip(dc, clip->x, clip->y, clip->w, clip->h);
113 scale_rgba_in_to_out_clip_sample_internal(src, dst, dc, 113 scale_rgba_in_to_out_clip_sample_internal(src, dst, dc,
114 src_region_x, src_region_y, 114 src_region_x, src_region_y,
115 src_region_w, src_region_h, 115 src_region_w, src_region_h,
diff --git a/legacy/evas/src/lib/engines/common/evas_scale_smooth.c b/legacy/evas/src/lib/engines/common/evas_scale_smooth.c
index ca852033c8..a3cb379069 100644
--- a/legacy/evas/src/lib/engines/common/evas_scale_smooth.c
+++ b/legacy/evas/src/lib/engines/common/evas_scale_smooth.c
@@ -551,7 +551,7 @@ evas_common_scale_rgba_in_to_out_clip_smooth_do(const Cutout_Rects *reuse,
551# endif 551# endif
552 if (!reuse) 552 if (!reuse)
553 { 553 {
554 evas_common_draw_context_set_clip(dc, clip->x, clip->y, clip->w, clip->h); 554 evas_common_draw_context_clip_clip(dc, clip->x, clip->y, clip->w, clip->h);
555# ifdef BUILD_MMX 555# ifdef BUILD_MMX
556 if (mmx) 556 if (mmx)
557 evas_common_scale_rgba_in_to_out_clip_smooth_mmx(src, dst, dc, 557 evas_common_scale_rgba_in_to_out_clip_smooth_mmx(src, dst, dc,