[cairo-commit] glitz/src glitz_texture.c,1.21,1.22

David Reveman commit at pdx.freedesktop.org
Wed Feb 15 18:57:54 PST 2006


Committed by: davidr

Update of /cvs/cairo/glitz/src
In directory gabe:/tmp/cvs-serv8434/src

Modified Files:
	glitz_texture.c 
Log Message:
GL_ARB_texture_rectangle and GL_ARB_texture_border_clamp are no longer required for texture objects

Index: glitz_texture.c
===================================================================
RCS file: /cvs/cairo/glitz/src/glitz_texture.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- glitz_texture.c	29 Nov 2005 22:41:27 -0000	1.21
+++ glitz_texture.c	16 Feb 2006 02:57:51 -0000	1.22
@@ -69,24 +69,15 @@
 	    GLITZ_TEXTURE_FLAG_PADABLE_MASK;
 	break;
     default:
+	texture->box.x1 = texture->box.y1 = 0;
+	texture->box.x2 = texture->width = width;
+	texture->box.y2 = texture->height = height;
+
+	texture->flags = GLITZ_TEXTURE_FLAG_PADABLE_MASK |
+	    GLITZ_TEXTURE_FLAG_REPEATABLE_MASK;
+
 	if (feature_mask & GLITZ_FEATURE_TEXTURE_BORDER_CLAMP_MASK)
-	{
-	    texture->box.x1 = texture->box.y1 = 0;
-	    texture->box.x2 = texture->width = width;
-	    texture->box.y2 = texture->height = height;
-	    texture->flags =  GLITZ_TEXTURE_FLAG_CLAMPABLE_MASK |
-		GLITZ_TEXTURE_FLAG_REPEATABLE_MASK |
-		GLITZ_TEXTURE_FLAG_PADABLE_MASK;
-	}
-	else
-	{
-	    texture->box.x1 = texture->box.y1 = 1;
-	    texture->box.x2 = width + 1;
-	    texture->box.y2 = height + 1;
-	    texture->width = width + 2;
-	    texture->height = height + 2;
-	    texture->flags =  GLITZ_TEXTURE_FLAG_CLAMPABLE_MASK;
-	}
+	    texture->flags |= GLITZ_TEXTURE_FLAG_CLAMPABLE_MASK;
     }
 
     if (!unnormalized &&
@@ -180,8 +171,8 @@
     glitz_texture_bind (gl, texture);
 
     if (TEXTURE_CLAMPABLE (texture) &&
-	(texture->box.x2 != texture->width ||
-	 texture->box.y2 != texture->height))
+	(texture->box.x2 > texture->width ||
+	 texture->box.y2 > texture->height))
     {
 	data = malloc (texture->width * texture->height);
 	if (data)
@@ -353,14 +344,9 @@
 
     GLITZ_GL_SURFACE (surface);
 
-    /* GL_ARB_texture_rectangle is required for sane texture coordinates.
-       GL_ARB_texture_border_clamp is required right now as glitz will
-       emulate it when missing, which means a 1 pixel translucent black
-       border inside textures and that cannot be exposed to clients. */
-    if ((!(surface->drawable->backend->feature_mask &
-	   GLITZ_FEATURE_TEXTURE_BORDER_CLAMP_MASK)) ||
-	(!(surface->drawable->backend->feature_mask &
-	   GLITZ_FEATURE_TEXTURE_BORDER_CLAMP_MASK)))
+    /* texture dimensions must match surface dimensions */
+    if (surface->texture.width  != surface->box.x2 &&
+	surface->texture.height != surface->box.y2)
 	return 0;
 
     texture = malloc (sizeof (glitz_texture_object_t));



More information about the cairo-commit mailing list