jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=7512a54954710708a771a4a4e6601afcd421323e

commit 7512a54954710708a771a4a4e6601afcd421323e
Author: Jean-Philippe Andre <[email protected]>
Date:   Thu Jul 10 12:01:23 2014 +0900

    Evas gl: Fix upload of RGB+A textures [INCOMPLETE]
    
    The textures have duplicated borders, take them into account.
---
 src/modules/evas/engines/gl_common/evas_gl_context.c | 19 ++++++++++---------
 src/modules/evas/engines/gl_common/evas_gl_texture.c |  5 +++++
 2 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/src/modules/evas/engines/gl_common/evas_gl_context.c 
b/src/modules/evas/engines/gl_common/evas_gl_context.c
index 46d2dd1..6d788ce 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_context.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_context.c
@@ -2353,15 +2353,16 @@ 
evas_gl_common_context_rgb_a_pair_push(Evas_Engine_GL_Context *gc,
    gc->pipe[pn].array.num += 6;
    array_alloc(gc, pn);
 
-   tx1 = (sx) / (double)tex->pt->w;
-   ty1 = (sy) / (double)tex->pt->h;
-   tx2 = (sx + sw) / (double)tex->pt->w;
-   ty2 = (sy + sh) / (double)tex->pt->h;
-
-   t2x1 = sx / (double)tex->pta->w;
-   t2y1 = sy / (double)tex->pta->h;
-   t2x2 = (sx + sw) / (double)tex->pta->w;
-   t2y2 = (sy + sh) / (double)tex->pta->h;
+   // FIXME: pt and pta could have different x,y
+   tx1 = (tex->x + sx) / (double)tex->pt->w;
+   ty1 = (tex->y + sy) / (double)tex->pt->h;
+   tx2 = (tex->x + sx + sw) / (double)tex->pt->w;
+   ty2 = (tex->y + sy + sh) / (double)tex->pt->h;
+
+   t2x1 = (tex->x + sx) / (double)tex->pta->w;
+   t2y1 = (tex->y + sy) / (double)tex->pta->h;
+   t2x2 = (tex->x + sx + sw) / (double)tex->pta->w;
+   t2y2 = (tex->y + sy + sh) / (double)tex->pta->h;
 
    PUSH_VERTEX(pn, x    , y    , 0);
    PUSH_VERTEX(pn, x + w, y    , 0);
diff --git a/src/modules/evas/engines/gl_common/evas_gl_texture.c 
b/src/modules/evas/engines/gl_common/evas_gl_texture.c
index d7bdcac..a5209c3 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_texture.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_texture.c
@@ -1488,6 +1488,11 @@ 
evas_gl_common_texture_rgb_a_pair_new(Evas_Engine_GL_Context *gc,
    tex = evas_gl_common_texture_alloc(gc, w, h, EINA_TRUE);
    if (!tex) return NULL;
 
+   w += im->cache_entry.borders.l + im->cache_entry.borders.r;
+   h += im->cache_entry.borders.t + im->cache_entry.borders.b;
+   tex->x = im->cache_entry.borders.l;
+   tex->y = im->cache_entry.borders.t;
+
    // Allocate RGB texture normally - as a 'whole'
    tex->pt = _pool_tex_new(gc, w, h,
                            *matching_format[lformat].intformat,

-- 


Reply via email to