mesa: Pass GL context to _mesa_create_save_table
[mesa.git] / src / mesa / main / drawpix.c
index def55dddde1f1cca88d433bcc46185f4126ddf4f..b5ab2cbeb7af32e75d87c93673385f877cd6718b 100644 (file)
@@ -35,9 +35,8 @@
 #include "pbo.h"
 #include "state.h"
 #include "dispatch.h"
-
-
-#if FEATURE_drawpix
+#include "glformats.h"
+#include "fbobject.h"
 
 
 /*
@@ -89,7 +88,7 @@ _mesa_DrawPixels( GLsizei width, GLsizei height,
     * input), NVIDIA's implementation also just returns this error despite
     * exposing GL_EXT_texture_integer, just return an error regardless.
     */
-   if (_mesa_is_integer_format(format)) {
+   if (_mesa_is_enum_format_integer(format)) {
       _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawPixels(integer format)");
       goto end;
    }
@@ -239,8 +238,9 @@ _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height,
       goto end;
    }
 
-   if (ctx->ReadBuffer->Name != 0 && ctx->ReadBuffer->Visual.samples > 0) {
-      _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION,
+   if (_mesa_is_user_fbo(ctx->ReadBuffer) &&
+       ctx->ReadBuffer->Visual.samples > 0) {
+      _mesa_error(ctx, GL_INVALID_OPERATION,
                  "glCopyPixels(multisample FBO)");
       goto end;
    }
@@ -376,6 +376,3 @@ _mesa_init_drawpix_dispatch(struct _glapi_table *disp)
    SET_CopyPixels(disp, _mesa_CopyPixels);
    SET_DrawPixels(disp, _mesa_DrawPixels);
 }
-
-
-#endif /* FEATURE_drawpix */