[Mesa-dev] [PATCH 1/8] mesa: use is_bufferobj() helper function
nobled
nobled at dreamwidth.org
Tue Apr 19 19:30:03 PDT 2011
---
src/mesa/drivers/x11/xm_dd.c | 4 ++--
src/mesa/main/drawpix.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c
index 3031b7b..1369946 100644
--- a/src/mesa/drivers/x11/xm_dd.c
+++ b/src/mesa/drivers/x11/xm_dd.c
@@ -445,7 +445,7 @@ xmesa_DrawPixels_8R8G8B( struct gl_context *ctx,
if (swrast->NewState)
_swrast_validate_derived( ctx );
- if (unpack->BufferObj->Name) {
+ if (_mesa_is_bufferobj(unpack->BufferObj)) {
/* unpack from PBO */
GLubyte *buf;
if (!_mesa_validate_pbo_access(2, unpack, width, height, 1,
@@ -507,7 +507,7 @@ xmesa_DrawPixels_8R8G8B( struct gl_context *ctx,
XPutImage(dpy, xrb->pixmap, gc, &ximage, 0, 0, dstX, dstY, w, h);
}
- if (unpack->BufferObj->Name) {
+ if (_mesa_is_bufferobj(unpack->BufferObj)) {
ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT,
unpack->BufferObj);
}
diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c
index ee379f7..a8b948d 100644
--- a/src/mesa/main/drawpix.c
+++ b/src/mesa/main/drawpix.c
@@ -90,7 +90,7 @@ _mesa_DrawPixels( GLsizei width, GLsizei height,
GLint x = IROUND(ctx->Current.RasterPos[0]);
GLint y = IROUND(ctx->Current.RasterPos[1]);
- if (ctx->Unpack.BufferObj->Name) {
+ if (_mesa_is_bufferobj(ctx->Unpack.BufferObj)) {
/* unpack from PBO */
if (!_mesa_validate_pbo_access(2, &ctx->Unpack, width, height, 1,
format, type, pixels)) {
@@ -249,7 +249,7 @@ _mesa_Bitmap( GLsizei width, GLsizei height,
GLint x = IFLOOR(ctx->Current.RasterPos[0] + epsilon - xorig);
GLint y = IFLOOR(ctx->Current.RasterPos[1] + epsilon - yorig);
- if (ctx->Unpack.BufferObj->Name) {
+ if (_mesa_is_bufferobj(ctx->Unpack.BufferObj)) {
/* unpack from PBO */
if (!_mesa_validate_pbo_access(2, &ctx->Unpack, width, height, 1,
GL_COLOR_INDEX, GL_BITMAP,
--
1.7.0.4
More information about the mesa-dev
mailing list