summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2013-11-05 15:36:13 -0800
committerIan Romanick <[email protected]>2014-01-20 11:29:42 -0800
commit83bd850cc7f83c87fa271d6d501db86fae698f9a (patch)
treea41853abee37050597344d05cf1c55b4d0399617 /src/mesa/main
parenta9c73fb778a41b422a811c67b4aba806d4dfb7c8 (diff)
mesa: Move parameter validation from _mesa_set_viewport to _mesa_Viewport
Internal callers should do the right thing. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/viewport.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/mesa/main/viewport.c b/src/mesa/main/viewport.c
index 3aaab2d4659..3bc89ab030a 100644
--- a/src/mesa/main/viewport.c
+++ b/src/mesa/main/viewport.c
@@ -47,6 +47,16 @@ _mesa_Viewport(GLint x, GLint y, GLsizei width, GLsizei height)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glViewport %d %d %d %d\n", x, y, width, height);
+
+ if (width < 0 || height < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glViewport(%d, %d, %d, %d)", x, y, width, height);
+ return;
+ }
+
_mesa_set_viewport(ctx, x, y, width, height);
}
@@ -64,15 +74,6 @@ void
_mesa_set_viewport(struct gl_context *ctx, GLint x, GLint y,
GLsizei width, GLsizei height)
{
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glViewport %d %d %d %d\n", x, y, width, height);
-
- if (width < 0 || height < 0) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glViewport(%d, %d, %d, %d)", x, y, width, height);
- return;
- }
-
/* clamp width and height to the implementation dependent range */
width = MIN2(width, (GLsizei) ctx->Const.MaxViewportWidth);
height = MIN2(height, (GLsizei) ctx->Const.MaxViewportHeight);