From 17a7d136decc9d6532069f9c70051799e690b0a9 Mon Sep 17 00:00:00 2001 From: "Mun, Gwan-gyeong" Date: Sun, 10 Apr 2011 17:46:24 +0900 Subject: [PATCH] [Fix Bug] fix evas-GL backend's screen rotation clip region. - reference : http://trac.enlightenment.org/e/changeset/58381 Change-Id: Ic933e4ec58438b87361172f7ff390c3aa53e6e95 --- debian/changelog | 9 +++++ src/modules/engines/gl_common/evas_gl_context.c | 49 +++++++++++++++++++++++-- 2 files changed, 54 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 244c740..933fccf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +evas (1.0.0.001+svn.58227slp2+build03) unstable; urgency=low + + * [Fix Bug] fix evas-GL backend's screen rotation clip region. + - reference : http://trac.enlightenment.org/e/changeset/58381 + * Git: 165.213.180.234:slp/pkgs/e/evas + * Tag: evas_1.0.0.001+svn.58227slp2+build03 + + -- Gwangyeong Mun Mon, 11 Apr 2011 15:06:15 +0900 + evas (1.0.0.001+svn.58227slp2+build02) unstable; urgency=low * Package Upload diff --git a/src/modules/engines/gl_common/evas_gl_context.c b/src/modules/engines/gl_common/evas_gl_context.c index 5be4d4f..f0a1fe3 100644 --- a/src/modules/engines/gl_common/evas_gl_context.c +++ b/src/modules/engines/gl_common/evas_gl_context.c @@ -2588,6 +2588,31 @@ evas_gl_common_context_flush(Evas_Engine_GL_Context *gc) shader_array_flush(gc); } +//fix gl rot bug : http://trac.enlightenment.org/e/changeset/58381 +static void +scissor_rot(Evas_Engine_GL_Context *gc __UNUSED__, + int rot, int gw, int gh, int cx, int cy, int cw, int ch) +{ + switch (rot) + { + case 0: // UP this way: ^ + glScissor(cx, cy, cw, ch); + break; + case 90: // UP this way: < + glScissor(gh - (cy + ch), cx, ch, cw); + break; + case 180: // UP this way: v + glScissor(gw - (cx + cw), gh - (cy + ch), cw, ch); + break; + case 270: // UP this way: > + glScissor(cy, gw - (cx + cw), ch, cw); + break; + default: // assume up is up + glScissor(cx, cy, cw, ch); + break; + } +} + static void shader_array_flush(Evas_Engine_GL_Context *gc) { @@ -2747,8 +2772,16 @@ shader_array_flush(Evas_Engine_GL_Context *gc) cy = gh - gc->pipe[i].shader.cy - gc->pipe[i].shader.ch; if (fbo) cy = gc->pipe[i].shader.cy; glEnable(GL_SCISSOR_TEST); - glScissor(gc->pipe[i].shader.cx, cy, - gc->pipe[i].shader.cw, gc->pipe[i].shader.ch); + + if (!fbo) //fix gl rot bug : http://trac.enlightenment.org/e/changeset/5838 + scissor_rot(gc, gc->rot, gw, gh, + gc->pipe[i].shader.cx, + cy, + gc->pipe[i].shader.cw, + gc->pipe[i].shader.ch); + else + glScissor(gc->pipe[i].shader.cx, cy, + gc->pipe[i].shader.cw, gc->pipe[i].shader.ch); setclip = 1; } else @@ -2766,8 +2799,16 @@ shader_array_flush(Evas_Engine_GL_Context *gc) { cy = gh - gc->pipe[i].shader.cy - gc->pipe[i].shader.ch; if (fbo) cy = gc->pipe[i].shader.cy; - glScissor(gc->pipe[i].shader.cx, cy, - gc->pipe[i].shader.cw, gc->pipe[i].shader.ch); + + if (!fbo) //fix gl rot bug : http://trac.enlightenment.org/e/changeset/58381 + scissor_rot(gc, gc->rot, gw, gh, + gc->pipe[i].shader.cx, + cy, + gc->pipe[i].shader.cw, + gc->pipe[i].shader.ch); + else + glScissor(gc->pipe[i].shader.cx, cy, + gc->pipe[i].shader.cw, gc->pipe[i].shader.ch); } } -- 2.7.4