allow color allocation policy to be set in evas

SVN revision: 3473
This commit is contained in:
Carsten Haitzler 2000-09-15 15:04:48 +00:00
parent f0563a7bfa
commit ff01c864a4
9 changed files with 22 additions and 12 deletions

View File

@ -62,6 +62,7 @@ struct _Evas
Visual *visual;
Colormap colormap;
int screen;
int colors;
Imlib_Image image;
int drawable_width, drawable_height;
@ -252,6 +253,7 @@ void evas_get_viewport(Evas e, double *x, double *y, double *w, double *h);
/* the output settings */
void evas_set_output(Evas e, Display *disp, Drawable d, Visual *v, Colormap c);
void evas_set_output_image(Evas e, Imlib_Image image);
void evas_set_output_colors(Evas e, int colors);
void evas_set_output_size(Evas e, int w, int h);
void evas_set_output_viewport(Evas e, double x, double y, double w, double h);
void evas_set_output_method(Evas e, Evas_Render_Method method);

View File

@ -2176,7 +2176,7 @@ __evas_gl_capable(Display *disp)
if (__evas_gl_cx) return 1;
if (glXQueryExtension(disp, &eb, &evb))
{
__evas_gl_init(disp, 0);
__evas_gl_init(disp, 0, 256);
if (__evas_gl_cx) return 1;
return 0;
}
@ -2219,7 +2219,7 @@ __evas_gl_get_colormap(Display *disp, int screen)
}
void
__evas_gl_init(Display *disp, int screen)
__evas_gl_init(Display *disp, int screen, int colors)
{
if (__evas_gl_cx) return;

View File

@ -196,7 +196,7 @@ void __evas_gl_gradient_draw(Evas_GL_Graident *gr, Display *disp, I
/***********/
/* drawing */
/***********/
void __evas_gl_init(Display *disp, int screen);
void __evas_gl_init(Display *disp, int screen, int colors);
int __evas_gl_capable(Display *disp);
void __evas_gl_flush_draw(Display *disp, Imlib_Image dstim, Window win);
void __evas_gl_sync(Display *disp);

View File

@ -792,7 +792,7 @@ __evas_image_get_colormap(Display *disp, int screen)
}
void
__evas_image_init(Display *disp, int screen)
__evas_image_init(Display *disp, int screen, int colors)
{
static int initted = 0;
@ -800,9 +800,9 @@ __evas_image_init(Display *disp, int screen)
{
imlib_set_font_cache_size(1024 * 1024);
imlib_set_cache_size(8 * 1024 * 1024);
imlib_set_color_usage(128);
initted = 1;
}
imlib_set_color_usage(colors);
}
void

View File

@ -100,7 +100,7 @@ void __evas_image_gradient_draw(Evas_Image_Graident *gr, Display
/***********/
/* drawing */
/***********/
void __evas_image_init(Display *disp, int screen);
void __evas_image_init(Display *disp, int screen, int colors);
int __evas_image_capable(Display *disp);
void __evas_image_flush_draw(Display *disp, Imlib_Image dstim, Window win);
void __evas_image_sync(Display *disp);

View File

@ -715,7 +715,7 @@ __evas_imlib_get_colormap(Display *disp, int screen)
}
void
__evas_imlib_init(Display *disp, int screen)
__evas_imlib_init(Display *disp, int screen, int colors)
{
static int initted = 0;
@ -723,9 +723,9 @@ __evas_imlib_init(Display *disp, int screen)
{
imlib_set_font_cache_size(1024 * 1024);
imlib_set_cache_size(8 * 1024 * 1024);
imlib_set_color_usage(128);
initted = 1;
}
imlib_set_color_usage(colors);
}
void

View File

@ -100,7 +100,7 @@ void __evas_imlib_gradient_draw(Evas_Imlib_Graident *gr, Display
/***********/
/* drawing */
/***********/
void __evas_imlib_init(Display *disp, int screen);
void __evas_imlib_init(Display *disp, int screen, int colors);
int __evas_imlib_capable(Display *disp);
void __evas_imlib_flush_draw(Display *disp, Imlib_Image dstim, Window win);
void __evas_imlib_sync(Display *disp);

View File

@ -18,7 +18,8 @@ evas_new(void)
e->current.viewport.y = 0.0;
e->current.viewport.w = 0.0;
e->current.viewport.h = 0.0;
e->current.render_method = RENDER_METHOD_3D_HARDWARE;
e->current.render_method = RENDER_METHOD_ALPHA_SOFTWARE;
e->current.colors = 128;
return e;
}

View File

@ -86,7 +86,7 @@ evas_render(Evas e)
void (*func_image_draw) (void *im, Display *disp, Imlib_Image dstim, Window w, int win_w, int win_h, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int cr, int cg, int cb, int ca);
void (*func_image_free) (void *im);
void (*func_flush_draw) (Display *disp, Imlib_Image dstim, Window w);
void (*func_init) (Display *disp, int screen);
void (*func_init) (Display *disp, int screen, int colors);
int (*func_image_get_width) (void *im);
int (*func_image_get_height) (void *im);
void * (*func_text_font_new) (Display *disp, char *font, int size);
@ -327,7 +327,7 @@ evas_render(Evas e)
evas_list_free(delete_objects);
}
func_init(e->current.display, e->current.screen);
func_init(e->current.display, e->current.screen, e->current.colors);
if (e->updates)
{
up = imlib_updates_merge_for_rendering(e->updates,
@ -744,6 +744,13 @@ evas_set_output_image(Evas e, Imlib_Image image)
e->changed = 1;
}
void
evas_set_output_colors(Evas e, int colors)
{
e->current.colors = colors;
e->changed = 1;
}
void
evas_set_output_size(Evas e, int w, int h)
{