summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChunEon Park <hermet@hermet.pe.kr>2012-12-15 09:40:47 +0000
committerChunEon Park <hermet@hermet.pe.kr>2012-12-15 09:40:47 +0000
commita949b185e69f30f83b633507e4af1ddf3400bac0 (patch)
treedd74aafdf7029c95d3696f0f32ce9dc55d13560c
parentbd22aeb35dbf212b5343fe3ded15e50ce9cb4c1c (diff)
evas/gl - fix the line incorrect position in arm.
line position is slightly different between gl drivers. I have no idea why it is. So added to work differently based on the manufacturers. This work may be based on the renderer. If you can test it with much drivers then please test and fix. Also changed the ENV name from EVAS_GL_LINE_NO_OFFSET_HACK to EVAS_GL_LINE_OFFSET_HACK_DISABLE. SVN revision: 81016
-rw-r--r--ChangeLog5
-rw-r--r--NEWS2
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_line.c50
3 files changed, 49 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 2d8a3ee299..1d4b6a3782 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -170,3 +170,8 @@
170 170
171 * Fix EINA_INLIST_FOREACH_SAFE macro to work when inlist is not the 171 * Fix EINA_INLIST_FOREACH_SAFE macro to work when inlist is not the
172 first item in the struct. 172 first item in the struct.
173
1742012-09-04 Roberto de Souza <zehortigoza@profusion.mobi>
175
176 * Fix EINA_INLIST_FOREACH_SAFE macro to work when inlist is not the
177 first item in the struct.
diff --git a/NEWS b/NEWS
index 2288d159dc..e17e355969 100644
--- a/NEWS
+++ b/NEWS
@@ -41,6 +41,7 @@ Additions:
41 * ecore_getopt: add ECORE_GETOPT_ACTION_BREAK 41 * ecore_getopt: add ECORE_GETOPT_ACTION_BREAK
42 * evas: 42 * evas:
43 - Add ellipsis support in Evas_Object_Text. 43 - Add ellipsis support in Evas_Object_Text.
44 - Add EVAS_GL_LINE_OFFSET_HACK_DISABLE to turn off line shift correction by evas.
44 45
45Deprecations: 46Deprecations:
46 * ecore_x: 47 * ecore_x:
@@ -80,3 +81,4 @@ Fixes:
80 * Fix possible memory corruption in xrandr EDID functions. 81 * Fix possible memory corruption in xrandr EDID functions.
81 * Fix potential segv in software engine native_set code. 82 * Fix potential segv in software engine native_set code.
82 * Fix uninitialized data in Evas OpenGL engine. 83 * Fix uninitialized data in Evas OpenGL engine.
84 * Fix the line drawing clipping problem on arm gl driver.
diff --git a/src/modules/evas/engines/gl_common/evas_gl_line.c b/src/modules/evas/engines/gl_common/evas_gl_line.c
index 4a8c1c31ae..364f011524 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_line.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_line.c
@@ -1,12 +1,15 @@
1#include "evas_gl_private.h" 1#include "evas_gl_private.h"
2 2
3
4void 3void
5evas_gl_common_line_draw(Evas_Engine_GL_Context *gc, int x1, int y1, int x2, int y2) 4evas_gl_common_line_draw(Evas_Engine_GL_Context *gc, int x1, int y1, int x2, int y2)
6{ 5{
7 RGBA_Draw_Context *dc; 6 RGBA_Draw_Context *dc;
8 int r, g, b, a; 7 int r, g, b, a;
9 int c, cx, cy, cw, ch; 8 int c, cx, cy, cw, ch;
9 static int offset_hack = -1;
10 const int OFFSET_HACK_OFF = 0;
11 const int OFFSET_HACK_DEFAULT = 1;
12 const int OFFSET_HACK_ARM = 2;
10 13
11 dc = gc->dc; 14 dc = gc->dc;
12 if (dc->mul.use) 15 if (dc->mul.use)
@@ -28,16 +31,47 @@ evas_gl_common_line_draw(Evas_Engine_GL_Context *gc, int x1, int y1, int x2, int
28 cx = gc->dc->clip.x; cy = gc->dc->clip.y; 31 cx = gc->dc->clip.x; cy = gc->dc->clip.y;
29 cw = gc->dc->clip.w; ch = gc->dc->clip.h; 32 cw = gc->dc->clip.w; ch = gc->dc->clip.h;
30 33
31 //Increment pixels since the gl line origin position is slightly different. 34 //I have no idea but shift lines/clips since the gl line origin position and
32 if ((gc->rot == 0) || (gc->rot == 90)) 35 //sissor area is slightly different by the gl driver.
36 if (offset_hack == -1)
37 {
38 if (!getenv("EVAS_GL_LINE_OFFSET_HACK_DISABLE"))
39 {
40 const char *vendor_name;
41 vendor_name = (char *) glGetString(GL_VENDOR);
42 if (vendor_name && !strcmp(vendor_name, "ARM"))
43 offset_hack = OFFSET_HACK_ARM;
44 else
45 offset_hack = OFFSET_HACK_DEFAULT;
46 }
47 else offset_hack = OFFSET_HACK_OFF;
48 }
49
50 if (offset_hack == OFFSET_HACK_DEFAULT)
33 { 51 {
34 x1++; 52 if ((gc->rot == 0) || (gc->rot == 90))
35 x2++; 53 {
54 x1++;
55 x2++;
56 }
57 if ((gc->rot == 90) || (gc->rot == 180))
58 {
59 y1++;
60 y2++;
61 }
36 } 62 }
37 if ((gc->rot == 90) || (gc->rot == 180)) 63 else if (offset_hack == OFFSET_HACK_ARM)
38 { 64 {
39 y1++; 65 if ((gc->rot == 90) || (gc->rot == 180))
40 y2++; 66 {
67 cx--;
68 cw--;
69 }
70 if ((gc->rot == 180) || (gc->rot == 270))
71 {
72 cy--;
73 ch--;
74 }
41 } 75 }
42 76
43 evas_gl_common_context_line_push(gc, x1, y1, x2, y2, 77 evas_gl_common_context_line_push(gc, x1, y1, x2, y2,