From 3b6c09d89be53488de9782b3126a70e5301df2b4 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Mon, 2 Aug 2010 06:46:38 +0000 Subject: [PATCH] allow max cutout rects to be tunable. and change3 default for gl? SVN revision: 50736 --- .../src/modules/engines/gl_common/evas_gl_common.h | 2 ++ .../src/modules/engines/gl_common/evas_gl_context.c | 12 ++++++++++-- .../src/modules/engines/gl_common/evas_gl_image.c | 4 +++- .../src/modules/engines/gl_common/evas_gl_texture.c | 7 +++++++ 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/legacy/evas/src/modules/engines/gl_common/evas_gl_common.h b/legacy/evas/src/modules/engines/gl_common/evas_gl_common.h index e9dfbeb162..e1a7ada780 100644 --- a/legacy/evas/src/modules/engines/gl_common/evas_gl_common.h +++ b/legacy/evas/src/modules/engines/gl_common/evas_gl_common.h @@ -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 { diff --git a/legacy/evas/src/modules/engines/gl_common/evas_gl_context.c b/legacy/evas/src/modules/engines/gl_common/evas_gl_context.c index 098c8b332f..86cdc93a75 100644 --- a/legacy/evas/src/modules/engines/gl_common/evas_gl_context.c +++ b/legacy/evas/src/modules/engines/gl_common/evas_gl_context.c @@ -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); diff --git a/legacy/evas/src/modules/engines/gl_common/evas_gl_image.c b/legacy/evas/src/modules/engines/gl_common/evas_gl_image.c index 72be3ae708..9bd6cda54c 100644 --- a/legacy/evas/src/modules/engines/gl_common/evas_gl_image.c +++ b/legacy/evas/src/modules/engines/gl_common/evas_gl_image.c @@ -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) { diff --git a/legacy/evas/src/modules/engines/gl_common/evas_gl_texture.c b/legacy/evas/src/modules/engines/gl_common/evas_gl_texture.c index c26ab24efd..47b399e6ec 100644 --- a/legacy/evas/src/modules/engines/gl_common/evas_gl_texture.c +++ b/legacy/evas/src/modules/engines/gl_common/evas_gl_texture.c @@ -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;