summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChunEon Park <hermet@hermet.pe.kr>2012-12-12 08:03:46 +0000
committerChunEon Park <hermet@hermet.pe.kr>2012-12-12 08:03:46 +0000
commit7d98f2be3895855a888535e67a6003ca08631143 (patch)
tree1ef3c77d390d18a0277978c990f2d7f7c8da4d81
parente4a91b37d8d59ab9dd3a75ab568a6244c6503274 (diff)
evas - fix the gl line inccorect position problem.
I tested gl line drawing on a few devices and found the x line start position was 1. On the other hand, our evas draws the line on start position 0. So it needs to shift by 1 pixel if evas is working on gl backcned. SVN revision: 80734
-rw-r--r--ChangeLog4
-rw-r--r--NEWS1
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_line.c29
3 files changed, 16 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index ba576b7bcf..dc598693a2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -152,3 +152,7 @@
152 152
153 * Fix EINA_INLIST_FOREACH_SAFE macro to work when inlist is not the 153 * Fix EINA_INLIST_FOREACH_SAFE macro to work when inlist is not the
154 first item in the struct. 154 first item in the struct.
155
1562012-12-12 ChunEon park <hermet@hermet.pe.kr>
157
158 * Fix the evas gl line incorrect position problem.
diff --git a/NEWS b/NEWS
index 6a93191393..4bb4437a65 100644
--- a/NEWS
+++ b/NEWS
@@ -73,3 +73,4 @@ Fixes:
73 * Don't leak fd on exec. 73 * Don't leak fd on exec.
74 * Fixed polygon rendering bug in GL backend when there are cutouts. 74 * Fixed polygon rendering bug in GL backend when there are cutouts.
75 * Fix leak in eet_pbkdf2_sha1 with OpenSSL. 75 * Fix leak in eet_pbkdf2_sha1 with OpenSSL.
76 * Fix the gl line incorrect position drawing.
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 5848da6ee6..9d7c258375 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_line.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_line.c
@@ -7,12 +7,6 @@ evas_gl_common_line_draw(Evas_Engine_GL_Context *gc, int x1, int y1, int x2, int
7 RGBA_Draw_Context *dc; 7 RGBA_Draw_Context *dc;
8 int r, g, b, a; 8 int r, g, b, a;
9 int c, cx, cy, cw, ch; 9 int c, cx, cy, cw, ch;
10 static int offset_hack = -1;
11
12 if (offset_hack == -1) {
13 if (getenv("EVAS_GL_LINE_NO_OFFSET_HACK")) offset_hack = 0;
14 else offset_hack = 1;
15 }
16 10
17 dc = gc->dc; 11 dc = gc->dc;
18 if (dc->mul.use) 12 if (dc->mul.use)
@@ -34,24 +28,23 @@ evas_gl_common_line_draw(Evas_Engine_GL_Context *gc, int x1, int y1, int x2, int
34 cx = gc->dc->clip.x; cy = gc->dc->clip.y; 28 cx = gc->dc->clip.x; cy = gc->dc->clip.y;
35 cw = gc->dc->clip.w; ch = gc->dc->clip.h; 29 cw = gc->dc->clip.w; ch = gc->dc->clip.h;
36 30
37 if (offset_hack) 31 //Increment pixels since the gl line origin position is slightly different.
32 if (x1 == x2)
38 { 33 {
39 /* Increment pixels since the gl line origin position is slightly different 34 if ((gc->rot == 0) ||(gc->rot == 90))
40 on some platform. Carsten did this hack.. doesn't remember exactly why but
41 it works most drivers. */
42 if (x1 == x2)
43 { 35 {
44 if (gc->rot == 0) 36 x1++;
45 x1++; 37 x2++;
46 } 38 }
39 }
47 40
48 if (y1 == y2) 41 if (y1 == y2)
42 {
43 if ((gc->rot == 90) || (gc->rot == 180))
49 { 44 {
50 if ((gc->rot == 90) || (gc->rot == 180)) 45 y1++;
51 y1++; 46 y2++;
52 } 47 }
53
54 x2++; y2++;
55 } 48 }
56 49
57 evas_gl_common_context_line_push(gc, x1, y1, x2, y2, 50 evas_gl_common_context_line_push(gc, x1, y1, x2, y2,