diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | src/modules/evas/engines/gl_common/evas_gl_line.c | 50 |
3 files changed, 49 insertions, 8 deletions
@@ -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 | |||
174 | 2012-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. | ||
@@ -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 | ||
45 | Deprecations: | 46 | Deprecations: |
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 | |||
4 | void | 3 | void |
5 | evas_gl_common_line_draw(Evas_Engine_GL_Context *gc, int x1, int y1, int x2, int y2) | 4 | evas_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, |