forked from enlightenment/efl
pager urgent popup patch - good
evas clipouts less allocs patch - definite spedusp for when it's used heavily! SVN revision: 29331
This commit is contained in:
parent
7827e2c598
commit
5ac7b84136
|
@ -1,5 +1,57 @@
|
||||||
#include "evas_common.h"
|
#include "evas_common.h"
|
||||||
|
|
||||||
|
EAPI Cutout_Rects*
|
||||||
|
evas_common_draw_context_cutouts_new()
|
||||||
|
{
|
||||||
|
Cutout_Rects *rects;
|
||||||
|
|
||||||
|
rects = malloc(sizeof(Cutout_Rects));
|
||||||
|
rects->rects = NULL;
|
||||||
|
rects->active = 0;
|
||||||
|
rects->max = 0;
|
||||||
|
|
||||||
|
return rects;
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
evas_common_draw_context_cutouts_free(Cutout_Rects* rects)
|
||||||
|
{
|
||||||
|
rects->active = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI Cutout_Rect*
|
||||||
|
evas_common_draw_context_cutouts_add(Cutout_Rects* rects,
|
||||||
|
int x, int y, int w, int h)
|
||||||
|
{
|
||||||
|
Cutout_Rect* rect;
|
||||||
|
|
||||||
|
if (rects->max < rects->active + 1) {
|
||||||
|
rects->max += 8;
|
||||||
|
rects->rects = realloc(rects->rects, sizeof(Cutout_Rect) * rects->max);
|
||||||
|
}
|
||||||
|
|
||||||
|
rect = rects->rects + rects->active++;
|
||||||
|
rect->x = x;
|
||||||
|
rect->y = y;
|
||||||
|
rect->w = w;
|
||||||
|
rect->h = h;
|
||||||
|
|
||||||
|
return rect;
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
evas_common_draw_context_cutouts_del(Cutout_Rects* rects,
|
||||||
|
int index)
|
||||||
|
{
|
||||||
|
if (index >= 0 && index < rects->active)
|
||||||
|
{
|
||||||
|
Cutout_Rect* rect = rects->rects + index;
|
||||||
|
|
||||||
|
memmove(rect, rect + 1, sizeof (Cutout_Rect) * (rects->active - index - 1));
|
||||||
|
rects->active--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
evas_common_init(void)
|
evas_common_init(void)
|
||||||
{
|
{
|
||||||
|
@ -43,9 +95,16 @@ evas_common_draw_context_new(void)
|
||||||
EAPI void
|
EAPI void
|
||||||
evas_common_draw_context_free(RGBA_Draw_Context *dc)
|
evas_common_draw_context_free(RGBA_Draw_Context *dc)
|
||||||
{
|
{
|
||||||
|
evas_common_draw_context_apply_clean_cutouts(&dc->cutout);
|
||||||
free(dc);
|
free(dc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
evas_common_draw_context_clear_cutouts(RGBA_Draw_Context *dc)
|
||||||
|
{
|
||||||
|
evas_common_draw_context_apply_clean_cutouts(&dc->cutout);
|
||||||
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
evas_common_draw_context_font_ext_set(RGBA_Draw_Context *dc,
|
evas_common_draw_context_font_ext_set(RGBA_Draw_Context *dc,
|
||||||
void *data,
|
void *data,
|
||||||
|
@ -115,113 +174,34 @@ evas_common_draw_context_unset_multiplier(RGBA_Draw_Context *dc)
|
||||||
EAPI void
|
EAPI void
|
||||||
evas_common_draw_context_add_cutout(RGBA_Draw_Context *dc, int x, int y, int w, int h)
|
evas_common_draw_context_add_cutout(RGBA_Draw_Context *dc, int x, int y, int w, int h)
|
||||||
{
|
{
|
||||||
Cutout_Rect *r;
|
evas_common_draw_context_cutouts_add(&dc->cutout, x, y, w, h);
|
||||||
|
|
||||||
r = calloc(1, sizeof(Cutout_Rect));
|
|
||||||
r->x = x;
|
|
||||||
r->y = y;
|
|
||||||
r->w = w;
|
|
||||||
r->h = h;
|
|
||||||
dc->cutout.rects = evas_object_list_append(dc->cutout.rects, r);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
int
|
||||||
evas_common_draw_context_clear_cutouts(RGBA_Draw_Context *dc)
|
evas_common_draw_context_cutout_split(Cutout_Rects* res, int index, Cutout_Rect *split)
|
||||||
{
|
|
||||||
evas_common_draw_context_apply_free_cutouts(dc->cutout.rects);
|
|
||||||
dc->cutout.rects = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
EAPI Cutout_Rect *
|
|
||||||
evas_common_draw_context_apply_cutouts(RGBA_Draw_Context *dc)
|
|
||||||
{
|
|
||||||
Cutout_Rect *r, *rects;
|
|
||||||
Evas_Object_List *l;
|
|
||||||
|
|
||||||
if (!dc->clip.use) return NULL;
|
|
||||||
if ((dc->clip.w <= 0) || (dc->clip.h <= 0)) return NULL;
|
|
||||||
r = calloc(1, sizeof(Cutout_Rect));
|
|
||||||
r->x = dc->clip.x;
|
|
||||||
r->y = dc->clip.y;
|
|
||||||
r->w = dc->clip.w;
|
|
||||||
r->h = dc->clip.h;
|
|
||||||
rects = r;
|
|
||||||
for (l = (Evas_Object_List *)dc->cutout.rects; l; l = l->next)
|
|
||||||
{
|
|
||||||
r = (Cutout_Rect *)l;
|
|
||||||
rects = evas_common_draw_context_cutouts_split(rects, r);
|
|
||||||
}
|
|
||||||
return rects;
|
|
||||||
}
|
|
||||||
|
|
||||||
EAPI void
|
|
||||||
evas_common_draw_context_apply_free_cutouts(Cutout_Rect *rects)
|
|
||||||
{
|
|
||||||
while (rects)
|
|
||||||
{
|
|
||||||
Cutout_Rect *r;
|
|
||||||
|
|
||||||
r = rects;
|
|
||||||
rects = evas_object_list_remove(rects, rects);
|
|
||||||
free(r);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
EAPI Cutout_Rect *
|
|
||||||
evas_common_draw_context_cutouts_split(Cutout_Rect *in, Cutout_Rect *split)
|
|
||||||
{
|
|
||||||
/* multiple rect in, multiple out */
|
|
||||||
Cutout_Rect *out;
|
|
||||||
Evas_Object_List *l;
|
|
||||||
|
|
||||||
out = NULL;
|
|
||||||
for (l = (Evas_Object_List *)in; l; l = l->next)
|
|
||||||
{
|
|
||||||
Cutout_Rect *r;
|
|
||||||
|
|
||||||
r = (Cutout_Rect *)l;
|
|
||||||
r = evas_common_draw_context_cutout_split(r, split);
|
|
||||||
while (r)
|
|
||||||
{
|
|
||||||
Cutout_Rect *r2;
|
|
||||||
|
|
||||||
r2 = r;
|
|
||||||
r = evas_object_list_remove(r, r);
|
|
||||||
out = evas_object_list_append(out, r2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
evas_common_draw_context_apply_free_cutouts(in);
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
|
|
||||||
EAPI Cutout_Rect *
|
|
||||||
evas_common_draw_context_cutout_split(Cutout_Rect *in, Cutout_Rect *split)
|
|
||||||
{
|
{
|
||||||
/* 1 input rect, multiple out */
|
/* 1 input rect, multiple out */
|
||||||
Cutout_Rect *out;
|
Cutout_Rect in = res->rects[index];
|
||||||
Cutout_Rect *r;
|
|
||||||
|
|
||||||
/* this is to save me a LOT of typing */
|
/* this is to save me a LOT of typing */
|
||||||
#define INX1 (in->x)
|
#define INX1 (in.x)
|
||||||
#define INX2 (in->x + in->w)
|
#define INX2 (in.x + in.w)
|
||||||
#define SPX1 (split->x)
|
#define SPX1 (split->x)
|
||||||
#define SPX2 (split->x + split->w)
|
#define SPX2 (split->x + split->w)
|
||||||
#define INY1 (in->y)
|
#define INY1 (in.y)
|
||||||
#define INY2 (in->y + in->h)
|
#define INY2 (in.y + in.h)
|
||||||
#define SPY1 (split->y)
|
#define SPY1 (split->y)
|
||||||
#define SPY2 (split->y + split->h)
|
#define SPY2 (split->y + split->h)
|
||||||
#define X1_IN (in->x < split->x)
|
#define X1_IN (in.x < split->x)
|
||||||
#define X2_IN ((in->x + in->w) > (split->x + split->w))
|
#define X2_IN ((in.x + in.w) > (split->x + split->w))
|
||||||
#define Y1_IN (in->y < split->y)
|
#define Y1_IN (in.y < split->y)
|
||||||
#define Y2_IN ((in->y + in->h) > (split->y + split->h))
|
#define Y2_IN ((in.y + in.h) > (split->y + split->h))
|
||||||
#define R_NEW(_r, _x, _y, _w, _h) {(_r) = calloc(1, sizeof(Cutout_Rect)); (_r)->x = (_x); (_r)->y = (_y); (_r)->w = (_w); (_r)->h = (_h);}
|
#define R_NEW(_r, _x, _y, _w, _h) { evas_common_draw_context_cutouts_add(_r, _x, _y, _w, _h); }
|
||||||
out = NULL;
|
if (!RECTS_INTERSECT(in.x, in.y, in.w, in.h,
|
||||||
if (!RECTS_INTERSECT(in->x, in->y, in->w, in->h,
|
|
||||||
split->x, split->y, split->w, split->h))
|
split->x, split->y, split->w, split->h))
|
||||||
{
|
{
|
||||||
R_NEW(r, in->x, in->y, in->w, in->h);
|
/* No colision => no clipping, don't touch it. */
|
||||||
out = evas_object_list_append(out, r);
|
return 1;
|
||||||
return out;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* S = split (ie cut out rect) */
|
/* S = split (ie cut out rect) */
|
||||||
|
@ -237,15 +217,13 @@ evas_common_draw_context_cutout_split(Cutout_Rect *in, Cutout_Rect *split)
|
||||||
*/
|
*/
|
||||||
if (X1_IN && X2_IN && Y1_IN && Y2_IN)
|
if (X1_IN && X2_IN && Y1_IN && Y2_IN)
|
||||||
{
|
{
|
||||||
R_NEW(r, in->x, in->y, in->w, SPY1 - in->y);
|
R_NEW(res, in.x, in.y, in.w, SPY1 - in.y);
|
||||||
out = evas_object_list_append(out, r);
|
R_NEW(res, in.x, SPY1, SPX1 - in.x, SPY2 - SPY1);
|
||||||
R_NEW(r, in->x, SPY1, SPX1 - in->x, SPY2 - SPY1);
|
R_NEW(res, SPX2, SPY1, INX2 - SPX2, SPY2 - SPY1);
|
||||||
out = evas_object_list_append(out, r);
|
/* out => (in.x, SPY2, in.w, INY2 - SPY2) */
|
||||||
R_NEW(r, SPX2, SPY1, INX2 - SPX2, SPY2 - SPY1);
|
res->rects[index].h = INY2 - SPY2;
|
||||||
out = evas_object_list_append(out, r);
|
res->rects[index].y = SPY2;
|
||||||
R_NEW(r, in->x, SPY2, in->w, INY2 - SPY2);
|
return 1;
|
||||||
out = evas_object_list_append(out, r);
|
|
||||||
return out;
|
|
||||||
}
|
}
|
||||||
/* SSSSSSS
|
/* SSSSSSS
|
||||||
* S+---+S
|
* S+---+S
|
||||||
|
@ -257,7 +235,8 @@ evas_common_draw_context_cutout_split(Cutout_Rect *in, Cutout_Rect *split)
|
||||||
*/
|
*/
|
||||||
if (!X1_IN && !X2_IN && !Y1_IN && !Y2_IN)
|
if (!X1_IN && !X2_IN && !Y1_IN && !Y2_IN)
|
||||||
{
|
{
|
||||||
return NULL;
|
evas_common_draw_context_cutouts_del(res, index);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
/* SSS
|
/* SSS
|
||||||
* S+---+
|
* S+---+
|
||||||
|
@ -269,9 +248,10 @@ evas_common_draw_context_cutout_split(Cutout_Rect *in, Cutout_Rect *split)
|
||||||
*/
|
*/
|
||||||
if (!X1_IN && X2_IN && !Y1_IN && !Y2_IN)
|
if (!X1_IN && X2_IN && !Y1_IN && !Y2_IN)
|
||||||
{
|
{
|
||||||
R_NEW(r, SPX2, in->y, INX2 - SPX2, in->h);
|
/* in => (SPX2, in.y, INX2 - SPX2, in.h) */
|
||||||
out = evas_object_list_append(out, r);
|
res->rects[index].w = INX2 - SPX2;
|
||||||
return out;
|
res->rects[index].x = SPX2;
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
/* S
|
/* S
|
||||||
* +---+
|
* +---+
|
||||||
|
@ -283,11 +263,11 @@ evas_common_draw_context_cutout_split(Cutout_Rect *in, Cutout_Rect *split)
|
||||||
*/
|
*/
|
||||||
if (X1_IN && X2_IN && !Y1_IN && !Y2_IN)
|
if (X1_IN && X2_IN && !Y1_IN && !Y2_IN)
|
||||||
{
|
{
|
||||||
R_NEW(r, in->x, in->y, SPX1 - in->x, in->h);
|
R_NEW(res, in.x, in.y, SPX1 - in.x, in.h);
|
||||||
out = evas_object_list_append(out, r);
|
/* in => (SPX2, in.y, INX2 - SPX2, in.h) */
|
||||||
R_NEW(r, SPX2, in->y, INX2 - SPX2, in->h);
|
res->rects[index].w = INX2 - SPX2;
|
||||||
out = evas_object_list_append(out, r);
|
res->rects[index].x = SPX2;
|
||||||
return out;
|
return 1;
|
||||||
}
|
}
|
||||||
/* SSS
|
/* SSS
|
||||||
* +---+S
|
* +---+S
|
||||||
|
@ -299,9 +279,9 @@ evas_common_draw_context_cutout_split(Cutout_Rect *in, Cutout_Rect *split)
|
||||||
*/
|
*/
|
||||||
if (X1_IN && !X2_IN && !Y1_IN && !Y2_IN)
|
if (X1_IN && !X2_IN && !Y1_IN && !Y2_IN)
|
||||||
{
|
{
|
||||||
R_NEW(r, in->x, in->y, SPX1 - in->x, in->h);
|
/* in => (in.x, in.y, SPX1 - in.x, in.h) */
|
||||||
out = evas_object_list_append(out, r);
|
res->rects[index].w = SPX1 - in.x;
|
||||||
return out;
|
return 1;
|
||||||
}
|
}
|
||||||
/* SSSSSSS
|
/* SSSSSSS
|
||||||
* S+---+S
|
* S+---+S
|
||||||
|
@ -313,9 +293,10 @@ evas_common_draw_context_cutout_split(Cutout_Rect *in, Cutout_Rect *split)
|
||||||
*/
|
*/
|
||||||
if (!X1_IN && !X2_IN && !Y1_IN && Y2_IN)
|
if (!X1_IN && !X2_IN && !Y1_IN && Y2_IN)
|
||||||
{
|
{
|
||||||
R_NEW(r, in->x, SPY2, in->w, INY2 - SPY2);
|
/* in => (in.x, SPY2, in.w, INY2 - SPY2) */
|
||||||
out = evas_object_list_append(out, r);
|
res->rects[index].h = INY2 - SPY2;
|
||||||
return out;
|
res->rects[index].y = SPY2;
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* +---+
|
* +---+
|
||||||
|
@ -327,11 +308,10 @@ evas_common_draw_context_cutout_split(Cutout_Rect *in, Cutout_Rect *split)
|
||||||
*/
|
*/
|
||||||
if (!X1_IN && !X2_IN && Y1_IN && Y2_IN)
|
if (!X1_IN && !X2_IN && Y1_IN && Y2_IN)
|
||||||
{
|
{
|
||||||
R_NEW(r, in->x, in->y, in->w, SPY1 - in->y);
|
R_NEW(res, in.x, SPY2, in.w, INY2 - SPY2);
|
||||||
out = evas_object_list_append(out, r);
|
/* in => (in.x, in.y, in.w, SPY1 - in.y) */
|
||||||
R_NEW(r, in->x, SPY2, in->w, INY2 - SPY2);
|
res->rects[index].h = SPY1 - in.y;
|
||||||
out = evas_object_list_append(out, r);
|
return 1;
|
||||||
return out;
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* +---+
|
* +---+
|
||||||
|
@ -343,9 +323,9 @@ evas_common_draw_context_cutout_split(Cutout_Rect *in, Cutout_Rect *split)
|
||||||
*/
|
*/
|
||||||
if (!X1_IN && !X2_IN && Y1_IN && !Y2_IN)
|
if (!X1_IN && !X2_IN && Y1_IN && !Y2_IN)
|
||||||
{
|
{
|
||||||
R_NEW(r, in->x, in->y, in->w, SPY1 - in->y);
|
/* in => (in.x, in.y, in.w, SPY1 - in.y) */
|
||||||
out = evas_object_list_append(out, r);
|
res->rects[index].h = SPY1 - in.y;
|
||||||
return out;
|
return 1;
|
||||||
}
|
}
|
||||||
/* SSS
|
/* SSS
|
||||||
* S+---+
|
* S+---+
|
||||||
|
@ -357,11 +337,11 @@ evas_common_draw_context_cutout_split(Cutout_Rect *in, Cutout_Rect *split)
|
||||||
*/
|
*/
|
||||||
if (!X1_IN && X2_IN && !Y1_IN && Y2_IN)
|
if (!X1_IN && X2_IN && !Y1_IN && Y2_IN)
|
||||||
{
|
{
|
||||||
R_NEW(r, SPX2, in->y, INX2 - SPX2, SPY2 - in->y);
|
R_NEW(res, SPX2, in.y, INX2 - SPX2, SPY2 - in.y);
|
||||||
out = evas_object_list_append(out, r);
|
/* in => (in.x, SPY2, in.w, INY2 - SPY2) */
|
||||||
R_NEW(r, in->x, SPY2, in->w, INY2 - SPY2);
|
res->rects[index].h = INY2 - SPY2;
|
||||||
out = evas_object_list_append(out, r);
|
res->rects[index].y = SPY2;
|
||||||
return out;
|
return 1;
|
||||||
}
|
}
|
||||||
/* S
|
/* S
|
||||||
* +---+
|
* +---+
|
||||||
|
@ -373,13 +353,12 @@ evas_common_draw_context_cutout_split(Cutout_Rect *in, Cutout_Rect *split)
|
||||||
*/
|
*/
|
||||||
if (X1_IN && X2_IN && !Y1_IN && Y2_IN)
|
if (X1_IN && X2_IN && !Y1_IN && Y2_IN)
|
||||||
{
|
{
|
||||||
R_NEW(r, in->x, in->y, SPX1 - in->x, SPY2 - in->y);
|
R_NEW(res, in.x, in.y, SPX1 - in.x, SPY2 - in.y);
|
||||||
out = evas_object_list_append(out, r);
|
R_NEW(res, SPX2, in.y, INX2 - SPX2, SPY2 - in.y);
|
||||||
R_NEW(r, SPX2, in->y, INX2 - SPX2, SPY2 - in->y);
|
/* in => (in.x, SPY2, in.w, INY2 - SPY2) */
|
||||||
out = evas_object_list_append(out, r);
|
res->rects[index].h = INY2 - SPY2;
|
||||||
R_NEW(r, in->x, SPY2, in->w, INY2 - SPY2);
|
res->rects[index].y = SPY2;
|
||||||
out = evas_object_list_append(out, r);
|
return 1;
|
||||||
return out;
|
|
||||||
}
|
}
|
||||||
/* SSS
|
/* SSS
|
||||||
* +---+S
|
* +---+S
|
||||||
|
@ -391,11 +370,11 @@ evas_common_draw_context_cutout_split(Cutout_Rect *in, Cutout_Rect *split)
|
||||||
*/
|
*/
|
||||||
if (X1_IN && !X2_IN && !Y1_IN && Y2_IN)
|
if (X1_IN && !X2_IN && !Y1_IN && Y2_IN)
|
||||||
{
|
{
|
||||||
R_NEW(r, in->x, in->y, SPX1 - in->x, SPY2 - in->y);
|
R_NEW(res, in.x, in.y, SPX1 - in.x, SPY2 - in.y);
|
||||||
out = evas_object_list_append(out, r);
|
/* in => (in.x, SPY2, in.w, INY2 - SPY2) */
|
||||||
R_NEW(r, in->x, SPY2, in->w, INY2 - SPY2);
|
res->rects[index].h = INY2 - SPY2;
|
||||||
out = evas_object_list_append(out, r);
|
res->rects[index].y = SPY2;
|
||||||
return out;
|
return 1;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* +---+
|
* +---+
|
||||||
|
@ -407,13 +386,11 @@ evas_common_draw_context_cutout_split(Cutout_Rect *in, Cutout_Rect *split)
|
||||||
*/
|
*/
|
||||||
if (!X1_IN && X2_IN && Y1_IN && Y2_IN)
|
if (!X1_IN && X2_IN && Y1_IN && Y2_IN)
|
||||||
{
|
{
|
||||||
R_NEW(r, in->x, in->y, in->w, SPY1 - in->y);
|
R_NEW(res, in.x, SPY2, in.w, INY2 - SPY2);
|
||||||
out = evas_object_list_append(out, r);
|
R_NEW(res, SPX2, SPY1, INX2 - SPX2, SPY2 - SPY1);
|
||||||
R_NEW(r, SPX2, SPY1, INX2 - SPX2, SPY2 - SPY1);
|
/* in => (in.x, SPY2, in.w, INY2 - SPY2) */
|
||||||
out = evas_object_list_append(out, r);
|
res->rects[index].h = SPY1 - in.y;
|
||||||
R_NEW(r, in->x, SPY2, in->w, INY2 - SPY2);
|
return 1;
|
||||||
out = evas_object_list_append(out, r);
|
|
||||||
return out;
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* +---+
|
* +---+
|
||||||
|
@ -425,13 +402,11 @@ evas_common_draw_context_cutout_split(Cutout_Rect *in, Cutout_Rect *split)
|
||||||
*/
|
*/
|
||||||
if (X1_IN && !X2_IN && Y1_IN && Y2_IN)
|
if (X1_IN && !X2_IN && Y1_IN && Y2_IN)
|
||||||
{
|
{
|
||||||
R_NEW(r, in->x, in->y, in->w, SPY1 - in->y);
|
R_NEW(res, in.x, SPY2, in.w, INY2 - SPY2);
|
||||||
out = evas_object_list_append(out, r);
|
R_NEW(res, in.x, SPY1, SPX1 - in.x, SPY2 - SPY1);
|
||||||
R_NEW(r, in->x, SPY1, SPX1 - in->x, SPY2 - SPY1);
|
/* in => (in.x, in.y, in.w, SPY1 - in.y) */
|
||||||
out = evas_object_list_append(out, r);
|
res->rects[index].h = SPY1 - in.y;
|
||||||
R_NEW(r, in->x, SPY2, in->w, INY2 - SPY2);
|
return 1;
|
||||||
out = evas_object_list_append(out, r);
|
|
||||||
return out;
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* +---+
|
* +---+
|
||||||
|
@ -443,11 +418,10 @@ evas_common_draw_context_cutout_split(Cutout_Rect *in, Cutout_Rect *split)
|
||||||
*/
|
*/
|
||||||
if (!X1_IN && X2_IN && Y1_IN && !Y2_IN)
|
if (!X1_IN && X2_IN && Y1_IN && !Y2_IN)
|
||||||
{
|
{
|
||||||
R_NEW(r, in->x, in->y, in->w, SPY1 - in->y);
|
R_NEW(res, SPX2, SPY1, INX2 - SPX2, INY2 - SPY1);
|
||||||
out = evas_object_list_append(out, r);
|
/* in => (in.x, in.y, in.w, SPY1 - in.y) */
|
||||||
R_NEW(r, SPX2, SPY1, INX2 - SPX2, INY2 - SPY1);
|
res->rects[index].h = SPY1 - in.y;
|
||||||
out = evas_object_list_append(out, r);
|
return 1;
|
||||||
return out;
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* +---+
|
* +---+
|
||||||
|
@ -459,13 +433,11 @@ evas_common_draw_context_cutout_split(Cutout_Rect *in, Cutout_Rect *split)
|
||||||
*/
|
*/
|
||||||
if (X1_IN && X2_IN && Y1_IN && !Y2_IN)
|
if (X1_IN && X2_IN && Y1_IN && !Y2_IN)
|
||||||
{
|
{
|
||||||
R_NEW(r, in->x, in->y, in->w, SPY1 - in->y);
|
R_NEW(res, in.x, SPY1, SPX1 - in.x, INY2 - SPY1);
|
||||||
out = evas_object_list_append(out, r);
|
R_NEW(res, SPX2, SPY1, INX2 - SPX2, INY2 - SPY1);
|
||||||
R_NEW(r, in->x, SPY1, SPX1 - in->x, INY2 - SPY1);
|
/* in => (in.x, in.y, in.w, SPY1 - in.y) */
|
||||||
out = evas_object_list_append(out, r);
|
res->rects[index].h = SPY1 - in.y;
|
||||||
R_NEW(r, SPX2, SPY1, INX2 - SPX2, INY2 - SPY1);
|
return 1;
|
||||||
out = evas_object_list_append(out, r);
|
|
||||||
return out;
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* +---+
|
* +---+
|
||||||
|
@ -477,13 +449,13 @@ evas_common_draw_context_cutout_split(Cutout_Rect *in, Cutout_Rect *split)
|
||||||
*/
|
*/
|
||||||
if (X1_IN && !X2_IN && Y1_IN && !Y2_IN)
|
if (X1_IN && !X2_IN && Y1_IN && !Y2_IN)
|
||||||
{
|
{
|
||||||
R_NEW(r, in->x, in->y, in->w, SPY1 - in->y);
|
R_NEW(res, in.x, SPY1, SPX1 - in.x, INY2 - SPY1);
|
||||||
out = evas_object_list_append(out, r);
|
/* in => (in.x, in.y, in.w, SPY1 - in.y) */
|
||||||
R_NEW(r, in->x, SPY1, SPX1 - in->x, INY2 - SPY1);
|
res->rects[index].h = SPY1 - in.y;
|
||||||
out = evas_object_list_append(out, r);
|
return 1;
|
||||||
return out;
|
|
||||||
}
|
}
|
||||||
return NULL;
|
evas_common_draw_context_cutouts_del(res, index);
|
||||||
|
return 0;
|
||||||
#undef INX1
|
#undef INX1
|
||||||
#undef INX2
|
#undef INX2
|
||||||
#undef SPX1
|
#undef SPX1
|
||||||
|
@ -499,32 +471,49 @@ evas_common_draw_context_cutout_split(Cutout_Rect *in, Cutout_Rect *split)
|
||||||
#undef R_NEW
|
#undef R_NEW
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Cutout_Rect *
|
EAPI Cutout_Rects*
|
||||||
evas_common_draw_context_cutout_merge(Cutout_Rect *in, Cutout_Rect *merge)
|
evas_common_draw_context_apply_cutouts(RGBA_Draw_Context *dc)
|
||||||
{
|
{
|
||||||
/* 1 input rect, multiple out */
|
Cutout_Rects* res;
|
||||||
Cutout_Rect *out;
|
int i;
|
||||||
Cutout_Rect *r;
|
int j;
|
||||||
Evas_Object_List *l;
|
|
||||||
|
|
||||||
for (l = (Evas_Object_List *)in; l; l = l->next)
|
if (!dc->clip.use) return NULL;
|
||||||
|
if ((dc->clip.w <= 0) || (dc->clip.h <= 0)) return NULL;
|
||||||
|
|
||||||
|
res = evas_common_draw_context_cutouts_new();
|
||||||
|
evas_common_draw_context_cutouts_add(res, dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h);
|
||||||
|
|
||||||
|
for (i = 0; i < dc->cutout.active; ++i)
|
||||||
{
|
{
|
||||||
r = (Cutout_Rect *)l;
|
/* Don't loop on the element just added to the list as they are already correctly clipped. */
|
||||||
|
int active = res->active;
|
||||||
|
|
||||||
merge = evas_common_draw_context_cutouts_split(merge, r);
|
for (j = 0; j < active; )
|
||||||
if (!merge) return in;
|
{
|
||||||
|
if (evas_common_draw_context_cutout_split(res, j, dc->cutout.rects + i))
|
||||||
|
++j;
|
||||||
|
else
|
||||||
|
active--;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
r = merge;
|
return res;
|
||||||
out = in;
|
}
|
||||||
while (r)
|
|
||||||
{
|
|
||||||
Cutout_Rect *r2;
|
|
||||||
|
|
||||||
r2 = r;
|
EAPI void
|
||||||
r = evas_object_list_remove(r, r);
|
evas_common_draw_context_apply_clear_cutouts(Cutout_Rects* rects)
|
||||||
out = evas_object_list_append(out, r2);
|
{
|
||||||
}
|
evas_common_draw_context_apply_clean_cutouts(rects);
|
||||||
return out;
|
free(rects);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
evas_common_draw_context_apply_clean_cutouts(Cutout_Rects* rects)
|
||||||
|
{
|
||||||
|
free(rects->rects);
|
||||||
|
rects->rects = NULL;
|
||||||
|
rects->active = 0;
|
||||||
|
rects->max = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
|
|
|
@ -40,25 +40,14 @@ evas_common_pipe_draw_context_copy(RGBA_Draw_Context *dc, RGBA_Pipe_Op *op)
|
||||||
Cutout_Rect *r, *r2;
|
Cutout_Rect *r, *r2;
|
||||||
|
|
||||||
memcpy(&(op->context), dc, sizeof(RGBA_Draw_Context));
|
memcpy(&(op->context), dc, sizeof(RGBA_Draw_Context));
|
||||||
op->context.cutout.rects = NULL;
|
op->context.cutout.rects = malloc(sizeof(Cutout_Rect) * op->context.cutout.active);
|
||||||
for (r = dc->cutout.rects; r; r = (Cutout_Rect *)((Evas_Object_List *)r)->next)
|
memcpy(op->context.cutout.rects, dc->cutout.rects, sizeof(Cutout_Rect) * op->context.cutout.active);
|
||||||
{
|
|
||||||
r2 = calloc(1, sizeof(Cutout_Rect));
|
|
||||||
if (r2)
|
|
||||||
{
|
|
||||||
r2->x = r->x;
|
|
||||||
r2->y = r->y;
|
|
||||||
r2->w = r->w;
|
|
||||||
r2->h = r->h;
|
|
||||||
op->context.cutout.rects = evas_object_list_append(op->context.cutout.rects, r2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
evas_common_pipe_op_free(RGBA_Pipe_Op *op)
|
evas_common_pipe_op_free(RGBA_Pipe_Op *op)
|
||||||
{
|
{
|
||||||
evas_common_draw_context_apply_free_cutouts(op->context.cutout.rects);
|
evas_common_draw_context_apply_clean_cutouts(&op->context.cutout);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* main api calls */
|
/* main api calls */
|
||||||
|
|
|
@ -10,9 +10,10 @@ evas_common_rectangle_init(void)
|
||||||
EAPI void
|
EAPI void
|
||||||
evas_common_rectangle_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, int w, int h)
|
evas_common_rectangle_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, int w, int h)
|
||||||
{
|
{
|
||||||
int c, cx, cy, cw, ch;
|
Cutout_Rects *rects;
|
||||||
Cutout_Rect *rects, *r;
|
Cutout_Rect *r;
|
||||||
Evas_Object_List *l;
|
int c, cx, cy, cw, ch;
|
||||||
|
int i;
|
||||||
/* handle cutouts here! */
|
/* handle cutouts here! */
|
||||||
|
|
||||||
if ((w <= 0) || (h <= 0)) return;
|
if ((w <= 0) || (h <= 0)) return;
|
||||||
|
@ -35,13 +36,13 @@ evas_common_rectangle_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
rects = evas_common_draw_context_apply_cutouts(dc);
|
rects = evas_common_draw_context_apply_cutouts(dc);
|
||||||
for (l = (Evas_Object_List *)rects; l; l = l->next)
|
for (i = 0; i < rects->active; ++i)
|
||||||
{
|
{
|
||||||
r = (Cutout_Rect *)l;
|
r = rects->rects + i;
|
||||||
evas_common_draw_context_set_clip(dc, r->x, r->y, r->w, r->h);
|
evas_common_draw_context_set_clip(dc, r->x, r->y, r->w, r->h);
|
||||||
rectangle_draw_internal(dst, dc, x, y, w, h);
|
rectangle_draw_internal(dst, dc, x, y, w, h);
|
||||||
}
|
}
|
||||||
evas_common_draw_context_apply_free_cutouts(rects);
|
evas_common_draw_context_apply_clear_cutouts(rects);
|
||||||
/* restore clip info */
|
/* restore clip info */
|
||||||
dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; dc->clip.h = ch;
|
dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; dc->clip.h = ch;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,9 +30,10 @@ evas_common_scale_rgba_in_to_out_clip_sample(RGBA_Image *src, RGBA_Image *dst,
|
||||||
int dst_region_x, int dst_region_y,
|
int dst_region_x, int dst_region_y,
|
||||||
int dst_region_w, int dst_region_h)
|
int dst_region_w, int dst_region_h)
|
||||||
{
|
{
|
||||||
int c, cx, cy, cw, ch;
|
Cutout_Rects *rects;
|
||||||
Cutout_Rect *rects, *r;
|
Cutout_Rect *r;
|
||||||
Evas_Object_List *l;
|
int c, cx, cy, cw, ch;
|
||||||
|
int i;
|
||||||
/* handle cutouts here! */
|
/* handle cutouts here! */
|
||||||
|
|
||||||
if ((dst_region_w <= 0) || (dst_region_h <= 0)) return;
|
if ((dst_region_w <= 0) || (dst_region_h <= 0)) return;
|
||||||
|
@ -59,9 +60,9 @@ evas_common_scale_rgba_in_to_out_clip_sample(RGBA_Image *src, RGBA_Image *dst,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
rects = evas_common_draw_context_apply_cutouts(dc);
|
rects = evas_common_draw_context_apply_cutouts(dc);
|
||||||
for (l = (Evas_Object_List *)rects; l; l = l->next)
|
for (i = 0; i < rects->active; ++i)
|
||||||
{
|
{
|
||||||
r = (Cutout_Rect *)l;
|
r = rects->rects + i;
|
||||||
evas_common_draw_context_set_clip(dc, r->x, r->y, r->w, r->h);
|
evas_common_draw_context_set_clip(dc, r->x, r->y, r->w, r->h);
|
||||||
scale_rgba_in_to_out_clip_sample_internal(src, dst, dc,
|
scale_rgba_in_to_out_clip_sample_internal(src, dst, dc,
|
||||||
src_region_x, src_region_y,
|
src_region_x, src_region_y,
|
||||||
|
@ -70,7 +71,7 @@ evas_common_scale_rgba_in_to_out_clip_sample(RGBA_Image *src, RGBA_Image *dst,
|
||||||
dst_region_w, dst_region_h);
|
dst_region_w, dst_region_h);
|
||||||
|
|
||||||
}
|
}
|
||||||
evas_common_draw_context_apply_free_cutouts(rects);
|
evas_common_draw_context_apply_clear_cutouts(rects);
|
||||||
/* restore clip info */
|
/* restore clip info */
|
||||||
dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; dc->clip.h = ch;
|
dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; dc->clip.h = ch;
|
||||||
}
|
}
|
||||||
|
|
|
@ -447,9 +447,10 @@ evas_common_scale_rgba_in_to_out_clip_smooth(RGBA_Image *src, RGBA_Image *dst,
|
||||||
# ifdef BUILD_MMX
|
# ifdef BUILD_MMX
|
||||||
int mmx, sse, sse2;
|
int mmx, sse, sse2;
|
||||||
# endif
|
# endif
|
||||||
int c, cx, cy, cw, ch;
|
Cutout_Rects *rects;
|
||||||
Cutout_Rect *rects, *r;
|
Cutout_Rect *r;
|
||||||
Evas_Object_List *l;
|
int c, cx, cy, cw, ch;
|
||||||
|
int i;
|
||||||
/* handle cutouts here! */
|
/* handle cutouts here! */
|
||||||
|
|
||||||
if ((dst_region_w <= 0) || (dst_region_h <= 0)) return;
|
if ((dst_region_w <= 0) || (dst_region_h <= 0)) return;
|
||||||
|
@ -490,9 +491,9 @@ evas_common_scale_rgba_in_to_out_clip_smooth(RGBA_Image *src, RGBA_Image *dst,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
rects = evas_common_draw_context_apply_cutouts(dc);
|
rects = evas_common_draw_context_apply_cutouts(dc);
|
||||||
for (l = (Evas_Object_List *)rects; l; l = l->next)
|
for (i = 0; i < rects->active; ++i)
|
||||||
{
|
{
|
||||||
r = (Cutout_Rect *)l;
|
r = rects->rects + i;
|
||||||
evas_common_draw_context_set_clip(dc, r->x, r->y, r->w, r->h);
|
evas_common_draw_context_set_clip(dc, r->x, r->y, r->w, r->h);
|
||||||
# ifdef BUILD_MMX
|
# ifdef BUILD_MMX
|
||||||
if (mmx)
|
if (mmx)
|
||||||
|
@ -511,7 +512,7 @@ evas_common_scale_rgba_in_to_out_clip_smooth(RGBA_Image *src, RGBA_Image *dst,
|
||||||
dst_region_w, dst_region_h);
|
dst_region_w, dst_region_h);
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
evas_common_draw_context_apply_free_cutouts(rects);
|
evas_common_draw_context_apply_clear_cutouts(rects);
|
||||||
/* restore clip info */
|
/* restore clip info */
|
||||||
dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; dc->clip.h = ch;
|
dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; dc->clip.h = ch;
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,6 +140,7 @@ typedef struct _RGBA_Font_Glyph RGBA_Font_Glyph;
|
||||||
typedef struct _RGBA_Gfx_Compositor RGBA_Gfx_Compositor;
|
typedef struct _RGBA_Gfx_Compositor RGBA_Gfx_Compositor;
|
||||||
|
|
||||||
typedef struct _Cutout_Rect Cutout_Rect;
|
typedef struct _Cutout_Rect Cutout_Rect;
|
||||||
|
typedef struct _Cutout_Rects Cutout_Rects;
|
||||||
|
|
||||||
typedef struct _Convert_Pal Convert_Pal;
|
typedef struct _Convert_Pal Convert_Pal;
|
||||||
|
|
||||||
|
@ -235,6 +236,18 @@ struct _Evas_Hash_El
|
||||||
void *data;
|
void *data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct _Cutout_Rect
|
||||||
|
{
|
||||||
|
int x, y, w, h;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Cutout_Rects
|
||||||
|
{
|
||||||
|
Cutout_Rect* rects;
|
||||||
|
int active;
|
||||||
|
int max;
|
||||||
|
};
|
||||||
|
|
||||||
struct _RGBA_Draw_Context
|
struct _RGBA_Draw_Context
|
||||||
{
|
{
|
||||||
struct {
|
struct {
|
||||||
|
@ -248,9 +261,7 @@ struct _RGBA_Draw_Context
|
||||||
char use : 1;
|
char use : 1;
|
||||||
int x, y, w, h;
|
int x, y, w, h;
|
||||||
} clip;
|
} clip;
|
||||||
struct {
|
Cutout_Rects cutout;
|
||||||
Cutout_Rect *rects;
|
|
||||||
} cutout;
|
|
||||||
struct {
|
struct {
|
||||||
struct {
|
struct {
|
||||||
void *(*gl_new) (void *data, RGBA_Font_Glyph *fg);
|
void *(*gl_new) (void *data, RGBA_Font_Glyph *fg);
|
||||||
|
@ -572,11 +583,6 @@ struct _Regionspan
|
||||||
int x1, x2;
|
int x1, x2;
|
||||||
};
|
};
|
||||||
*/
|
*/
|
||||||
struct _Cutout_Rect
|
|
||||||
{
|
|
||||||
Evas_Object_List _list_data;
|
|
||||||
int x, y, w, h;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _Convert_Pal
|
struct _Convert_Pal
|
||||||
{
|
{
|
||||||
|
@ -1012,11 +1018,9 @@ EAPI void evas_common_draw_context_set_multiplier (RGBA_Draw_Co
|
||||||
EAPI void evas_common_draw_context_unset_multiplier (RGBA_Draw_Context *dc);
|
EAPI void evas_common_draw_context_unset_multiplier (RGBA_Draw_Context *dc);
|
||||||
EAPI void evas_common_draw_context_add_cutout (RGBA_Draw_Context *dc, int x, int y, int w, int h);
|
EAPI void evas_common_draw_context_add_cutout (RGBA_Draw_Context *dc, int x, int y, int w, int h);
|
||||||
EAPI void evas_common_draw_context_clear_cutouts (RGBA_Draw_Context *dc);
|
EAPI void evas_common_draw_context_clear_cutouts (RGBA_Draw_Context *dc);
|
||||||
EAPI Cutout_Rect *evas_common_draw_context_apply_cutouts (RGBA_Draw_Context *dc);
|
EAPI Cutout_Rects *evas_common_draw_context_apply_cutouts (RGBA_Draw_Context *dc);
|
||||||
EAPI void evas_common_draw_context_apply_free_cutouts(Cutout_Rect *rects);
|
EAPI void evas_common_draw_context_apply_clear_cutouts(Cutout_Rects* rects);
|
||||||
EAPI Cutout_Rect *evas_common_draw_context_cutouts_split (Cutout_Rect *in, Cutout_Rect *split);
|
EAPI void evas_common_draw_context_apply_clean_cutouts(Cutout_Rects* rects);
|
||||||
EAPI Cutout_Rect *evas_common_draw_context_cutout_split (Cutout_Rect *in, Cutout_Rect *split);
|
|
||||||
EAPI Cutout_Rect *evas_common_draw_context_cutout_merge (Cutout_Rect *in, Cutout_Rect *merge);
|
|
||||||
EAPI void evas_common_draw_context_set_anti_alias (RGBA_Draw_Context *dc, unsigned char aa);
|
EAPI void evas_common_draw_context_set_anti_alias (RGBA_Draw_Context *dc, unsigned char aa);
|
||||||
EAPI void evas_common_draw_context_set_color_interpolation(RGBA_Draw_Context *dc, int color_space);
|
EAPI void evas_common_draw_context_set_color_interpolation(RGBA_Draw_Context *dc, int color_space);
|
||||||
EAPI void evas_common_draw_context_set_render_op (RGBA_Draw_Context *dc, int op);
|
EAPI void evas_common_draw_context_set_render_op (RGBA_Draw_Context *dc, int op);
|
||||||
|
|
|
@ -596,10 +596,11 @@ void
|
||||||
evas_engine_directfb_draw_rectangle(void *data, void *context, void *surface,
|
evas_engine_directfb_draw_rectangle(void *data, void *context, void *surface,
|
||||||
int x, int y, int w, int h)
|
int x, int y, int w, int h)
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
int c, cx, cy, cw, ch;
|
int c, cx, cy, cw, ch;
|
||||||
Cutout_Rect *rects, *r;
|
Cutout_Rects *rects;
|
||||||
|
Cutout_Rect *r;
|
||||||
RGBA_Draw_Context *dc = (RGBA_Draw_Context *) context;
|
RGBA_Draw_Context *dc = (RGBA_Draw_Context *) context;
|
||||||
Evas_Object_List *l;
|
|
||||||
Render_Engine *re = (Render_Engine *) data;
|
Render_Engine *re = (Render_Engine *) data;
|
||||||
|
|
||||||
/* handle cutouts here! */
|
/* handle cutouts here! */
|
||||||
|
@ -629,13 +630,13 @@ evas_engine_directfb_draw_rectangle(void *data, void *context, void *surface,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
rects = evas_common_draw_context_apply_cutouts(dc);
|
rects = evas_common_draw_context_apply_cutouts(dc);
|
||||||
for (l = (Evas_Object_List *) rects; l; l = l->next)
|
for (i = 0; i < rects->active; ++i)
|
||||||
{
|
{
|
||||||
r = (Cutout_Rect *) l;
|
r = rects->rects + i;
|
||||||
evas_common_draw_context_set_clip(dc, r->x, r->y, r->w, r->h);
|
evas_common_draw_context_set_clip(dc, r->x, r->y, r->w, r->h);
|
||||||
rectangle_draw_internal(data, dc, x, y, w, h);
|
rectangle_draw_internal(data, dc, x, y, w, h);
|
||||||
}
|
}
|
||||||
evas_common_draw_context_apply_free_cutouts(rects);
|
evas_common_draw_context_clear_cutouts(rects);
|
||||||
/* restore clip info */
|
/* restore clip info */
|
||||||
dc->clip.use = c;
|
dc->clip.use = c;
|
||||||
dc->clip.x = cx;
|
dc->clip.x = cx;
|
||||||
|
|
|
@ -283,23 +283,23 @@ _xr_render_surface_clips_set(Xrender_Surface *rs, RGBA_Draw_Context *dc, int rx,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int i;
|
Cutout_Rects *rects;
|
||||||
Cutout_Rect *rects, *r;
|
Cutout_Rect *r;
|
||||||
Evas_Object_List *l;
|
int i;
|
||||||
|
|
||||||
rects = evas_common_draw_context_apply_cutouts(dc);
|
rects = evas_common_draw_context_apply_cutouts(dc);
|
||||||
for (num = 0, l = (Evas_Object_List *)rects; l; l = l->next) num++;
|
num = rects->active;
|
||||||
rect = malloc(num * sizeof(XRectangle));
|
rect = malloc(num * sizeof(XRectangle));
|
||||||
if (!rect) return;
|
if (!rect) return;
|
||||||
for (i = 0, l = (Evas_Object_List *)rects; l; l = l->next, i++)
|
for (i = 0; i < num; i++)
|
||||||
{
|
{
|
||||||
r = (Cutout_Rect *)l;
|
r = rects->rects + i;
|
||||||
rect[i].x = r->x;
|
rect[i].x = r->x;
|
||||||
rect[i].y = r->y;
|
rect[i].y = r->y;
|
||||||
rect[i].width = r->w;
|
rect[i].width = r->w;
|
||||||
rect[i].height = r->h;
|
rect[i].height = r->h;
|
||||||
}
|
}
|
||||||
evas_common_draw_context_apply_free_cutouts(rects);
|
evas_common_draw_context_apply_clear_cutouts(rects);
|
||||||
}
|
}
|
||||||
if (!rect) return;
|
if (!rect) return;
|
||||||
XRenderSetPictureClipRectangles(rs->xinf->disp, rs->pic, 0, 0, rect, num);
|
XRenderSetPictureClipRectangles(rs->xinf->disp, rs->pic, 0, 0, rect, num);
|
||||||
|
|
|
@ -413,23 +413,23 @@ _xr_render_surface_clips_set(Xcb_Render_Surface *rs, RGBA_Draw_Context *dc, int
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int i;
|
Cutout_Rect *rects;
|
||||||
Cutout_Rect *rects, *r;
|
Cutout_Rect *r;
|
||||||
Evas_Object_List *l;
|
int i;
|
||||||
|
|
||||||
rects = evas_common_draw_context_apply_cutouts(dc);
|
rects = evas_common_draw_context_apply_cutouts(dc);
|
||||||
for (num = 0, l = (Evas_Object_List *)rects; l; l = l->next) num++;
|
num = rects->active;
|
||||||
rect = malloc(num * sizeof(xcb_rectangle_t));
|
rect = malloc(num * sizeof(xcb_rectangle_t));
|
||||||
if (!rect) return;
|
if (!rect) return;
|
||||||
for (i = 0, l = (Evas_Object_List *)rects; l; l = l->next, i++)
|
for (i = 0; i < num; i++)
|
||||||
{
|
{
|
||||||
r = (Cutout_Rect *)l;
|
r = rects->rects + i;
|
||||||
rect[i].x = r->x;
|
rect[i].x = r->x;
|
||||||
rect[i].y = r->y;
|
rect[i].y = r->y;
|
||||||
rect[i].width = r->w;
|
rect[i].width = r->w;
|
||||||
rect[i].height = r->h;
|
rect[i].height = r->h;
|
||||||
}
|
}
|
||||||
evas_common_draw_context_apply_free_cutouts(rects);
|
evas_common_draw_context_apply_clear_cutouts(rects);
|
||||||
}
|
}
|
||||||
if (!rect) return;
|
if (!rect) return;
|
||||||
xcb_render_set_picture_clip_rectangles(rs->xcbinf->conn, rs->pic, 0, 0, num, rect);
|
xcb_render_set_picture_clip_rectangles(rs->xcbinf->conn, rs->pic, 0, 0, num, rect);
|
||||||
|
|
Loading…
Reference in New Issue