allow max cutout rects to be tunable. and change3 default for gl?
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 2 Aug 2010 06:46:38 +0000 (06:46 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 2 Aug 2010 06:46:38 +0000 (06:46 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/evas@50736 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 e9dfbeb..e1a7ada 100644 (file)
@@ -95,6 +95,8 @@ struct _Evas_GL_Shared
       Eina_Bool bgra : 1;
       Eina_Bool tex_npo2 : 1;
       Eina_Bool tex_rect : 1;
+      // tuning params - per gpu/cpu combo?
+      int cutout_max;
    } info;
    
    struct {
index 098c8b3..86cdc93 100644 (file)
@@ -399,26 +399,34 @@ evas_gl_common_context_new(void)
              if ((strstr((char*) ext, "GL_EXT_bgra")) ||
                  (strstr((char*) ext, "GL_EXT_texture_format_BGRA8888")))
                shared->info.bgra = 1;
-#endif             
+#endif
           }
         glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS,
                       &(shared->info.max_texture_units));
         glGetIntegerv(GL_MAX_TEXTURE_SIZE,
                       &(shared->info.max_texture_size));
         
+        shared->info.cutout_max = 512; // hmmm is this good?
+        if (getenv("EVAS_GL_CUTOUT_MAX"))
+           shared->info.cutout_max = atoi(getenv("EVAS_GL_CUTOUT_MAX"));
+        
         fprintf(stderr, "max tex size %ix%i\n"
                 "max units %i\n"
                 "non-power-2 tex %i\n"
                 "rect tex %i\n"
                 "bgra : %i\n"
                 "max ansiotropic filtering: %3.3f\n"
+                "\n"
+                "cutout max: %i\n"
                 , 
                 shared->info.max_texture_size, shared->info.max_texture_size,
                 shared->info.max_texture_units,
                 (int)shared->info.tex_npo2,
                 (int)shared->info.tex_rect,
                 (int)shared->info.bgra,
-                (double)shared->info.anisotropic
+                (double)shared->info.anisotropic,
+                
+                shared->info.cutout_max
                 );
         
         glDisable(GL_DEPTH_TEST);
index 72be3ae..9bd6cda 100644 (file)
@@ -454,7 +454,9 @@ 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 > 16))
+   if ((!gc->dc->cutout.rects) || 
+       ((gc->shared->info.cutout_max > 0) &&
+           (gc->dc->cutout.active > gc->shared->info.cutout_max)))
      {
         if (gc->dc->clip.use)
           {
index c26ab24..47b399e 100644 (file)
@@ -10,10 +10,17 @@ static const GLenum rgb_fmt    = GL_RGBA;
 static const GLenum rgb_ifmt   = GL_RGB;
 //#endif
 #ifdef GL_BGRA
+# if 0 //tegra 2 below. wtf?
+static const GLenum bgra_fmt   = GL_BGRA;
+static const GLenum bgra_ifmt  = GL_BGRA;
+static const GLenum bgr_fmt    = GL_BGRA;
+static const GLenum bgr_ifmt   = GL_BGRA;
+# else // everything else but tegra2
 static const GLenum bgra_fmt   = GL_BGRA;
 static const GLenum bgra_ifmt  = GL_RGBA;
 static const GLenum bgr_fmt    = GL_BGRA;
 static const GLenum bgr_ifmt   = GL_RGB;
+# endif
 #endif
 static const GLenum alpha_fmt  = GL_ALPHA;
 static const GLenum alpha_ifmt = GL_ALPHA;