Merge commit 'origin/gallium-0.1' into gallium-0.2
[mesa.git] / src / mesa / main / image.c
index 651ebe1b7c04763f086923bf15ceac010d0368a6..bd38e0c3d8c732a7e012fcc1bbc03d9616940512 100644 (file)
@@ -1650,7 +1650,7 @@ _mesa_apply_stencil_transfer_ops(const GLcontext *ctx, GLuint n,
       GLuint mask = ctx->PixelMaps.StoS.Size - 1;
       GLuint i;
       for (i = 0; i < n; i++) {
-         stencil[i] = ctx->PixelMaps.StoS.Map[ stencil[i] & mask ];
+         stencil[i] = (GLstencil)ctx->PixelMaps.StoS.Map[ stencil[i] & mask ];
       }
    }
 }
@@ -4161,7 +4161,7 @@ _mesa_unpack_stencil_span( const GLcontext *ctx, GLuint n,
          const GLuint mask = ctx->PixelMaps.StoS.Size - 1;
          GLuint i;
          for (i = 0; i < n; i++) {
-            indexes[i] = ctx->PixelMaps.StoS.Map[ indexes[i] & mask ];
+            indexes[i] = (GLuint)ctx->PixelMaps.StoS.Map[ indexes[i] & mask ];
          }
       }
 
@@ -4513,7 +4513,7 @@ _mesa_unpack_depth_span( const GLcontext *ctx, GLuint n,
    if (needClamp) {
       GLuint i;
       for (i = 0; i < n; i++) {
-         depthValues[i] = CLAMP(depthValues[i], 0.0, 1.0);
+         depthValues[i] = (GLfloat)CLAMP(depthValues[i], 0.0, 1.0);
       }
    }
 
@@ -5119,7 +5119,7 @@ _mesa_clip_copytexsubimage(const GLcontext *ctx,
    const struct gl_framebuffer *fb = ctx->ReadBuffer;
    const GLint srcX0 = *srcX, srcY0 = *srcY;
 
-   if (_mesa_clip_to_region(fb->_Xmin, fb->_Ymin, fb->_Xmax, fb->_Ymax,
+   if (_mesa_clip_to_region(0, 0, fb->Width, fb->Height,
                             srcX, srcY, width, height)) {
       *destX = *destX + *srcX - srcX0;
       *destY = *destY + *srcY - srcY0;