diff options
author | marha <marha@users.sourceforge.net> | 2012-08-31 15:18:29 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-09-04 14:23:28 +0200 |
commit | d7fc06ac528d54e0e1416cb8aa89b6fd072400a5 (patch) | |
tree | 74cccede044412bba5723a132f1385aa9259f04b /mesalib/src/mesa/main/pixelstore.c | |
parent | 9dec848b23cf905ded387820f2893425cc00d545 (diff) | |
download | vcxsrv-d7fc06ac528d54e0e1416cb8aa89b6fd072400a5.tar.gz vcxsrv-d7fc06ac528d54e0e1416cb8aa89b6fd072400a5.tar.bz2 vcxsrv-d7fc06ac528d54e0e1416cb8aa89b6fd072400a5.zip |
randrproto xwininfo fontconfig libxcb mesa xkeyboard-config pixman xserver
git update 31 Aug 2012
Diffstat (limited to 'mesalib/src/mesa/main/pixelstore.c')
-rw-r--r-- | mesalib/src/mesa/main/pixelstore.c | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/mesalib/src/mesa/main/pixelstore.c b/mesalib/src/mesa/main/pixelstore.c index 81474491d..d1e96aa8f 100644 --- a/mesalib/src/mesa/main/pixelstore.c +++ b/mesalib/src/mesa/main/pixelstore.c @@ -45,18 +45,24 @@ _mesa_PixelStorei( GLenum pname, GLint param ) switch (pname) { case GL_PACK_SWAP_BYTES: + if (!_mesa_is_desktop_gl(ctx)) + goto invalid_enum_error; if (param == (GLint)ctx->Pack.SwapBytes) return; FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); ctx->Pack.SwapBytes = param ? GL_TRUE : GL_FALSE; break; case GL_PACK_LSB_FIRST: + if (!_mesa_is_desktop_gl(ctx)) + goto invalid_enum_error; if (param == (GLint)ctx->Pack.LsbFirst) return; FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); ctx->Pack.LsbFirst = param ? GL_TRUE : GL_FALSE; break; case GL_PACK_ROW_LENGTH: + if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx)) + goto invalid_enum_error; if (param<0) { _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); return; @@ -67,6 +73,8 @@ _mesa_PixelStorei( GLenum pname, GLint param ) ctx->Pack.RowLength = param; break; case GL_PACK_IMAGE_HEIGHT: + if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx)) + goto invalid_enum_error; if (param<0) { _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); return; @@ -77,6 +85,8 @@ _mesa_PixelStorei( GLenum pname, GLint param ) ctx->Pack.ImageHeight = param; break; case GL_PACK_SKIP_PIXELS: + if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx)) + goto invalid_enum_error; if (param<0) { _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); return; @@ -87,6 +97,8 @@ _mesa_PixelStorei( GLenum pname, GLint param ) ctx->Pack.SkipPixels = param; break; case GL_PACK_SKIP_ROWS: + if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx)) + goto invalid_enum_error; if (param<0) { _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); return; @@ -97,6 +109,8 @@ _mesa_PixelStorei( GLenum pname, GLint param ) ctx->Pack.SkipRows = param; break; case GL_PACK_SKIP_IMAGES: + if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx)) + goto invalid_enum_error; if (param<0) { _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); return; @@ -117,6 +131,8 @@ _mesa_PixelStorei( GLenum pname, GLint param ) ctx->Pack.Alignment = param; break; case GL_PACK_INVERT_MESA: + if (!_mesa_is_desktop_gl(ctx)) + goto invalid_enum_error; if (!ctx->Extensions.MESA_pack_invert) { _mesa_error( ctx, GL_INVALID_ENUM, "glPixelstore(pname)" ); return; @@ -128,6 +144,8 @@ _mesa_PixelStorei( GLenum pname, GLint param ) break; case GL_UNPACK_SWAP_BYTES: + if (!_mesa_is_desktop_gl(ctx)) + goto invalid_enum_error; if (param == (GLint)ctx->Unpack.SwapBytes) return; if ((GLint)ctx->Unpack.SwapBytes == param) @@ -136,6 +154,8 @@ _mesa_PixelStorei( GLenum pname, GLint param ) ctx->Unpack.SwapBytes = param ? GL_TRUE : GL_FALSE; break; case GL_UNPACK_LSB_FIRST: + if (!_mesa_is_desktop_gl(ctx)) + goto invalid_enum_error; if (param == (GLint)ctx->Unpack.LsbFirst) return; if ((GLint)ctx->Unpack.LsbFirst == param) @@ -144,6 +164,8 @@ _mesa_PixelStorei( GLenum pname, GLint param ) ctx->Unpack.LsbFirst = param ? GL_TRUE : GL_FALSE; break; case GL_UNPACK_ROW_LENGTH: + if (ctx->API == API_OPENGLES) + goto invalid_enum_error; if (param<0) { _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); return; @@ -154,6 +176,8 @@ _mesa_PixelStorei( GLenum pname, GLint param ) ctx->Unpack.RowLength = param; break; case GL_UNPACK_IMAGE_HEIGHT: + if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx)) + goto invalid_enum_error; if (param<0) { _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); return; @@ -165,6 +189,8 @@ _mesa_PixelStorei( GLenum pname, GLint param ) ctx->Unpack.ImageHeight = param; break; case GL_UNPACK_SKIP_PIXELS: + if (ctx->API == API_OPENGLES) + goto invalid_enum_error; if (param<0) { _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); return; @@ -175,6 +201,8 @@ _mesa_PixelStorei( GLenum pname, GLint param ) ctx->Unpack.SkipPixels = param; break; case GL_UNPACK_SKIP_ROWS: + if (ctx->API == API_OPENGLES) + goto invalid_enum_error; if (param<0) { _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); return; @@ -185,6 +213,8 @@ _mesa_PixelStorei( GLenum pname, GLint param ) ctx->Unpack.SkipRows = param; break; case GL_UNPACK_SKIP_IMAGES: + if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx)) + goto invalid_enum_error; if (param < 0) { _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); return; @@ -205,9 +235,14 @@ _mesa_PixelStorei( GLenum pname, GLint param ) ctx->Unpack.Alignment = param; break; default: - _mesa_error( ctx, GL_INVALID_ENUM, "glPixelStore" ); - return; + goto invalid_enum_error; } + + return; + +invalid_enum_error: + _mesa_error( ctx, GL_INVALID_ENUM, "glPixelStore" ); + return; } |