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:
Jean-Philippe Andre 2015-10-13 20:33:57 +09:00
parent 51e0bc022b
commit 7b266b5518
2 changed files with 21 additions and 7 deletions

View File

@ -1208,21 +1208,35 @@ _proxy_context_clip(Evas_Public_Data *evas, void *ctx, Evas_Proxy_Render_Data *p
{
const Evas_Coord_Rectangle *clip;
Evas_Object_Protected_Data *clipper;
int cw, ch;
/* 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
* 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;
clipper = obj->cur->clipper;
if (!clipper->cur->visible) return EINA_FALSE;
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_get(ENDT, ctx, NULL, NULL, &cw, &ch);
if (!cw || !ch) return EINA_FALSE;
/* 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 */
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_src_clip && !evas->is_frozen)
if (proxy_src_clip)
{
x = obj->cur->cache.clip.x;
y = obj->cur->cache.clip.y;

View File

@ -579,10 +579,10 @@ eng_context_clip_unset(void *data EINA_UNUSED, void *context)
static int
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;
*y = ((RGBA_Draw_Context *)context)->clip.y;
*w = ((RGBA_Draw_Context *)context)->clip.w;
*h = ((RGBA_Draw_Context *)context)->clip.h;
if (x) *x = ((RGBA_Draw_Context *)context)->clip.x;
if (y) *y = ((RGBA_Draw_Context *)context)->clip.y;
if (w) *w = ((RGBA_Draw_Context *)context)->clip.w;
if (h) *h = ((RGBA_Draw_Context *)context)->clip.h;
return ((RGBA_Draw_Context *)context)->clip.use;
}