diff options
author | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2013-09-27 17:57:41 +0900 |
---|---|---|
committer | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2013-09-27 17:57:41 +0900 |
commit | 0732fef6ec9e5e5ce8d626637b366ee58625e686 (patch) | |
tree | 8a9fe79426a3b9969e38d38a6d27367c3d47382f /src/modules/evas/engines/gl_common/evas_gl_context.c | |
parent | 933998b93da3967e07729061eee3cb79852dd864 (diff) |
Revert "evas gl engine - simplify and optimise pipe region intersection checks."
This reverts commit d4861504127c8a2d7375b076c18c22086914e94c.
Diffstat (limited to 'src/modules/evas/engines/gl_common/evas_gl_context.c')
-rw-r--r-- | src/modules/evas/engines/gl_common/evas_gl_context.c | 30 |
1 files changed, 18 insertions, 12 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 951cfbe362..ea8194c217 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_context.c +++ b/src/modules/evas/engines/gl_common/evas_gl_context.c | |||
@@ -1166,31 +1166,37 @@ static int | |||
1166 | pipe_region_intersects(Evas_Engine_GL_Context *gc, int n, | 1166 | pipe_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, end; | 1169 | int i, rx, ry, rw, rh, ii; |
1170 | const GLshort *v; | ||
1171 | 1170 | ||
1172 | rx = gc->pipe[n].region.x; | 1171 | rx = gc->pipe[n].region.x; |
1173 | ry = gc->pipe[n].region.y; | 1172 | ry = gc->pipe[n].region.y; |
1174 | rw = gc->pipe[n].region.w; | 1173 | rw = gc->pipe[n].region.w; |
1175 | rh = gc->pipe[n].region.h; | 1174 | rh = gc->pipe[n].region.h; |
1176 | if (!RECTS_INTERSECT(x, y, w, h, rx, ry, rw, rh)) return 0; | 1175 | if (!RECTS_INTERSECT(x, y, w, h, rx, ry, rw, rh)) |
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 | end = gc->pipe[n].array.num; | 1182 | |
1183 | v = gc->pipe[n].array.vertex; | 1183 | for (i = 0, |
1184 | for (i = 0; i < end; i += (3 * 3 * 2)) | 1184 | ii = 0; |
1185 | |||
1186 | i < gc->pipe[n].array.num; | ||
1187 | |||
1188 | i += (3 * 2), | ||
1189 | ii += (3 * 3 * 2)) | ||
1185 | { // tri 1... | 1190 | { // tri 1... |
1186 | // 0, 1, 2 < top left | 1191 | // 0, 1, 2 < top left |
1187 | // 3, 4, 5 < top right | 1192 | // 3, 4, 5 < top right |
1188 | // 6, 7, 8 < bottom left | 1193 | // 6. 7, 8 < bottom left |
1189 | rx = v[i + 0]; | 1194 | rx = gc->pipe[n].array.vertex[ii + 0]; |
1190 | ry = v[i + 1]; | 1195 | ry = gc->pipe[n].array.vertex[ii + 1]; |
1191 | rw = v[i + 3] - rx; | 1196 | rw = gc->pipe[n].array.vertex[ii + 3] - rx; |
1192 | rh = v[i + 7] - ry; | 1197 | rh = gc->pipe[n].array.vertex[ii + 7] - ry; |
1193 | if (RECTS_INTERSECT(x, y, w, h, rx, ry, rw, rh)) return 1; | 1198 | if (RECTS_INTERSECT(x, y, w, h, rx, ry, rw, rh)) |
1199 | return 1; | ||
1194 | } | 1200 | } |
1195 | return 0; | 1201 | return 0; |
1196 | } | 1202 | } |