forked from enlightenment/efl
Evas render: Fix proxy source_clip logic inversion
As spotted by @FurryMyad I inverted the logic for source_clip. This should restore the proper behaviour while keeping my previous fixes working. See D2940.
This commit is contained in:
parent
51e0bc022b
commit
7b266b5518
|
@ -1208,21 +1208,35 @@ _proxy_context_clip(Evas_Public_Data *evas, void *ctx, Evas_Proxy_Render_Data *p
|
||||||
{
|
{
|
||||||
const Evas_Coord_Rectangle *clip;
|
const Evas_Coord_Rectangle *clip;
|
||||||
Evas_Object_Protected_Data *clipper;
|
Evas_Object_Protected_Data *clipper;
|
||||||
|
int cw, ch;
|
||||||
|
|
||||||
/* cache.clip can not be relied on, since the evas is frozen, but we need
|
/* cache.clip can not be relied on, since the evas is frozen, but we need
|
||||||
* to set the clip. so we recurse from clipper to clipper until we reach
|
* to set the clip. so we recurse from clipper to clipper until we reach
|
||||||
* the source object's clipper */
|
* the source object's clipper */
|
||||||
|
|
||||||
if (!proxy_render_data || proxy_render_data->source_clip) return EINA_TRUE;
|
if (!proxy_render_data) return EINA_TRUE;
|
||||||
|
if (proxy_render_data->source_clip)
|
||||||
|
{
|
||||||
|
/* trust cache.clip since we clip like the source */
|
||||||
|
ENFN->context_clip_clip(ENDT, ctx,
|
||||||
|
obj->cur->cache.clip.x + off_x,
|
||||||
|
obj->cur->cache.clip.y + off_y,
|
||||||
|
obj->cur->cache.clip.w, obj->cur->cache.clip.h);
|
||||||
|
ENFN->context_clip_get(ENDT, ctx, NULL, NULL, &cw, &ch);
|
||||||
|
return (cw && ch);
|
||||||
|
}
|
||||||
|
|
||||||
if (!obj || !obj->cur->clipper) return EINA_TRUE;
|
if (!obj || !obj->cur->clipper) return EINA_TRUE;
|
||||||
|
|
||||||
clipper = obj->cur->clipper;
|
clipper = obj->cur->clipper;
|
||||||
if (!clipper->cur->visible) return EINA_FALSE;
|
if (!clipper->cur->visible) return EINA_FALSE;
|
||||||
clip = &clipper->cur->geometry;
|
clip = &clipper->cur->geometry;
|
||||||
ENFN->context_clip_clip(ENDT, ctx, clip->x + off_x, clip->y + off_y, clip->w, clip->h);
|
ENFN->context_clip_clip(ENDT, ctx, clip->x + off_x, clip->y + off_y, clip->w, clip->h);
|
||||||
|
ENFN->context_clip_get(ENDT, ctx, NULL, NULL, &cw, &ch);
|
||||||
|
if (!cw || !ch) return EINA_FALSE;
|
||||||
|
|
||||||
/* stop if we found the source object's clipper */
|
/* stop if we found the source object's clipper */
|
||||||
if (clipper == proxy_render_data->proxy_obj->cur->clipper) return EINA_TRUE;
|
if (clipper == proxy_render_data->src_obj->cur->clipper) return EINA_TRUE;
|
||||||
|
|
||||||
/* recurse to the clipper itself */
|
/* recurse to the clipper itself */
|
||||||
return _proxy_context_clip(evas, ctx, proxy_render_data, clipper, off_x, off_y);
|
return _proxy_context_clip(evas, ctx, proxy_render_data, clipper, off_x, off_y);
|
||||||
|
@ -1236,7 +1250,7 @@ _evas_render_mapped_context_clip_set(Evas_Public_Data *evas, Evas_Object *eo_obj
|
||||||
|
|
||||||
if (proxy_render_data) proxy_src_clip = proxy_render_data->source_clip;
|
if (proxy_render_data) proxy_src_clip = proxy_render_data->source_clip;
|
||||||
|
|
||||||
if (proxy_src_clip && !evas->is_frozen)
|
if (proxy_src_clip)
|
||||||
{
|
{
|
||||||
x = obj->cur->cache.clip.x;
|
x = obj->cur->cache.clip.x;
|
||||||
y = obj->cur->cache.clip.y;
|
y = obj->cur->cache.clip.y;
|
||||||
|
|
|
@ -579,10 +579,10 @@ eng_context_clip_unset(void *data EINA_UNUSED, void *context)
|
||||||
static int
|
static int
|
||||||
eng_context_clip_get(void *data EINA_UNUSED, void *context, int *x, int *y, int *w, int *h)
|
eng_context_clip_get(void *data EINA_UNUSED, void *context, int *x, int *y, int *w, int *h)
|
||||||
{
|
{
|
||||||
*x = ((RGBA_Draw_Context *)context)->clip.x;
|
if (x) *x = ((RGBA_Draw_Context *)context)->clip.x;
|
||||||
*y = ((RGBA_Draw_Context *)context)->clip.y;
|
if (y) *y = ((RGBA_Draw_Context *)context)->clip.y;
|
||||||
*w = ((RGBA_Draw_Context *)context)->clip.w;
|
if (w) *w = ((RGBA_Draw_Context *)context)->clip.w;
|
||||||
*h = ((RGBA_Draw_Context *)context)->clip.h;
|
if (h) *h = ((RGBA_Draw_Context *)context)->clip.h;
|
||||||
return ((RGBA_Draw_Context *)context)->clip.use;
|
return ((RGBA_Draw_Context *)context)->clip.use;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue