i965: store read drawable info in intel_context. Some OpenGL
authorXiang, Haihao <haihao.xiang@intel.com>
Wed, 29 Aug 2007 19:11:10 +0000 (15:11 -0400)
committerXiang, Haihao <haihao.xiang@intel.com>
Wed, 29 Aug 2007 19:11:10 +0000 (15:11 -0400)
operations are based on read drawable. fix bug#10136.

src/mesa/drivers/dri/i965/intel_context.c
src/mesa/drivers/dri/i965/intel_context.h
src/mesa/drivers/dri/i965/intel_pixel_copy.c

index eafe809d3adec30b516b087ff6ccf26cf3c0a6c6..1fbf571184e092643820685165f6dda65c8c872b 100644 (file)
@@ -576,6 +576,10 @@ GLboolean intelMakeCurrent(__DRIcontextPrivate *driContextPriv,
    if (driContextPriv) {
       struct intel_context *intel = (struct intel_context *) driContextPriv->driverPrivate;
 
+      if (intel->driReadDrawable != driReadPriv) {
+          intel->driReadDrawable = driReadPriv;
+      }
+
       if ( intel->driDrawable != driDrawPriv ) {
         /* Shouldn't the readbuffer be stored also? */
         driDrawableInitVBlank( driDrawPriv, intel->vblank_flags,
index 406f8483dce1b941131f3ab706dbfb3cc25e3270..ae25592908956225db0ec736db0d0420762be665 100644 (file)
@@ -234,6 +234,7 @@ struct intel_context
    int driFd;
 
    __DRIdrawablePrivate *driDrawable;
+   __DRIdrawablePrivate *driReadDrawable;
    __DRIscreenPrivate *driScreen;
    intelScreenPrivate *intelScreen; 
    volatile drmI830Sarea *sarea; 
index 58dc49505fea7a3833cc26721275056a63581cdc..3bdf2fb479093eade62d618bcae0a675f03b5fad 100644 (file)
@@ -231,6 +231,7 @@ do_blit_copypixels(GLcontext * ctx,
 
    if (intel->driDrawable->numClipRects) {
       __DRIdrawablePrivate *dPriv = intel->driDrawable;
+      __DRIdrawablePrivate *dReadPriv = intel->driReadDrawable;
       drm_clip_rect_t *box = dPriv->pClipRects;
       drm_clip_rect_t dest_rect;
       GLint nbox = dPriv->numClipRects;
@@ -262,8 +263,8 @@ do_blit_copypixels(GLcontext * ctx,
       srcy = dPriv->h - srcy - height;  
       dstx += dPriv->x;
       dsty += dPriv->y;
-      srcx += dPriv->x;
-      srcy += dPriv->y;
+      srcx += dReadPriv->x;
+      srcy += dReadPriv->y;
 
       /* Clip against the source region.  This is the only source
        * clipping we do.  Dst is clipped with cliprects below.