From 6a18b75743330b2278582c0df26a539fd92628a8 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Thu, 12 Apr 2012 08:01:13 +0000 Subject: [PATCH] * Fix gl engine clipping bug when rendering to evas map fbo's when gl window buffer is smaller than the fbo. used wrong surface size in clipping logic. SVN revision: 70125 --- legacy/evas/ChangeLog | 7 +++++++ legacy/evas/src/modules/engines/gl_common/evas_gl_font.c | 2 +- legacy/evas/src/modules/engines/gl_common/evas_gl_image.c | 2 +- .../evas/src/modules/engines/gl_common/evas_gl_polygon.c | 2 +- .../evas/src/modules/engines/gl_common/evas_gl_rectangle.c | 3 ++- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/legacy/evas/ChangeLog b/legacy/evas/ChangeLog index 7bf3866102..832b34eef4 100644 --- a/legacy/evas/ChangeLog +++ b/legacy/evas/ChangeLog @@ -685,3 +685,10 @@ * Box layouts: fix handling of weights that have decimal parts, they were being handled as "int" where "double" was expected. + +2012-04-12 Carsten Haitzler (The Rasterman) + + * Fix gl engine clipping bug when rendering to evas map fbo's + when gl window buffer is smaller than the fbo. used wrong + surface size in clipping logic. + diff --git a/legacy/evas/src/modules/engines/gl_common/evas_gl_font.c b/legacy/evas/src/modules/engines/gl_common/evas_gl_font.c index e5f3a4ab4b..bd20575bf6 100644 --- a/legacy/evas/src/modules/engines/gl_common/evas_gl_font.c +++ b/legacy/evas/src/modules/engines/gl_common/evas_gl_font.c @@ -162,7 +162,7 @@ evas_gl_font_texture_draw(void *context, void *surface __UNUSED__, void *draw_co } /* save out clip info */ c = gc->dc->clip.use; cx = gc->dc->clip.x; cy = gc->dc->clip.y; cw = gc->dc->clip.w; ch = gc->dc->clip.h; - evas_common_draw_context_clip_clip(gc->dc, 0, 0, gc->w, gc->h); + evas_common_draw_context_clip_clip(gc->dc, 0, 0, gc->shared->w, gc->shared->h); evas_common_draw_context_clip_clip(gc->dc, x, y, tex->w, tex->h); /* our clip is 0 size.. abort */ if ((gc->dc->clip.w <= 0) || (gc->dc->clip.h <= 0)) diff --git a/legacy/evas/src/modules/engines/gl_common/evas_gl_image.c b/legacy/evas/src/modules/engines/gl_common/evas_gl_image.c index 1d4b1f8115..39f16bbd83 100644 --- a/legacy/evas/src/modules/engines/gl_common/evas_gl_image.c +++ b/legacy/evas/src/modules/engines/gl_common/evas_gl_image.c @@ -880,7 +880,7 @@ evas_gl_common_image_draw(Evas_Engine_GL_Context *gc, Evas_GL_Image *im, int sx, /* save out clip info */ c = gc->dc->clip.use; cx = gc->dc->clip.x; cy = gc->dc->clip.y; cw = gc->dc->clip.w; ch = gc->dc->clip.h; - evas_common_draw_context_clip_clip(gc->dc, 0, 0, gc->w, gc->h); + evas_common_draw_context_clip_clip(gc->dc, 0, 0, gc->shared->w, gc->shared->h); evas_common_draw_context_clip_clip(gc->dc, dx, dy, dw, dh); /* our clip is 0 size.. abort */ if ((gc->dc->clip.w <= 0) || (gc->dc->clip.h <= 0)) diff --git a/legacy/evas/src/modules/engines/gl_common/evas_gl_polygon.c b/legacy/evas/src/modules/engines/gl_common/evas_gl_polygon.c index 06647cd679..bc111bd3a2 100644 --- a/legacy/evas/src/modules/engines/gl_common/evas_gl_polygon.c +++ b/legacy/evas/src/modules/engines/gl_common/evas_gl_polygon.c @@ -248,7 +248,7 @@ evas_gl_common_poly_draw(Evas_Engine_GL_Context *gc, Evas_GL_Polygon *poly, int free(point); free(sorted_index); - evas_common_draw_context_clip_clip(gc->dc, 0, 0, gc->w, gc->h); + evas_common_draw_context_clip_clip(gc->dc, 0, 0, gc->shared->w, gc->shared->h); if (spans) { diff --git a/legacy/evas/src/modules/engines/gl_common/evas_gl_rectangle.c b/legacy/evas/src/modules/engines/gl_common/evas_gl_rectangle.c index 190331490e..6254d87851 100644 --- a/legacy/evas/src/modules/engines/gl_common/evas_gl_rectangle.c +++ b/legacy/evas/src/modules/engines/gl_common/evas_gl_rectangle.c @@ -17,8 +17,9 @@ evas_gl_common_rect_draw(Evas_Engine_GL_Context *gc, int x, int y, int w, int h) cr = (gc->dc->col.col >> 16) & 0xff; cg = (gc->dc->col.col >> 8 ) & 0xff; cb = (gc->dc->col.col ) & 0xff; - evas_common_draw_context_clip_clip(gc->dc, 0, 0, gc->w, gc->h); + evas_common_draw_context_clip_clip(gc->dc, 0, 0, gc->shared->w, gc->shared->h); /* no cutouts - cut right to the chase */ + if ((gc->dc) && (gc->dc->clip.use)) { RECTS_CLIP_TO_RECT(x, y, w, h,