summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2014-12-01 22:33:59 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-01-07 15:06:03 +0900
commit61b847d47a176722f685a92a43cb1c53dc6f2178 (patch)
tree05fc159a8489406e37ddb40f298b0cab6ee50df5 /src/modules
parent2bd5cf6e6f22d909b76687dc90c3551317bc421e (diff)
Evas masking: Simplify and fix vertex logic in GL
There was some geometry problem, and this commit also simplifies a lot of code by factorizing it a lot.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_context.c251
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_image.c11
2 files changed, 89 insertions, 173 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 54c26cf52b..ae5f11469e 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_context.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_context.c
@@ -1246,6 +1246,20 @@ evas_gl_common_context_target_surface_set(Evas_Engine_GL_Context *gc,
1246#define PUSH_6_COLORS(pn, r, g, b, a) \ 1246#define PUSH_6_COLORS(pn, r, g, b, a) \
1247 do { int i; for (i = 0; i < 6; i++) PUSH_COLOR(pn, r, g, b, a); } while(0) 1247 do { int i; for (i = 0; i < 6; i++) PUSH_COLOR(pn, r, g, b, a); } while(0)
1248 1248
1249#define PUSH_MASK(pn, mtex, mx, my, mw, mh) if (mtex) do { \
1250 GLfloat tmx1, tmx2, tmy1, tmy2; \
1251 tmx1 = (mtex->x + mx) / (double)mtex->pt->w; \
1252 tmy1 = (mtex->y + my) / (double)mtex->pt->h; \
1253 tmx2 = (mtex->x + mx + mw) / (double)mtex->pt->w; \
1254 tmy2 = (mtex->y + my + mh) / (double)mtex->pt->h; \
1255 PUSH_TEXM(pn, tmx1, tmy1); \
1256 PUSH_TEXM(pn, tmx2, tmy1); \
1257 PUSH_TEXM(pn, tmx1, tmy2); \
1258 PUSH_TEXM(pn, tmx2, tmy1); \
1259 PUSH_TEXM(pn, tmx2, tmy2); \
1260 PUSH_TEXM(pn, tmx1, tmy2); \
1261 } while(0)
1262
1249#define PIPE_GROW(gc, pn, inc) \ 1263#define PIPE_GROW(gc, pn, inc) \
1250 int nv = gc->pipe[pn].array.num * 3; (void) nv; \ 1264 int nv = gc->pipe[pn].array.num * 3; (void) nv; \
1251 int nc = gc->pipe[pn].array.num * 4; (void) nc; \ 1265 int nc = gc->pipe[pn].array.num * 4; (void) nc; \
@@ -1954,23 +1968,7 @@ evas_gl_common_context_image_push(Evas_Engine_GL_Context *gc,
1954 PUSH_TEXSAM(pn, samx, samy); 1968 PUSH_TEXSAM(pn, samx, samy);
1955 } 1969 }
1956 1970
1957 if (mtex) 1971 PUSH_MASK(pn, mtex, mx, my, mw, mh);
1958 {
1959 GLfloat tmx1, tmy1, tmx2, tmy2;
1960
1961 tmx1 = (mtex->x + mx) / (double)mtex->pt->w;
1962 tmy1 = (mtex->y + my) / (double)mtex->pt->h;
1963 tmx2 = (mtex->x + mx + mw) / (double)mtex->pt->w;
1964 tmy2 = (mtex->y + my + mh) / (double)mtex->pt->h;
1965
1966 PUSH_TEXM(pn, tmx1, tmy1);
1967 PUSH_TEXM(pn, tmx2, tmy1);
1968 PUSH_TEXM(pn, tmx1, tmy2);
1969
1970 PUSH_TEXM(pn, tmx2, tmy1);
1971 PUSH_TEXM(pn, tmx2, tmy2);
1972 PUSH_TEXM(pn, tmx1, tmy2);
1973 }
1974 1972
1975 // if nomul... dont need this 1973 // if nomul... dont need this
1976 PUSH_6_COLORS(pn, r, g, b, a); 1974 PUSH_6_COLORS(pn, r, g, b, a);
@@ -2056,23 +2054,7 @@ evas_gl_common_context_font_push(Evas_Engine_GL_Context *gc,
2056 PUSH_TEXUV(pn, tx2, ty2); 2054 PUSH_TEXUV(pn, tx2, ty2);
2057 PUSH_TEXUV(pn, tx1, ty2); 2055 PUSH_TEXUV(pn, tx1, ty2);
2058 2056
2059 if (mtex) 2057 PUSH_MASK(pn, mtex, mx, my, mw, mh);
2060 {
2061 GLfloat tmx1, tmy1, tmx2, tmy2;
2062
2063 tmx1 = (mtex->x + mx) / (double)mtex->pt->w;
2064 tmy1 = (mtex->y + my) / (double)mtex->pt->h;
2065 tmx2 = (mtex->x + mx + mw) / (double)mtex->pt->w;
2066 tmy2 = (mtex->y + my + mh) / (double)mtex->pt->h;
2067
2068 PUSH_TEXM(pn, tmx1, tmy1);
2069 PUSH_TEXM(pn, tmx2, tmy1);
2070 PUSH_TEXM(pn, tmx1, tmy2);
2071
2072 PUSH_TEXM(pn, tmx2, tmy1);
2073 PUSH_TEXM(pn, tmx2, tmy2);
2074 PUSH_TEXM(pn, tmx1, tmy2);
2075 }
2076 2058
2077 PUSH_6_COLORS(pn, r, g, b, a); 2059 PUSH_6_COLORS(pn, r, g, b, a);
2078} 2060}
@@ -2091,7 +2073,8 @@ evas_gl_common_context_yuv_push(Evas_Engine_GL_Context *gc,
2091 GLuint prog; 2073 GLuint prog;
2092 int pn = 0; 2074 int pn = 0;
2093 2075
2094 if (a < 255) blend = 1; 2076 if ((a < 255) || (!!mtex))
2077 blend = 1;
2095 2078
2096 prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex, 2079 prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
2097 SHADER_YUV_NOMUL, SHADER_YUV, 2080 SHADER_YUV_NOMUL, SHADER_YUV,
@@ -2173,23 +2156,7 @@ evas_gl_common_context_yuv_push(Evas_Engine_GL_Context *gc,
2173 PUSH_TEXUV3(pn, t2x2, t2y2); 2156 PUSH_TEXUV3(pn, t2x2, t2y2);
2174 PUSH_TEXUV3(pn, t2x1, t2y2); 2157 PUSH_TEXUV3(pn, t2x1, t2y2);
2175 2158
2176 if (mtex) 2159 PUSH_MASK(pn, mtex, mx, my, mw, mh);
2177 {
2178 GLfloat tmx1, tmy1, tmx2, tmy2;
2179
2180 tmx1 = (mtex->x + mx) / (double)mtex->pt->w;
2181 tmy1 = (mtex->y + my) / (double)mtex->pt->h;
2182 tmx2 = (mtex->x + mx + mw) / (double)mtex->pt->w;
2183 tmy2 = (mtex->y + my + mh) / (double)mtex->pt->h;
2184
2185 PUSH_TEXM(pn, tmx1, tmy1);
2186 PUSH_TEXM(pn, tmx2, tmy1);
2187 PUSH_TEXM(pn, tmx1, tmy2);
2188
2189 PUSH_TEXM(pn, tmx2, tmy1);
2190 PUSH_TEXM(pn, tmx2, tmy2);
2191 PUSH_TEXM(pn, tmx1, tmy2);
2192 }
2193 2160
2194 PUSH_6_COLORS(pn, r, g, b, a); 2161 PUSH_6_COLORS(pn, r, g, b, a);
2195} 2162}
@@ -2208,7 +2175,8 @@ evas_gl_common_context_yuy2_push(Evas_Engine_GL_Context *gc,
2208 GLuint prog; 2175 GLuint prog;
2209 int pn = 0; 2176 int pn = 0;
2210 2177
2211 if (a < 255) blend = 1; 2178 if ((a < 255) || (!!mtex))
2179 blend = 1;
2212 2180
2213 prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex, 2181 prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
2214 SHADER_YUY2_NOMUL, SHADER_YUY2, 2182 SHADER_YUY2_NOMUL, SHADER_YUY2,
@@ -2281,23 +2249,7 @@ evas_gl_common_context_yuy2_push(Evas_Engine_GL_Context *gc,
2281 PUSH_TEXUV2(pn, t2x2, t2y2); 2249 PUSH_TEXUV2(pn, t2x2, t2y2);
2282 PUSH_TEXUV2(pn, t2x1, t2y2); 2250 PUSH_TEXUV2(pn, t2x1, t2y2);
2283 2251
2284 if (mtex) 2252 PUSH_MASK(pn, mtex, mx, my, mw, mh);
2285 {
2286 GLfloat tmx1, tmy1, tmx2, tmy2;
2287
2288 tmx1 = (mtex->x + mx) / (double)mtex->pt->w;
2289 tmy1 = (mtex->y + my) / (double)mtex->pt->h;
2290 tmx2 = (mtex->x + mx + mw) / (double)mtex->pt->w;
2291 tmy2 = (mtex->y + my + mh) / (double)mtex->pt->h;
2292
2293 PUSH_TEXM(pn, tmx1, tmy1);
2294 PUSH_TEXM(pn, tmx2, tmy1);
2295 PUSH_TEXM(pn, tmx1, tmy2);
2296
2297 PUSH_TEXM(pn, tmx2, tmy1);
2298 PUSH_TEXM(pn, tmx2, tmy2);
2299 PUSH_TEXM(pn, tmx1, tmy2);
2300 }
2301 2253
2302 PUSH_6_COLORS(pn, r, g, b, a); 2254 PUSH_6_COLORS(pn, r, g, b, a);
2303} 2255}
@@ -2316,7 +2268,8 @@ evas_gl_common_context_nv12_push(Evas_Engine_GL_Context *gc,
2316 GLuint prog; 2268 GLuint prog;
2317 int pn = 0; 2269 int pn = 0;
2318 2270
2319 if (a < 255) blend = 1; 2271 if ((a < 255) || (!!mtex))
2272 blend = 1;
2320 2273
2321 prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex, 2274 prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
2322 SHADER_NV12_NOMUL, SHADER_NV12, 2275 SHADER_NV12_NOMUL, SHADER_NV12,
@@ -2391,23 +2344,7 @@ evas_gl_common_context_nv12_push(Evas_Engine_GL_Context *gc,
2391 PUSH_TEXUV2(pn, t2x2, t2y2); 2344 PUSH_TEXUV2(pn, t2x2, t2y2);
2392 PUSH_TEXUV2(pn, t2x1, t2y2); 2345 PUSH_TEXUV2(pn, t2x1, t2y2);
2393 2346
2394 if (mtex) 2347 PUSH_MASK(pn, mtex, mx, my, mw, mh);
2395 {
2396 GLfloat tmx1, tmy1, tmx2, tmy2;
2397
2398 tmx1 = (mtex->x + mx) / (double)mtex->pt->w;
2399 tmy1 = (mtex->y + my) / (double)mtex->pt->h;
2400 tmx2 = (mtex->x + mx + mw) / (double)mtex->pt->w;
2401 tmy2 = (mtex->y + my + mh) / (double)mtex->pt->h;
2402
2403 PUSH_TEXM(pn, tmx1, tmy1);
2404 PUSH_TEXM(pn, tmx2, tmy1);
2405 PUSH_TEXM(pn, tmx1, tmy2);
2406
2407 PUSH_TEXM(pn, tmx2, tmy1);
2408 PUSH_TEXM(pn, tmx2, tmy2);
2409 PUSH_TEXM(pn, tmx1, tmy2);
2410 }
2411 2348
2412 PUSH_6_COLORS(pn, r, g, b, a); 2349 PUSH_6_COLORS(pn, r, g, b, a);
2413} 2350}
@@ -2509,23 +2446,7 @@ evas_gl_common_context_rgb_a_pair_push(Evas_Engine_GL_Context *gc,
2509 PUSH_TEXA(pn, t2x2, t2y2); 2446 PUSH_TEXA(pn, t2x2, t2y2);
2510 PUSH_TEXA(pn, t2x1, t2y2); 2447 PUSH_TEXA(pn, t2x1, t2y2);
2511 2448
2512 if (mtex) 2449 PUSH_MASK(pn, mtex, mx, my, mw, mh);
2513 {
2514 GLfloat tmx1, tmy1, tmx2, tmy2;
2515
2516 tmx1 = (mtex->x + mx) / (double)mtex->pt->w;
2517 tmy1 = (mtex->y + my) / (double)mtex->pt->h;
2518 tmx2 = (mtex->x + mx + mw) / (double)mtex->pt->w;
2519 tmy2 = (mtex->y + my + mh) / (double)mtex->pt->h;
2520
2521 PUSH_TEXM(pn, tmx1, tmy1);
2522 PUSH_TEXM(pn, tmx2, tmy1);
2523 PUSH_TEXM(pn, tmx1, tmy2);
2524
2525 PUSH_TEXM(pn, tmx2, tmy1);
2526 PUSH_TEXM(pn, tmx2, tmy2);
2527 PUSH_TEXM(pn, tmx1, tmy2);
2528 }
2529 2450
2530 PUSH_6_COLORS(pn, r, g, b, a); 2451 PUSH_6_COLORS(pn, r, g, b, a);
2531} 2452}
@@ -2553,7 +2474,7 @@ evas_gl_common_context_image_map_push(Evas_Engine_GL_Context *gc,
2553 int flat = 0; 2474 int flat = 0;
2554 2475
2555 if (!(gc->dc->render_op == EVAS_RENDER_COPY) && 2476 if (!(gc->dc->render_op == EVAS_RENDER_COPY) &&
2556 ((a < 255) || (tex->alpha))) blend = EINA_TRUE; 2477 ((a < 255) || (tex->alpha) || (!!mtex))) blend = EINA_TRUE;
2557 2478
2558 if ((A_VAL(&(p[0].col)) < 0xff) || (A_VAL(&(p[1].col)) < 0xff) || 2479 if ((A_VAL(&(p[0].col)) < 0xff) || (A_VAL(&(p[1].col)) < 0xff) ||
2559 (A_VAL(&(p[2].col)) < 0xff) || (A_VAL(&(p[3].col)) < 0xff)) 2480 (A_VAL(&(p[2].col)) < 0xff) || (A_VAL(&(p[3].col)) < 0xff))
@@ -2787,23 +2708,7 @@ evas_gl_common_context_image_map_push(Evas_Engine_GL_Context *gc,
2787 A_VAL(&cl)); 2708 A_VAL(&cl));
2788 } 2709 }
2789 2710
2790 if (mtex) 2711 PUSH_MASK(pn, mtex, mx, my, mw, mh);
2791 {
2792 GLfloat tmx1, tmy1, tmx2, tmy2;
2793
2794 tmx1 = (mtex->x + mx) / (double)mtex->pt->w;
2795 tmy1 = (mtex->y + my) / (double)mtex->pt->h;
2796 tmx2 = (mtex->x + mx + mw) / (double)mtex->pt->w;
2797 tmy2 = (mtex->y + my + mh) / (double)mtex->pt->h;
2798
2799 PUSH_TEXM(pn, tmx1, tmy1);
2800 PUSH_TEXM(pn, tmx2, tmy1);
2801 PUSH_TEXM(pn, tmx1, tmy2);
2802
2803 PUSH_TEXM(pn, tmx2, tmy1);
2804 PUSH_TEXM(pn, tmx2, tmy2);
2805 PUSH_TEXM(pn, tmx1, tmy2);
2806 }
2807 2712
2808 if (!flat) 2713 if (!flat)
2809 { 2714 {
@@ -3263,11 +3168,15 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
3263 GLERR(__FUNCTION__, __FILE__, __LINE__, ""); 3168 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3264 glDisableVertexAttribArray(SHAD_TEXUV3); 3169 glDisableVertexAttribArray(SHAD_TEXUV3);
3265 GLERR(__FUNCTION__, __FILE__, __LINE__, ""); 3170 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3171 glDisableVertexAttribArray(SHAD_TEXM);
3172 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3266 glDrawArrays(GL_LINES, 0, gc->pipe[i].array.num); 3173 glDrawArrays(GL_LINES, 0, gc->pipe[i].array.num);
3267 GLERR(__FUNCTION__, __FILE__, __LINE__, ""); 3174 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3268 } 3175 }
3269 else 3176 else
3270 { 3177 {
3178 GLint MASK_TEXTURE = GL_TEXTURE1;
3179
3271 if (gc->pipe[i].array.use_texuv) 3180 if (gc->pipe[i].array.use_texuv)
3272 { 3181 {
3273 glEnableVertexAttribArray(SHAD_TEXUV); 3182 glEnableVertexAttribArray(SHAD_TEXUV);
@@ -3320,54 +3229,12 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
3320 GLERR(__FUNCTION__, __FILE__, __LINE__, ""); 3229 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3321 glActiveTexture(GL_TEXTURE0); 3230 glActiveTexture(GL_TEXTURE0);
3322 GLERR(__FUNCTION__, __FILE__, __LINE__, ""); 3231 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3323 }
3324 else
3325 {
3326 glDisableVertexAttribArray(SHAD_TEXA);
3327 }
3328 3232
3329 /* Mask surface */ 3233 MASK_TEXTURE += 1;
3330 if (gc->pipe[i].array.use_texm)
3331 {
3332 glEnableVertexAttribArray(SHAD_TEXM);
3333 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3334 glVertexAttribPointer(SHAD_TEXM, 2, GL_FLOAT, GL_FALSE, 0, (void *)texm_ptr);
3335 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3336 glActiveTexture(GL_TEXTURE3);
3337 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3338 glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texm);
3339 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3340#ifdef GL_TEXTURE_MAX_ANISOTROPY_EXT
3341 if (shared->info.anisotropic > 0.0)
3342 {
3343 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, shared->info.anisotropic);
3344 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3345 }
3346#endif
3347 if (gc->pipe[i].shader.smooth)
3348 {
3349 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
3350 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3351 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
3352 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3353 }
3354 else
3355 {
3356 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
3357 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3358 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
3359 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3360 }
3361 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
3362 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3363 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
3364 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3365 glActiveTexture(GL_TEXTURE0);
3366 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3367 } 3234 }
3368 else 3235 else
3369 { 3236 {
3370 glDisableVertexAttribArray(SHAD_TEXM); 3237 glDisableVertexAttribArray(SHAD_TEXA);
3371 } 3238 }
3372 3239
3373 if (gc->pipe[i].array.use_texsam) 3240 if (gc->pipe[i].array.use_texsam)
@@ -3427,6 +3294,8 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
3427 GLERR(__FUNCTION__, __FILE__, __LINE__, ""); 3294 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3428 glActiveTexture(GL_TEXTURE0); 3295 glActiveTexture(GL_TEXTURE0);
3429 GLERR(__FUNCTION__, __FILE__, __LINE__, ""); 3296 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3297
3298 MASK_TEXTURE += 2;
3430 } 3299 }
3431 else if (gc->pipe[i].array.use_texuv2) 3300 else if (gc->pipe[i].array.use_texuv2)
3432 { 3301 {
@@ -3468,6 +3337,8 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
3468 } 3337 }
3469 glActiveTexture(GL_TEXTURE0); 3338 glActiveTexture(GL_TEXTURE0);
3470 GLERR(__FUNCTION__, __FILE__, __LINE__, ""); 3339 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3340
3341 MASK_TEXTURE += 1;
3471 } 3342 }
3472 else 3343 else
3473 { 3344 {
@@ -3476,6 +3347,52 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
3476 glDisableVertexAttribArray(SHAD_TEXUV3); 3347 glDisableVertexAttribArray(SHAD_TEXUV3);
3477 GLERR(__FUNCTION__, __FILE__, __LINE__, ""); 3348 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3478 } 3349 }
3350
3351 /* Mask surface */
3352 if (gc->pipe[i].array.use_texm)
3353 {
3354 glEnableVertexAttribArray(SHAD_TEXM);
3355 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3356 glVertexAttribPointer(SHAD_TEXM, 2, GL_FLOAT, GL_FALSE, 0, (void *)texm_ptr);
3357 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3358 glActiveTexture(MASK_TEXTURE);
3359 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3360 glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texm);
3361 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3362#ifdef GL_TEXTURE_MAX_ANISOTROPY_EXT
3363 if (shared->info.anisotropic > 0.0)
3364 {
3365 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, shared->info.anisotropic);
3366 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3367 }
3368#endif
3369 if (gc->pipe[i].shader.smooth)
3370 {
3371 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
3372 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3373 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
3374 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3375 }
3376 else
3377 {
3378 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
3379 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3380 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
3381 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3382 }
3383 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
3384 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3385 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
3386 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3387 glActiveTexture(GL_TEXTURE0);
3388 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3389 }
3390 else
3391 {
3392 glDisableVertexAttribArray(SHAD_TEXM);
3393 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3394 }
3395
3479 if (dbgflushnum == 1) 3396 if (dbgflushnum == 1)
3480 { 3397 {
3481 const char *types[6] = 3398 const char *types[6] =
diff --git a/src/modules/evas/engines/gl_common/evas_gl_image.c b/src/modules/evas/engines/gl_common/evas_gl_image.c
index 05965803c0..791cdacfef 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_image.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_image.c
@@ -979,15 +979,14 @@ _evas_gl_common_image_push(Evas_Engine_GL_Context *gc, Evas_GL_Image *im,
979 { 979 {
980 double mx, my, mw, mh; 980 double mx, my, mw, mh;
981 981
982 mtex = mask->tex;
983 mx = mask_x; my = mask_y; mw = mask->w; mh = mask->h; 982 mx = mask_x; my = mask_y; mw = mask->w; mh = mask->h;
984 RECTS_CLIP_TO_RECT(mx, my, mw, mh, cx, cy, cw, ch); 983 RECTS_CLIP_TO_RECT(mx, my, mw, mh, cx, cy, cw, ch);
985 RECTS_CLIP_TO_RECT(mx, my, mw, mh, dx, dy, dw, dh); 984 RECTS_CLIP_TO_RECT(mx, my, mw, mh, dx, dy, dw, dh);
986 985 mmx = mx - mask_x;
987 mmx = (double)(mx - mask_x) + ((double)(mw * (nx - dx)) / (double)(dw)); 986 mmy = my - mask_y;
988 mmy = (double)(my - mask_y) + ((double)(mh * (ny - dy)) / (double)(dh)); 987 mmw = mw;
989 mmw = ((double)mw * (double)(nw)) / (double)(dw); 988 mmh = mh;
990 mmh = ((double)mh * (double)(nh)) / (double)(dh); 989 mtex = mask->tex;
991 } 990 }
992 991
993 if ((nx == dx) && (ny == dy) && (nw == dw) && (nh == dh)) 992 if ((nx == dx) && (ny == dy) && (nw == dw) && (nh == dh))