summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-10-01 15:23:04 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-10-01 20:57:39 +0900
commite383e3096d22d4be63373e8a0e48aa9662748a58 (patch)
tree3a59ce441ebd66d65030c7abdc98ee75ca4b93e6 /src/modules
parent5487b7563567b724d2e81c1037538668377b3c12 (diff)
evas - try cleanup pipe_region_intersects again.. this time without bugs.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_context.c31
1 files 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
1166pipe_region_intersects(Evas_Engine_GL_Context *gc, int n, 1166pipe_region_intersects(Evas_Engine_GL_Context *gc, int n,
1167 int x, int y, int w, int h) 1167 int x, int y, int w, int h)
1168{ 1168{
1169 int i, rx, ry, rw, rh, ii; 1169 int rx, ry, rw, rh, ii, end;
1170 1170 const GLshort *v;
1171
1171 rx = gc->pipe[n].region.x; 1172 rx = gc->pipe[n].region.x;
1172 ry = gc->pipe[n].region.y; 1173 ry = gc->pipe[n].region.y;
1173 rw = gc->pipe[n].region.w; 1174 rw = gc->pipe[n].region.w;
1174 rh = gc->pipe[n].region.h; 1175 rh = gc->pipe[n].region.h;
1175 if (!RECTS_INTERSECT(x, y, w, h, rx, ry, rw, rh)) 1176 if (!RECTS_INTERSECT(x, y, w, h, rx, ry, rw, rh)) return 0;
1176 return 0;
1177 1177
1178 // a hack for now. map pipes use their whole bounding box for intersects 1178 // a hack for now. map pipes use their whole bounding box for intersects
1179 // which at worst case reduces to old pipeline flushes, but cheaper than 1179 // which at worst case reduces to old pipeline flushes, but cheaper than
1180 // full quad region or triangle intersects right now 1180 // full quad region or triangle intersects right now
1181 if (gc->pipe[n].region.type == RTYPE_MAP) return 1; 1181 if (gc->pipe[n].region.type == RTYPE_MAP) return 1;
1182 1182
1183 for (i = 0, 1183 v = gc->pipe[n].array.vertex;
1184 ii = 0; 1184 end = gc->pipe[n].array.num * 3;
1185 1185 for (ii = 0; ii < end; ii += (3 * 3 * 2))
1186 i < gc->pipe[n].array.num;
1187
1188 i += (3 * 2),
1189 ii += (3 * 3 * 2))
1190 { // tri 1... 1186 { // tri 1...
1191 // 0, 1, 2 < top left 1187 // 0, 1, 2 < top left
1192 // 3, 4, 5 < top right 1188 // 3, 4, 5 < top right
1193 // 6. 7, 8 < bottom left 1189 // 6, 7, 8 < bottom left
1194 rx = gc->pipe[n].array.vertex[ii + 0]; 1190 rx = v[ii + 0];
1195 ry = gc->pipe[n].array.vertex[ii + 1]; 1191 ry = v[ii + 1];
1196 rw = gc->pipe[n].array.vertex[ii + 3] - rx; 1192 rw = v[ii + 3] - rx;
1197 rh = gc->pipe[n].array.vertex[ii + 7] - ry; 1193 rh = v[ii + 7] - ry;
1198 if (RECTS_INTERSECT(x, y, w, h, rx, ry, rw, rh)) 1194 if (RECTS_INTERSECT(x, y, w, h, rx, ry, rw, rh)) return 1;
1199 return 1;
1200 } 1195 }
1201 return 0; 1196 return 0;
1202} 1197}