summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_cb_bitmap.c
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2008-03-23 14:18:06 +1100
committerBen Skeggs <skeggsb@gmail.com>2008-03-23 14:18:06 +1100
commitdcf04ee23c0131c2a3fdb267d132d6b27db393c4 (patch)
treed1a3fa9823f28c37dc8d7d8649d68e2f9a7c4b47 /src/mesa/state_tracker/st_cb_bitmap.c
parent75b85fd33abe143d9cca6f8405f0a4243b6a5ddb (diff)
parenta35c1ca3ad4361fee30d21ef13d8d37ae91aee66 (diff)
Merge remote branch 'upstream/gallium-0.1' into nouveau-gallium-0.1
Diffstat (limited to 'src/mesa/state_tracker/st_cb_bitmap.c')
-rw-r--r--src/mesa/state_tracker/st_cb_bitmap.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c
index 33256196bb..acc22d4323 100644
--- a/src/mesa/state_tracker/st_cb_bitmap.c
+++ b/src/mesa/state_tracker/st_cb_bitmap.c
@@ -32,6 +32,7 @@
#include "main/imports.h"
#include "main/image.h"
+#include "main/bufferobj.h"
#include "main/macros.h"
#include "main/texformat.h"
#include "shader/program.h"
@@ -191,7 +192,6 @@ combined_bitmap_fragment_program(GLcontext *ctx)
}
-
/**
* Create a texture which represents a bitmap image.
*/
@@ -224,19 +224,20 @@ make_bitmap_texture(GLcontext *ctx, GLsizei width, GLsizei height,
assert( 0 );
}
+ /* PBO source... */
+ bitmap = _mesa_map_bitmap_pbo(ctx, unpack, bitmap);
+ if (!bitmap) {
+ return NULL;
+ }
+
/**
- * Create a texture.
+ * Create texture to hold bitmap pattern.
*/
pt = st_texture_create(ctx->st, PIPE_TEXTURE_2D, format, 0, width, height,
1, 0);
- if (!pt)
+ if (!pt) {
+ _mesa_unmap_bitmap_pbo(ctx, unpack);
return NULL;
-
- if (unpack->BufferObj && unpack->BufferObj->Name) {
- /*
- pt->region = buffer_object_region(unpack->BufferObj);
- */
- printf("st_Bitmap (sourcing from PBO not implemented yet)\n");
}
surface = screen->get_tex_surface(screen, pt, 0, 0, 0);
@@ -301,6 +302,8 @@ make_bitmap_texture(GLcontext *ctx, GLsizei width, GLsizei height,
} /* row */
+ _mesa_unmap_bitmap_pbo(ctx, unpack);
+
/* Release surface */
pipe_surface_unmap(surface);
pipe_surface_reference(&surface, NULL);