summaryrefslogtreecommitdiff
path: root/src/modules/evas/engines/gl_common/evas_gl_line.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/evas/engines/gl_common/evas_gl_line.c')
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_line.c50
1 files changed, 42 insertions, 8 deletions
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,