summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/dd.h
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2016-02-03 09:35:42 -0700
committerBrian Paul <[email protected]>2016-02-17 19:57:48 -0700
commitb26ddda12fe7dbb6a4e6af3b47c1e837cc7ebb03 (patch)
treea220397fcbea69d3e6dea7e0eece28186c82a7ba /src/mesa/main/dd.h
parent6f4a725073fcef6b7b5a7b9acdc99539fa3fa1f4 (diff)
mesa: implement a display list / glBitmap texture atlas
This improves the performance of applications which use glXUseXFont() or wglUseFontBitmaps() and glCallLists() to draw bitmap text. Basically, we collect all the glBitmap images from the display lists and put them into a texture atlas. To render the bitmaps for a glCallLists() command, we render a set of textured quads where each quad is textured with one bitmap image. Actually, the rendering part has to be done by the Mesa driver or Mesa/gallium state tracker. Note that GLUT demos that use glutBitmapCharacter() don't benefit from this. v2, per Nicolai Hähnle: - check the max tex rect size is at least 1024. - add comment in dd.h that texture_rectangle is required. - in _mesa_DeleteLists(), try to delete the atlas before the list(s) Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/mesa/main/dd.h')
-rw-r--r--src/mesa/main/dd.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 19ef3042548..3f5aa5db051 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -35,6 +35,7 @@
#include "glheader.h"
+struct gl_bitmap_atlas;
struct gl_buffer_object;
struct gl_context;
struct gl_display_list;
@@ -154,6 +155,14 @@ struct dd_function_table {
GLint x, GLint y, GLsizei width, GLsizei height,
const struct gl_pixelstore_attrib *unpack,
const GLubyte *bitmap );
+
+ /**
+ * Called by display list code for optimized glCallLists/glBitmap rendering
+ * The driver must support texture rectangles of width 1024 or more.
+ */
+ void (*DrawAtlasBitmaps)(struct gl_context *ctx,
+ const struct gl_bitmap_atlas *atlas,
+ GLuint count, const GLubyte *ids);
/*@}*/