From e383e3096d22d4be63373e8a0e48aa9662748a58 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Tue, 1 Oct 2013 15:23:04 +0900 Subject: [PATCH] evas - try cleanup pipe_region_intersects again.. this time without bugs. --- .../evas/engines/gl_common/evas_gl_context.c | 31 ++++++++----------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/src/modules/evas/engines/gl_common/evas_gl_context.c b/src/modules/evas/engines/gl_common/evas_gl_context.c index ea8194c217..4f875c5810 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_context.c +++ b/src/modules/evas/engines/gl_common/evas_gl_context.c @@ -1166,37 +1166,32 @@ static int pipe_region_intersects(Evas_Engine_GL_Context *gc, int n, int x, int y, int w, int h) { - int i, rx, ry, rw, rh, ii; - + int rx, ry, rw, rh, ii, end; + const GLshort *v; + rx = gc->pipe[n].region.x; ry = gc->pipe[n].region.y; rw = gc->pipe[n].region.w; rh = gc->pipe[n].region.h; - if (!RECTS_INTERSECT(x, y, w, h, rx, ry, rw, rh)) - return 0; + if (!RECTS_INTERSECT(x, y, w, h, rx, ry, rw, rh)) return 0; // a hack for now. map pipes use their whole bounding box for intersects // which at worst case reduces to old pipeline flushes, but cheaper than // full quad region or triangle intersects right now if (gc->pipe[n].region.type == RTYPE_MAP) return 1; - for (i = 0, - ii = 0; - - i < gc->pipe[n].array.num; - - i += (3 * 2), - ii += (3 * 3 * 2)) + v = gc->pipe[n].array.vertex; + end = gc->pipe[n].array.num * 3; + for (ii = 0; ii < end; ii += (3 * 3 * 2)) { // tri 1... // 0, 1, 2 < top left // 3, 4, 5 < top right - // 6. 7, 8 < bottom left - rx = gc->pipe[n].array.vertex[ii + 0]; - ry = gc->pipe[n].array.vertex[ii + 1]; - rw = gc->pipe[n].array.vertex[ii + 3] - rx; - rh = gc->pipe[n].array.vertex[ii + 7] - ry; - if (RECTS_INTERSECT(x, y, w, h, rx, ry, rw, rh)) - return 1; + // 6, 7, 8 < bottom left + rx = v[ii + 0]; + ry = v[ii + 1]; + rw = v[ii + 3] - rx; + rh = v[ii + 7] - ry; + if (RECTS_INTERSECT(x, y, w, h, rx, ry, rw, rh)) return 1; } return 0; }