summaryrefslogtreecommitdiff
path: root/src/mesa/main/drawpix.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/drawpix.c')
-rw-r--r--src/mesa/main/drawpix.c47
1 files changed, 27 insertions, 20 deletions
diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c
index a6c48f2d2e4..e9362829f70 100644
--- a/src/mesa/main/drawpix.c
+++ b/src/mesa/main/drawpix.c
@@ -22,11 +22,10 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
-#include "glheader.h"
+#include "util/glheader.h"
#include "draw_validate.h"
#include "bufferobj.h"
#include "context.h"
-#include "drawpix.h"
#include "enums.h"
#include "feedback.h"
#include "framebuffer.h"
@@ -38,7 +37,10 @@
#include "fbobject.h"
#include "util/u_math.h"
#include "util/rounding.h"
+#include "api_exec_decl.h"
+#include "state_tracker/st_cb_bitmap.h"
+#include "state_tracker/st_cb_drawpixels.h"
/*
* Execute glDrawPixels
@@ -73,8 +75,7 @@ _mesa_DrawPixels( GLsizei width, GLsizei height,
*/
_mesa_set_vp_override(ctx, GL_TRUE);
- if (ctx->NewState & _NEW_PIXEL)
- _mesa_update_pixel(ctx);
+ _mesa_update_pixel(ctx);
if (ctx->NewState)
_mesa_update_state(ctx);
@@ -167,8 +168,8 @@ _mesa_DrawPixels( GLsizei width, GLsizei height,
}
}
- ctx->Driver.DrawPixels(ctx, x, y, width, height, format, type,
- &ctx->Unpack, pixels);
+ st_DrawPixels(ctx, x, y, width, height, format, type,
+ &ctx->Unpack, pixels);
}
}
else if (ctx->RenderMode == GL_FEEDBACK) {
@@ -245,8 +246,7 @@ _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height,
*/
_mesa_set_vp_override(ctx, GL_TRUE);
- if (ctx->NewState & _NEW_PIXEL)
- _mesa_update_pixel(ctx);
+ _mesa_update_pixel(ctx);
if (ctx->NewState)
_mesa_update_state(ctx);
@@ -290,8 +290,8 @@ _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height,
if (width > 0 && height > 0) {
GLint destx = lroundf(ctx->Current.RasterPos[0]);
GLint desty = lroundf(ctx->Current.RasterPos[1]);
- ctx->Driver.CopyPixels( ctx, srcx, srcy, width, height, destx, desty,
- type );
+ st_CopyPixels( ctx, srcx, srcy, width, height, destx, desty,
+ type );
}
}
else if (ctx->RenderMode == GL_FEEDBACK) {
@@ -316,13 +316,11 @@ end:
}
-void GLAPIENTRY
-_mesa_Bitmap( GLsizei width, GLsizei height,
- GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove,
- const GLubyte *bitmap )
+void
+_mesa_bitmap(struct gl_context *ctx, GLsizei width, GLsizei height,
+ GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove,
+ const GLubyte *bitmap, struct pipe_resource *tex)
{
- GET_CURRENT_CONTEXT(ctx);
-
FLUSH_VERTICES(ctx, 0, 0);
if (width < 0 || height < 0) {
@@ -334,8 +332,7 @@ _mesa_Bitmap( GLsizei width, GLsizei height,
return; /* do nothing */
}
- if (ctx->NewState & _NEW_PIXEL)
- _mesa_update_pixel(ctx);
+ _mesa_update_pixel(ctx);
if (ctx->NewState)
_mesa_update_state(ctx);
@@ -355,7 +352,7 @@ _mesa_Bitmap( GLsizei width, GLsizei height,
GLint x = util_ifloor(ctx->Current.RasterPos[0] + epsilon - xorig);
GLint y = util_ifloor(ctx->Current.RasterPos[1] + epsilon - yorig);
- if (ctx->Unpack.BufferObj) {
+ if (!tex && ctx->Unpack.BufferObj) {
/* unpack from PBO */
if (!_mesa_validate_pbo_access(2, &ctx->Unpack, width, height,
1, GL_COLOR_INDEX, GL_BITMAP,
@@ -372,7 +369,7 @@ _mesa_Bitmap( GLsizei width, GLsizei height,
}
}
- ctx->Driver.Bitmap( ctx, x, y, width, height, &ctx->Unpack, bitmap );
+ st_Bitmap(ctx, x, y, width, height, &ctx->Unpack, bitmap, tex);
}
}
else if (ctx->RenderMode == GL_FEEDBACK) {
@@ -397,3 +394,13 @@ _mesa_Bitmap( GLsizei width, GLsizei height,
_mesa_flush(ctx);
}
}
+
+void GLAPIENTRY
+_mesa_Bitmap(GLsizei width, GLsizei height,
+ GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove,
+ const GLubyte *bitmap)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ _mesa_bitmap(ctx, width, height, xorig, yorig, xmove, ymove, bitmap, NULL);
+}