i965: Add user clip planes support to gen6.
[mesa.git] / src / mesa / drivers / dri / intel / intel_pixel_copy.c
index 8efb7a60c265224b8eec267d5906bacd91561b29..c6b36ed429152dfe489a8af5968f03b3f6a34dda 100644 (file)
@@ -76,7 +76,7 @@ copypix_src_region(struct intel_context *intel, GLenum type)
  * we allow Scissor.
  */
 static GLboolean
-intel_check_copypixel_blit_fragment_ops(GLcontext * ctx)
+intel_check_copypixel_blit_fragment_ops(struct gl_context * ctx)
 {
    if (ctx->NewState)
       _mesa_update_state(ctx);
@@ -102,14 +102,14 @@ intel_check_copypixel_blit_fragment_ops(GLcontext * ctx)
  * CopyPixels with the blitter.  Don't support zooming, pixel transfer, etc.
  */
 static GLboolean
-do_blit_copypixels(GLcontext * ctx,
+do_blit_copypixels(struct gl_context * ctx,
                    GLint srcx, GLint srcy,
                    GLsizei width, GLsizei height,
                    GLint dstx, GLint dsty, GLenum type)
 {
    struct intel_context *intel = intel_context(ctx);
-   struct intel_region *dst = intel_drawbuf_region(intel);
-   struct intel_region *src = copypix_src_region(intel, type);
+   struct intel_region *dst;
+   struct intel_region *src;
    struct gl_framebuffer *fb = ctx->DrawBuffer;
    struct gl_framebuffer *read_fb = ctx->ReadBuffer;
    GLint orig_dstx;
@@ -134,12 +134,15 @@ do_blit_copypixels(GLcontext * ctx,
        ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F)
       return GL_FALSE;
 
+   intel_prepare_render(intel);
+
+   dst = intel_drawbuf_region(intel);
+   src = copypix_src_region(intel, type);
+
    if (!src || !dst)
       return GL_FALSE;
 
-   intelFlush(&intel->ctx);
-
-   intel_prepare_render(intel);
+   intel_flush(&intel->ctx);
 
    /* Clip to destination buffer. */
    orig_dstx = dstx;
@@ -195,7 +198,7 @@ out:
 
 
 void
-intelCopyPixels(GLcontext * ctx,
+intelCopyPixels(struct gl_context * ctx,
                 GLint srcx, GLint srcy,
                 GLsizei width, GLsizei height,
                 GLint destx, GLint desty, GLenum type)