Merge remote branch 'origin/7.8'
[mesa.git] / src / mesa / drivers / dri / intel / intel_tex_copy.c
index 13b8bcfa86c31b9b1edfb6d5097b0e11d4970baa..62e1e78f59be035ca2e3d9649a7e17f2aa4de8bc 100644 (file)
@@ -130,18 +130,8 @@ do_copy_texsubimage(struct intel_context *intel,
       }
 
       if (ctx->ReadBuffer->Name == 0) {
-        /* reading from a window, adjust x, y */
-        const __DRIdrawable *dPriv = intel->driReadDrawable;
-        y = dPriv->y + (dPriv->h - (y + height));
-        x += dPriv->x;
-
-        /* Invert the data coming from the source rectangle due to GL
-         * and hardware disagreeing on where y=0 is.
-         *
-         * It appears that our offsets and pitches get mangled
-         * appropriately by the hardware, and we don't need to adjust them
-         * on our own.
-         */
+        /* Flip vertical orientation for system framebuffers */
+        y = ctx->ReadBuffer->Height - (y + height);
         src_pitch = -src->pitch;
       } else {
         /* reading from a FBO, y is already oriented the way we like */
@@ -155,7 +145,7 @@ do_copy_texsubimage(struct intel_context *intel,
                             src->buffer,
                             0,
                             src->tiling,
-                            intelImage->mt->pitch,
+                            intelImage->mt->region->pitch,
                             dst_bo,
                             0,
                             intelImage->mt->region->tiling,