fix LogicOp/bitmap problem, bug 11133
authorEric Anholt <eric@anholt.net>
Wed, 4 Jul 2007 13:37:14 +0000 (07:37 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Wed, 4 Jul 2007 13:37:14 +0000 (07:37 -0600)
src/mesa/drivers/dri/i965/intel_blit.c
src/mesa/drivers/dri/i965/intel_blit.h
src/mesa/drivers/dri/i965/intel_pixel_bitmap.c

index 173d1d5b6c232f8a7491a2be5d4ac2272ccba011..f88cbb2328dfc3e2a35bff2d6da2ee97ba966000 100644 (file)
@@ -532,12 +532,15 @@ intelEmitImmediateColorExpandBlit(struct intel_context *intel,
                                  GLuint dst_offset,
                                  GLboolean dst_tiled,
                                  GLshort x, GLshort y, 
-                                 GLshort w, GLshort h)
+                                 GLshort w, GLshort h,
+                                 GLenum logic_op)
 {
    struct xy_setup_blit setup;
    struct xy_text_immediate_blit text;
    int dwords = ((src_size + 7) & ~7) / 4;
 
+   assert( logic_op - GL_CLEAR >= 0 );
+   assert( logic_op - GL_CLEAR < 0x10 );
 
    if (w < 0 || h < 0) 
       return;
@@ -561,7 +564,7 @@ intelEmitImmediateColorExpandBlit(struct intel_context *intel,
    setup.br0.length = (sizeof(setup) / sizeof(int)) - 2;
       
    setup.br13.dest_pitch = dst_pitch;
-   setup.br13.rop = 0xcc;
+   setup.br13.rop = translate_raster_op(logic_op);
    setup.br13.color_depth = (cpp == 4) ? BR13_8888 : BR13_565;
    setup.br13.clipping_enable = 0;
    setup.br13.mono_source_transparency = 1;
index 8b0cc65243cc617fba93e269387a8e4625acdfe9..e361545c8fab316c2e4315734fd69a1ec7a82642 100644 (file)
@@ -72,6 +72,7 @@ intelEmitImmediateColorExpandBlit(struct intel_context *intel,
                                  GLuint dst_offset,
                                  GLboolean dst_tiled,
                                  GLshort dst_x, GLshort dst_y, 
-                                 GLshort w, GLshort h);
+                                 GLshort w, GLshort h,
+                                 GLenum logic_op );
 
 #endif
index 5841afaa3ef9ec6395d76901addf1a9b92af363a..421fcc5e511651ae96845a1f5ccdf0bf53ad686d 100644 (file)
@@ -260,7 +260,9 @@ do_blit_bitmap( GLcontext *ctx,
               int h = MIN2(DY, box_h - py);
               int w = MIN2(DX, box_w - px); 
               GLuint sz = align(align(w,8) * h, 64)/8;
-           
+              GLenum logic_op = ctx->Color.ColorLogicOpEnabled ?
+                 ctx->Color.LogicOp : GL_COPY;
+
               assert(sz <= sizeof(stipple));
               memset(stipple, 0, sz);
 
@@ -288,7 +290,8 @@ do_blit_bitmap( GLcontext *ctx,
                                                  dst->tiled,
                                                  rect.x1 + px,
                                                  rect.y2 - (py + h),
-                                                 w, h);
+                                                 w, h,
+                                                 logic_op);
            } 
         } 
       }