Enlightenment CVS committal
Author : raster
Project : e17
Module : libs/evas
Dir : e17/libs/evas/src/modules/engines/gl_common
Modified Files:
evas_gl_common.h evas_gl_context.c evas_gl_font.c
Log Message:
bring gl engine vaguely back up to snuff.
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/gl_common/evas_gl_common.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- evas_gl_common.h 30 Sep 2006 10:18:34 -0000 1.5
+++ evas_gl_common.h 6 Dec 2006 14:58:00 -0000 1.6
@@ -42,24 +42,25 @@
{
int w, h;
- char dither : 1;
- char blend : 1;
+ unsigned char dither : 1;
+ unsigned char blend : 1;
+ unsigned char blend_alpha : 1;
unsigned char r, g, b, a;
struct {
- char size : 1;
- char dither : 1;
- char blend : 1;
- char color : 1;
- char texture : 1;
- char clip : 1;
- char buf : 1;
- char other : 1;
+ unsigned char size : 1;
+ unsigned char dither : 1;
+ unsigned char blend : 1;
+ unsigned char color : 1;
+ unsigned char texture : 1;
+ unsigned char clip : 1;
+ unsigned char buf : 1;
+ unsigned char other : 1;
} change;
struct {
- char active : 1;
- int x, y, w, h;
+ unsigned char active : 1;
+ int x, y, w, h;
} clip;
struct {
@@ -74,7 +75,7 @@
Evas_GL_Texture *texture;
GLuint font_texture;
- char font_texture_rectangle : 1;
+ unsigned char font_texture_rectangle : 1;
int max_texture_depth;
int max_texture_size;
@@ -96,12 +97,12 @@
GLuint texture;
- char smooth : 1;
- char changed : 1;
- char have_mipmaps : 1;
- char rectangle : 1;
- char not_power_of_two : 1;
- char opt : 1;
+ unsigned char smooth : 1;
+ unsigned char changed : 1;
+ unsigned char have_mipmaps : 1;
+ unsigned char rectangle : 1;
+ unsigned char not_power_of_two : 1;
+ unsigned char opt : 1;
int references;
};
@@ -114,8 +115,8 @@
RGBA_Image_Loadopts load_opts;
int putcount;
int references;
- char dirty : 1;
- char cached : 1;
+ unsigned char dirty : 1;
+ unsigned char cached : 1;
};
struct _Evas_GL_Polygon
@@ -153,7 +154,7 @@
int w, h;
GLuint texture;
int references;
- char rectangle : 1;
+ unsigned char rectangle : 1;
Evas_List *allocations;
};
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/gl_common/evas_gl_context.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- evas_gl_context.c 30 Sep 2006 10:18:34 -0000 1.2
+++ evas_gl_context.c 6 Dec 2006 14:58:00 -0000 1.3
@@ -73,8 +73,8 @@
// this causes at least nvidia's drivers to go into pathological pain when
// changing textures a lot (doing video). so we wont do anything with this
// for now, but it does work.
- gc->ext.arb_texture_non_power_of_two = 0; printf("DISABLE
GL_ARB_texture_non_power_of_two\n");
-// gc->ext.nv_texture_rectangle = 0; printf("DISABLE
GL_NV_texture_rectangle\n");
+// gc->ext.arb_texture_non_power_of_two = 0; printf("DISABLE
GL_ARB_texture_non_power_of_two\n");
+ gc->ext.nv_texture_rectangle = 0; printf("DISABLE
GL_NV_texture_rectangle\n");
}
else
{
@@ -127,9 +127,27 @@
void
evas_gl_common_context_blend_set(Evas_GL_Context *gc, int blend)
{
- if (((blend) && (gc->blend)) || ((!blend) && (!gc->blend))) return;
- gc->change.blend = 1;
- gc->blend = blend;
+ if (blend == 1)
+ {
+ if (gc->blend) return;
+ gc->change.blend = 1;
+ gc->blend = 1;
+ gc->blend_alpha = 0;
+ }
+ else if (blend == 2)
+ {
+ if (gc->blend_alpha) return;
+ gc->change.blend = 1;
+ gc->blend = 0;
+ gc->blend_alpha = 1;
+ }
+ else
+ {
+ if ((!gc->blend) && (!gc->blend_alpha)) return;
+ gc->change.blend = 1;
+ gc->blend = 0;
+ gc->blend_alpha = 0;
+ }
if (_evas_gl_common_context == gc) _evas_gl_common_blend_set(gc);
}
@@ -267,7 +285,12 @@
_evas_gl_common_blend_set(Evas_GL_Context *gc)
{
if (!gc->change.blend) return;
- if (gc->blend)
+ if (gc->blend_alpha)
+ {
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ }
+ else if (gc->blend)
{
glEnable(GL_BLEND);
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
@@ -350,7 +373,7 @@
{
if (gc->texture->smooth)
{
- glTexParameteri(GL_TEXTURE_2D,
GL_TEXTURE_MAX_ANISOTROPY_EXT, 8);
+ glTexParameteri(GL_TEXTURE_2D,
GL_TEXTURE_MAX_ANISOTROPY_EXT, 16);
glTexParameteri(GL_TEXTURE_2D,
GL_TEXTURE_MAG_FILTER, GL_LINEAR);
if (gc->texture->have_mipmaps)
glTexParameteri(GL_TEXTURE_2D,
GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/gl_common/evas_gl_font.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- evas_gl_font.c 30 Sep 2006 10:18:34 -0000 1.2
+++ evas_gl_font.c 6 Dec 2006 14:58:00 -0000 1.3
@@ -181,9 +181,14 @@
int r, g, b, a;
a = (dc->col.col >> 24) & 0xff;
+ if (a == 0) return;
r = (dc->col.col >> 16) & 0xff;
g = (dc->col.col >> 8 ) & 0xff;
b = (dc->col.col ) & 0xff;
+ /* have to un-premul the color - as we are using blend mode 2
(non-premul blend) */
+ r = (r * 255) / a;
+ g = (g * 255) / a;
+ b = (b * 255) / a;
evas_gl_common_context_color_set(gc, r, g, b, a);
if (dc->clip.use)
evas_gl_common_context_clip_set(gc, 1,
@@ -192,7 +197,7 @@
else
evas_gl_common_context_clip_set(gc, 0,
0, 0, 0, 0);
- evas_gl_common_context_blend_set(gc, 1);
+ evas_gl_common_context_blend_set(gc, 2);
evas_gl_common_context_read_buf_set(gc, GL_BACK);
evas_gl_common_context_write_buf_set(gc, GL_BACK);
}
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs