Mesa (master): intel: Use fb->Height when flipping read buffer orientation

Kristian Høgsberg krh at kemper.freedesktop.org
Tue Mar 30 21:09:37 UTC 2010


Module: Mesa
Branch: master
Commit: 581c773e81cdc467be2d09a0ccd76c0de3cba529
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=581c773e81cdc467be2d09a0ccd76c0de3cba529

Author: Kristian Høgsberg <krh at bitplanet.net>
Date:   Tue Mar 30 14:05:47 2010 -0400

intel: Use fb->Height when flipping read buffer orientation

With DRI2, x and y are always zero and fb->Height is always up to date
with the drawable height.

---

 src/mesa/drivers/dri/intel/intel_tex_copy.c |   14 ++------------
 1 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_tex_copy.c b/src/mesa/drivers/dri/intel/intel_tex_copy.c
index 618f690..62e1e78 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_copy.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_copy.c
@@ -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 */




More information about the mesa-commit mailing list