allow max cutout rects to be tunable. and change3 default for gl?

SVN revision: 50736
This commit is contained in:
Carsten Haitzler 2010-08-02 06:46:38 +00:00
parent 50649552e3
commit 3b6c09d89b
4 changed files with 22 additions and 3 deletions

View File

@ -95,6 +95,8 @@ struct _Evas_GL_Shared
Eina_Bool bgra : 1; Eina_Bool bgra : 1;
Eina_Bool tex_npo2 : 1; Eina_Bool tex_npo2 : 1;
Eina_Bool tex_rect : 1; Eina_Bool tex_rect : 1;
// tuning params - per gpu/cpu combo?
int cutout_max;
} info; } info;
struct { struct {

View File

@ -399,26 +399,34 @@ evas_gl_common_context_new(void)
if ((strstr((char*) ext, "GL_EXT_bgra")) || if ((strstr((char*) ext, "GL_EXT_bgra")) ||
(strstr((char*) ext, "GL_EXT_texture_format_BGRA8888"))) (strstr((char*) ext, "GL_EXT_texture_format_BGRA8888")))
shared->info.bgra = 1; shared->info.bgra = 1;
#endif #endif
} }
glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS,
&(shared->info.max_texture_units)); &(shared->info.max_texture_units));
glGetIntegerv(GL_MAX_TEXTURE_SIZE, glGetIntegerv(GL_MAX_TEXTURE_SIZE,
&(shared->info.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" fprintf(stderr, "max tex size %ix%i\n"
"max units %i\n" "max units %i\n"
"non-power-2 tex %i\n" "non-power-2 tex %i\n"
"rect tex %i\n" "rect tex %i\n"
"bgra : %i\n" "bgra : %i\n"
"max ansiotropic filtering: %3.3f\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_size, shared->info.max_texture_size,
shared->info.max_texture_units, shared->info.max_texture_units,
(int)shared->info.tex_npo2, (int)shared->info.tex_npo2,
(int)shared->info.tex_rect, (int)shared->info.tex_rect,
(int)shared->info.bgra, (int)shared->info.bgra,
(double)shared->info.anisotropic (double)shared->info.anisotropic,
shared->info.cutout_max
); );
glDisable(GL_DEPTH_TEST); glDisable(GL_DEPTH_TEST);

View File

@ -454,7 +454,9 @@ evas_gl_common_image_draw(Evas_GL_Context *gc, Evas_GL_Image *im, int sx, int sy
yuv = 1; yuv = 1;
im->tex->im = im; 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) if (gc->dc->clip.use)
{ {

View File

@ -10,10 +10,17 @@ static const GLenum rgb_fmt = GL_RGBA;
static const GLenum rgb_ifmt = GL_RGB; static const GLenum rgb_ifmt = GL_RGB;
//#endif //#endif
#ifdef GL_BGRA #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_fmt = GL_BGRA;
static const GLenum bgra_ifmt = GL_RGBA; static const GLenum bgra_ifmt = GL_RGBA;
static const GLenum bgr_fmt = GL_BGRA; static const GLenum bgr_fmt = GL_BGRA;
static const GLenum bgr_ifmt = GL_RGB; static const GLenum bgr_ifmt = GL_RGB;
# endif
#endif #endif
static const GLenum alpha_fmt = GL_ALPHA; static const GLenum alpha_fmt = GL_ALPHA;
static const GLenum alpha_ifmt = GL_ALPHA; static const GLenum alpha_ifmt = GL_ALPHA;