fix native surface stuff - rounding dimensions up was not smart! :)
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 23 Jan 2010 13:49:54 +0000 (13:49 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 23 Jan 2010 13:49:54 +0000 (13:49 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@45484 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/modules/engines/gl_common/evas_gl_common.h
src/modules/engines/gl_common/evas_gl_context.c
src/modules/engines/gl_common/evas_gl_image.c
src/modules/engines/gl_common/evas_gl_texture.c

index 0a1062d..d695cb8 100644 (file)
@@ -159,6 +159,8 @@ struct _Evas_GL_Texture_Pool
    int              slot, fslot;
    Eina_List       *allocations;
    Eina_Bool        whole : 1;
+   Eina_Bool        render : 1;
+   Eina_Bool        native : 1;
 };
 
 struct _Evas_GL_Texture
index e8df55f..f3091b5 100644 (file)
@@ -584,7 +584,7 @@ evas_gl_common_context_image_push(Evas_GL_Context *gc,
         ty2 = ((double)(tex->y) + sy + sh) / (double)tex->pt->h;
      }
    if (blend) bl = 0.0;
-   
+
    PUSH_VERTEX(x    , y    , 0);
    PUSH_VERTEX(x + w, y    , 0);
    PUSH_VERTEX(x    , y + h, 0);
index f723b92..e21fb85 100644 (file)
@@ -408,9 +408,7 @@ evas_gl_common_image_draw(Evas_GL_Context *gc, Evas_GL_Image *im, int sx, int sy
      yuv = 1;
    
    im->tex->im = im;
-   if ((!gc->dc->cutout.rects)
-//       || (gc->dc->cutout.active > 32)
-       )
+   if ((!gc->dc->cutout.rects) || (gc->dc->cutout.active > 8))
      {
         if (gc->dc->clip.use)
           {
index eced3b8..7823b1c 100644 (file)
@@ -271,6 +271,7 @@ _pool_tex_render_new(Evas_GL_Context *gc, int w, int h, int intformat, int forma
    pt->intformat = intformat;
    pt->format = format;
    pt->dataformat = GL_UNSIGNED_BYTE;
+   pt->render = 1;
    pt->references = 0;
 #if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
 # ifndef GL_FRAMEBUFFER
@@ -311,8 +312,6 @@ _pool_tex_native_new(Evas_GL_Context *gc, int w, int h, int intformat, int forma
    
    pt = calloc(1, sizeof(Evas_GL_Texture_Pool));
    if (!pt) return NULL;
-   h = _tex_round_slot(gc, h) << 4;
-//   _tex_adjust(gc, &w, &h);
    pt->gc = gc;
    pt->w = w;
    pt->h = h;
@@ -320,6 +319,7 @@ _pool_tex_native_new(Evas_GL_Context *gc, int w, int h, int intformat, int forma
    pt->format = format;
    pt->dataformat = GL_UNSIGNED_BYTE;
    pt->references = 0;
+   pt->native = 1;
    glGenTextures(1, &(pt->texture));
    glBindTexture(GL_TEXTURE_2D, pt->texture);
    
@@ -342,11 +342,14 @@ pt_unref(Evas_GL_Texture_Pool *pt)
 {
    pt->references--;
    if (pt->references > 0) return;
-   if (pt->whole)
-     pt->gc->shared->tex.whole = eina_list_remove(pt->gc->shared->tex.whole, pt);
-   else
-     pt->gc->shared->tex.atlas [pt->slot][pt->fslot] =
-     eina_list_remove(pt->gc->shared->tex.atlas[pt->slot][pt->fslot], pt);
+   if (!((pt->render) || (pt->native)))
+     {
+        if (pt->whole)
+          pt->gc->shared->tex.whole = eina_list_remove(pt->gc->shared->tex.whole, pt);
+        else
+          pt->gc->shared->tex.atlas [pt->slot][pt->fslot] =
+          eina_list_remove(pt->gc->shared->tex.atlas[pt->slot][pt->fslot], pt);
+     }
    glDeleteTextures(1, &(pt->texture));
    if (pt->fb) glsym_glDeleteFramebuffers(1, &(pt->fb));
    free(pt);