summaryrefslogtreecommitdiff
path: root/src/modules/evas/engines/gl_common/evas_gl_context.c
diff options
context:
space:
mode:
authorHermet Park <hermetpark@gmail.com>2019-04-18 15:24:55 +0900
committerHermet Park <hermetpark@gmail.com>2019-04-18 15:24:55 +0900
commit3a5ca4d1d9e8cf1eae8201e407d4a6486510a046 (patch)
tree20436354f2ce73fbb8b32c4b9f81d08a8b1390b0 /src/modules/evas/engines/gl_common/evas_gl_context.c
parentdd11b54f87ab85b84f8b9ae93bc0a092a98ccb5c (diff)
Revert "evas gl: move to floating point coordinate system."
This reverts commit 2ac93b5005e0693c5d84df71b4aa1c5a4b6baa80.
Diffstat (limited to '')
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_context.c75
1 files changed, 38 insertions, 37 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 c1f7d985b6..2877007f42 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_context.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_context.c
@@ -1403,7 +1403,7 @@ array_alloc(Evas_Engine_GL_Context *gc, int n)
1403 gc->pipe[n].array.field = _pipebuf_resize(gc->pipe[n].array.field, \ 1403 gc->pipe[n].array.field = _pipebuf_resize(gc->pipe[n].array.field, \
1404 gc->pipe[n].array.alloc * sizeof(type) * size) 1404 gc->pipe[n].array.alloc * sizeof(type) * size)
1405 1405
1406 RALOC(vertex, GLfloat, VERTEX_CNT); 1406 RALOC(vertex, GLshort, VERTEX_CNT);
1407 RALOC(color, GLubyte, COLOR_CNT); 1407 RALOC(color, GLubyte, COLOR_CNT);
1408 RALOC(texuv, GLfloat, TEX_CNT); 1408 RALOC(texuv, GLfloat, TEX_CNT);
1409 RALOC(texa, GLfloat, TEX_CNT); 1409 RALOC(texa, GLfloat, TEX_CNT);
@@ -1778,21 +1778,14 @@ static int
1778pipe_region_intersects(Evas_Engine_GL_Context *gc, int n, 1778pipe_region_intersects(Evas_Engine_GL_Context *gc, int n,
1779 int x, int y, int w, int h) 1779 int x, int y, int w, int h)
1780{ 1780{
1781#define SPANS_INTERSECT(x1, w1, x2, w2) \ 1781 int rx, ry, rw, rh, ii, end;
1782(!((((x2) + (w2)) <= (x1)) || ((x2) >= ((x1) + (w1))))) 1782 const GLshort *v;
1783 1783
1784#define REGIONS_INTERSECT(x, y, w, h, xx, yy, ww, hh) \
1785((SPANS_COMMON((x), (w), (xx), (ww))) && (SPANS_COMMON((y), (h), (yy), (hh))))
1786
1787 float rx, ry, rw, rh;
1788 int ii, end;
1789 const GLfloat *v;
1790
1791 rx = gc->pipe[n].region.x; 1784 rx = gc->pipe[n].region.x;
1792 ry = gc->pipe[n].region.y; 1785 ry = gc->pipe[n].region.y;
1793 rw = gc->pipe[n].region.w; 1786 rw = gc->pipe[n].region.w;
1794 rh = gc->pipe[n].region.h; 1787 rh = gc->pipe[n].region.h;
1795 if (!REGIONS_INTERSECT(x, y, w, h, rx, ry, rw, rh)) return 0; 1788 if (!RECTS_INTERSECT(x, y, w, h, rx, ry, rw, rh)) return 0;
1796 1789
1797 // a hack for now. map pipes use their whole bounding box for intersects 1790 // a hack for now. map pipes use their whole bounding box for intersects
1798 // which at worst case reduces to old pipeline flushes, but cheaper than 1791 // which at worst case reduces to old pipeline flushes, but cheaper than
@@ -1810,7 +1803,7 @@ pipe_region_intersects(Evas_Engine_GL_Context *gc, int n,
1810 ry = v[ii + 1]; 1803 ry = v[ii + 1];
1811 rw = v[ii + 3] - rx; 1804 rw = v[ii + 3] - rx;
1812 rh = v[ii + 7] - ry; 1805 rh = v[ii + 7] - ry;
1813 if (REGIONS_INTERSECT(x, y, w, h, rx, ry, rw, rh)) return 1; 1806 if (RECTS_INTERSECT(x, y, w, h, rx, ry, rw, rh)) return 1;
1814 } 1807 }
1815 return 0; 1808 return 0;
1816} 1809}
@@ -2937,14 +2930,16 @@ evas_gl_common_context_image_map_push(Evas_Engine_GL_Context *gc,
2937 (A_VAL(&(p[2].col)) < 0xff) || (A_VAL(&(p[3].col)) < 0xff)) 2930 (A_VAL(&(p[2].col)) < 0xff) || (A_VAL(&(p[3].col)) < 0xff))
2938 blend = EINA_TRUE; 2931 blend = EINA_TRUE;
2939 2932
2940 if (((p[0].z == p[1].z) && (p[1].z == p[2].z) && (p[2].z == p[3].z)) || 2933 if ((p[0].z == p[1].z) && (p[1].z == p[2].z) && (p[2].z == p[3].z))
2941 (p[0].foc <= 0)) 2934 flat = EINA_TRUE;
2942 {
2943 flat = EINA_TRUE;
2944 }
2945 2935
2946 if (!clip) cx = cy = cw = ch = 0; 2936 if (!clip) cx = cy = cw = ch = 0;
2947 2937
2938 if (!flat)
2939 {
2940 if (p[0].foc <= 0) flat = EINA_TRUE;
2941 }
2942
2948 switch (cspace) 2943 switch (cspace)
2949 { 2944 {
2950 case EVAS_COLORSPACE_YCBCR422P601_PL: 2945 case EVAS_COLORSPACE_YCBCR422P601_PL:
@@ -3005,11 +3000,28 @@ evas_gl_common_context_image_map_push(Evas_Engine_GL_Context *gc,
3005 w = w - x; 3000 w = w - x;
3006 h = h - y; 3001 h = h - y;
3007 3002
3008 // FUZZZZ! 3003 if (!flat)
3009 x -= 3; 3004 {
3010 y -= 3; 3005 // FUZZZZ!
3011 w += 6; 3006 x -= 3;
3012 h += 6; 3007 y -= 3;
3008 w += 6;
3009 h += 6;
3010 }
3011 if (clip)
3012 {
3013 if (flat)
3014 {
3015 int nx = x, ny = y, nw = w, nh = h;
3016
3017 RECTS_CLIP_TO_RECT(nx, ny, nw, nh, cx, cy, cw, ch);
3018 if ((nx == x) && (ny == y) && (nw == w) && (nh == h))
3019 {
3020 clip = 0; cx = 0; cy = 0; cw = 0; ch = 0;
3021 }
3022 x = nx; y = ny; w = nw; h = nh;
3023 }
3024 }
3013 3025
3014 if (!flat) 3026 if (!flat)
3015 { 3027 {
@@ -3021,17 +3033,6 @@ evas_gl_common_context_image_map_push(Evas_Engine_GL_Context *gc,
3021 gc->change.size = 1; 3033 gc->change.size = 1;
3022 _evas_gl_common_viewport_set(gc); 3034 _evas_gl_common_viewport_set(gc);
3023 } 3035 }
3024 else if (clip)
3025 {
3026 int nx = x, ny = y, nw = w, nh = h;
3027
3028 RECTS_CLIP_TO_RECT(nx, ny, nw, nh, cx, cy, cw, ch);
3029 if ((nx == x) && (ny == y) && (nw == w) && (nh == h))
3030 {
3031 clip = 0; cx = 0; cy = 0; cw = 0; ch = 0;
3032 }
3033 x = nx; y = ny; w = nw; h = nh;
3034 }
3035 3036
3036 pn = _evas_gl_common_context_push(SHD_MAP, 3037 pn = _evas_gl_common_context_push(SHD_MAP,
3037 gc, tex, mtex, 3038 gc, tex, mtex,
@@ -3107,8 +3108,8 @@ evas_gl_common_context_image_map_push(Evas_Engine_GL_Context *gc,
3107 if (flat) 3108 if (flat)
3108 { 3109 {
3109 PUSH_VERTEX(pn, 3110 PUSH_VERTEX(pn,
3110 p[points[i]].fx, 3111 (p[points[i]].x >> FP),
3111 p[points[i]].fy, 3112 (p[points[i]].y >> FP),
3112 0); 3113 0);
3113 } 3114 }
3114 else 3115 else
@@ -4105,7 +4106,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
4105 } 4106 }
4106 4107
4107 // use_vertex is always true 4108 // use_vertex is always true
4108 glVertexAttribPointer(SHAD_VERTEX, VERTEX_CNT, GL_FLOAT, GL_FALSE, 0, vertex_ptr); 4109 glVertexAttribPointer(SHAD_VERTEX, VERTEX_CNT, GL_SHORT, GL_FALSE, 0, vertex_ptr);
4109 4110
4110 if (gc->pipe[i].array.use_color) 4111 if (gc->pipe[i].array.use_color)
4111 { 4112 {