Name clip structure, make it simple to save and restore clip info.
SVN revision: 30423
This commit is contained in:
parent
10258eaf02
commit
ac04de0ffd
|
@ -262,7 +262,7 @@ struct _RGBA_Draw_Context
|
||||||
struct {
|
struct {
|
||||||
DATA32 col;
|
DATA32 col;
|
||||||
} col;
|
} col;
|
||||||
struct {
|
struct RGBA_Draw_Context_clip {
|
||||||
char use : 1;
|
char use : 1;
|
||||||
int x, y, w, h;
|
int x, y, w, h;
|
||||||
} clip;
|
} clip;
|
||||||
|
|
|
@ -429,7 +429,7 @@ soft16_image_draw(Soft16_Image *src, Soft16_Image *dst,
|
||||||
Evas_Rectangle sr, dr;
|
Evas_Rectangle sr, dr;
|
||||||
Cutout_Rects *rects;
|
Cutout_Rects *rects;
|
||||||
Cutout_Rect *r;
|
Cutout_Rect *r;
|
||||||
int c, cx, cy, cw, ch;
|
struct RGBA_Draw_Context_clip clip_bkp;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* handle cutouts here! */
|
/* handle cutouts here! */
|
||||||
|
@ -459,13 +459,13 @@ soft16_image_draw(Soft16_Image *src, Soft16_Image *dst,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* save out clip info */
|
/* save out clip info */
|
||||||
c = dc->clip.use; cx = dc->clip.x; cy = dc->clip.y; cw = dc->clip.w; ch = dc->clip.h;
|
clip_bkp = dc->clip;
|
||||||
evas_common_draw_context_clip_clip(dc, 0, 0, dst->w, dst->h);
|
evas_common_draw_context_clip_clip(dc, 0, 0, dst->w, dst->h);
|
||||||
evas_common_draw_context_clip_clip(dc, dst_region_x, dst_region_y, dst_region_w, dst_region_h);
|
evas_common_draw_context_clip_clip(dc, dst_region_x, dst_region_y, dst_region_w, dst_region_h);
|
||||||
/* our clip is 0 size.. abort */
|
/* our clip is 0 size.. abort */
|
||||||
if ((dc->clip.w <= 0) || (dc->clip.h <= 0))
|
if ((dc->clip.w <= 0) || (dc->clip.h <= 0))
|
||||||
{
|
{
|
||||||
dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; dc->clip.h = ch;
|
dc->clip = clip_bkp;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
rects = evas_common_draw_context_apply_cutouts(dc);
|
rects = evas_common_draw_context_apply_cutouts(dc);
|
||||||
|
@ -476,7 +476,6 @@ soft16_image_draw(Soft16_Image *src, Soft16_Image *dst,
|
||||||
_soft16_image_draw_sampled_int(src, dst, dc, sr, dr);
|
_soft16_image_draw_sampled_int(src, dst, dc, sr, dr);
|
||||||
}
|
}
|
||||||
evas_common_draw_context_apply_clear_cutouts(rects);
|
evas_common_draw_context_apply_clear_cutouts(rects);
|
||||||
/* restore clip info */
|
dc->clip = clip_bkp;
|
||||||
dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; dc->clip.h = ch;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue