Merge branch 'mesa_7_7_branch'
[mesa.git] / src / mesa / swrast / s_bitmap.c
index 2308acae1cd826371c3f530104f80ab3ff6c939b..59e26e9ea3186f1ab58d3fc9edb322e4370ac1a1 100644 (file)
  */
 
 #include "main/glheader.h"
-#include "bufferobj.h"
-#include "image.h"
+#include "main/bufferobj.h"
+#include "main/condrender.h"
+#include "main/image.h"
 #include "main/macros.h"
-#include "pixel.h"
 
 #include "s_context.h"
 #include "s_span.h"
@@ -50,18 +50,20 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
                const struct gl_pixelstore_attrib *unpack,
                const GLubyte *bitmap )
 {
-   SWcontext *swrast = SWRAST_CONTEXT(ctx);
    GLint row, col;
    GLuint count = 0;
    SWspan span;
 
    ASSERT(ctx->RenderMode == GL_RENDER);
 
-   bitmap = _mesa_map_bitmap_pbo(ctx, unpack, bitmap);
+   if (!_mesa_check_conditional_render(ctx))
+      return; /* don't draw */
+
+   bitmap = (const GLubyte *) _mesa_map_pbo_source(ctx, unpack, bitmap);
    if (!bitmap)
       return;
 
-   RENDER_START(swrast,ctx);
+   swrast_render_start(ctx);
 
    if (SWRAST_CONTEXT(ctx)->NewState)
       _swrast_validate_derived( ctx );
@@ -132,9 +134,9 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
       }
    }
 
-   RENDER_FINISH(swrast,ctx);
+   swrast_render_finish(ctx);
 
-   _mesa_unmap_bitmap_pbo(ctx, unpack);
+   _mesa_unmap_pbo_source(ctx, unpack);
 }
 
 
@@ -157,7 +159,7 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
    ASSERT(ctx->RenderMode == GL_RENDER);
    ASSERT(bitmap);
 
-   RENDER_START(swrast,ctx);
+   swrast_render_start(ctx);
 
    if (SWRAST_CONTEXT(ctx)->NewState)
       _swrast_validate_derived( ctx );
@@ -224,6 +226,6 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
       }
    }
 
-   RENDER_FINISH(swrast,ctx);
+   swrast_render_finish(ctx);
 }
 #endif