forked from enlightenment/efl
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
This commit is contained in:
parent
e4a91b37d8
commit
7d98f2be38
|
@ -152,3 +152,7 @@
|
||||||
|
|
||||||
* Fix EINA_INLIST_FOREACH_SAFE macro to work when inlist is not the
|
* Fix EINA_INLIST_FOREACH_SAFE macro to work when inlist is not the
|
||||||
first item in the struct.
|
first item in the struct.
|
||||||
|
|
||||||
|
2012-12-12 ChunEon park <hermet@hermet.pe.kr>
|
||||||
|
|
||||||
|
* Fix the evas gl line incorrect position problem.
|
||||||
|
|
1
NEWS
1
NEWS
|
@ -73,3 +73,4 @@ Fixes:
|
||||||
* Don't leak fd on exec.
|
* Don't leak fd on exec.
|
||||||
* Fixed polygon rendering bug in GL backend when there are cutouts.
|
* Fixed polygon rendering bug in GL backend when there are cutouts.
|
||||||
* Fix leak in eet_pbkdf2_sha1 with OpenSSL.
|
* Fix leak in eet_pbkdf2_sha1 with OpenSSL.
|
||||||
|
* Fix the gl line incorrect position drawing.
|
||||||
|
|
|
@ -7,12 +7,6 @@ evas_gl_common_line_draw(Evas_Engine_GL_Context *gc, int x1, int y1, int x2, int
|
||||||
RGBA_Draw_Context *dc;
|
RGBA_Draw_Context *dc;
|
||||||
int r, g, b, a;
|
int r, g, b, a;
|
||||||
int c, cx, cy, cw, ch;
|
int c, cx, cy, cw, ch;
|
||||||
static int offset_hack = -1;
|
|
||||||
|
|
||||||
if (offset_hack == -1) {
|
|
||||||
if (getenv("EVAS_GL_LINE_NO_OFFSET_HACK")) offset_hack = 0;
|
|
||||||
else offset_hack = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
dc = gc->dc;
|
dc = gc->dc;
|
||||||
if (dc->mul.use)
|
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
|
||||||
cx = gc->dc->clip.x; cy = gc->dc->clip.y;
|
cx = gc->dc->clip.x; cy = gc->dc->clip.y;
|
||||||
cw = gc->dc->clip.w; ch = gc->dc->clip.h;
|
cw = gc->dc->clip.w; ch = gc->dc->clip.h;
|
||||||
|
|
||||||
if (offset_hack)
|
//Increment pixels since the gl line origin position is slightly different.
|
||||||
{
|
|
||||||
/* Increment pixels since the gl line origin position is slightly different
|
|
||||||
on some platform. Carsten did this hack.. doesn't remember exactly why but
|
|
||||||
it works most drivers. */
|
|
||||||
if (x1 == x2)
|
if (x1 == x2)
|
||||||
{
|
{
|
||||||
if (gc->rot == 0)
|
if ((gc->rot == 0) ||(gc->rot == 90))
|
||||||
|
{
|
||||||
x1++;
|
x1++;
|
||||||
|
x2++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (y1 == y2)
|
if (y1 == y2)
|
||||||
{
|
{
|
||||||
if ((gc->rot == 90) || (gc->rot == 180))
|
if ((gc->rot == 90) || (gc->rot == 180))
|
||||||
|
{
|
||||||
y1++;
|
y1++;
|
||||||
|
y2++;
|
||||||
}
|
}
|
||||||
|
|
||||||
x2++; y2++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
evas_gl_common_context_line_push(gc, x1, y1, x2, y2,
|
evas_gl_common_context_line_push(gc, x1, y1, x2, y2,
|
||||||
|
|
Loading…
Reference in New Issue