Changes in Bitmap behaviour

Dimitrie O. Paun dpaun at rogers.com
Sat Oct 12 18:50:40 CDT 2002


On October 12, 2002 01:29 pm, Duane Clark wrote:
> I found that the patch that broke it was one of the comctrl patches of
> 9/11/02. I think it was this one:
> http://www.winehq.com/hypermail/wine-cvs/2002/09/0067.html

I thought that was the case, but I can not reproduce it here....
Can you try the patch below and (1) tell me if that fixes it, and
if not, can you send me the generated trace?

> I figured since Dimitri was still going strong on this comctrl stuff

I don't want to be pedantic, but not to be confused with Dmitry, 
but I'm either Dimitrie, or Dimi, for short. :)

> (does he ever sleep?), it would eventually get fixed.

Truth be told, I had some problems sleeping lately... :/
Today is g/f day, so I can't spend time on this, and tomorrow
is Thanks Giving here in Canada, so I can't spend too much
time on these for the next little while, but I'll surely
appreciate if you can try this above mentioned patch:

Index: dlls/comctl32/imagelist.c
===================================================================
RCS file: /var/cvs/wine/dlls/comctl32/imagelist.c,v
retrieving revision 1.61
diff -u -r1.61 imagelist.c
--- dlls/comctl32/imagelist.c	24 Sep 2002 18:26:42 -0000	1.61
+++ dlls/comctl32/imagelist.c	12 Oct 2002 23:43:12 -0000
@@ -1078,6 +1078,11 @@
     if (!pimldp || !himl) return FALSE;
     if ((pimldp->i < 0) || (pimldp->i >= himl->cCurImage)) return FALSE;
    
+    ERR("(himl=%p, cbSize=%ld hbmMask=0x%08x iImage=%d x=%d y=%d"
+	" cx=%d cy=%d rgbBk=0x%08lx rgbFg=0x%08lx fStyle=0x%08x)\n",
+          himl, pimldp->cbSize, himl->hbmMask, pimldp->i, pimldp->x, pimldp->y,
+	  pimldp->cx, pimldp->cy, pimldp->rgbBk, pimldp->rgbFg, pimldp->fStyle);
+
     fState = pimldp->cbSize < sizeof(IMAGELISTDRAWPARAMS) ? ILS_NORMAL : pimldp->fState;
     fStyle = pimldp->fStyle & ~ILD_OVERLAYMASK;
     cx = (pimldp->cx == 0) ? himl->cx : pimldp->cx;
@@ -1086,9 +1091,6 @@
     bIsTransparent = himl->hbmMask && ((fStyle & ILD_TRANSPARENT) || clrBk == CLR_NONE);
     bBlend = fStyle & (ILD_BLEND25 | ILD_BLEND50);
 
-    TRACE("hbmMask(0x%08x) iImage(%d) x(%d) y(%d) cx(%d) cy(%d)\n",
-          himl->hbmMask, pimldp->i, pimldp->x, pimldp->y, cx, cy);
-
     /* we will use these DCs to access the images and masks in the ImageList */
     hImageListDC = CreateCompatibleDC(0);
     hMaskListDC = himl->hbmMask ? CreateCompatibleDC(0) : 0;
@@ -1115,11 +1117,13 @@
     oldImageFg = SetTextColor( hImageDC, RGB( 0, 0, 0 ) );
     oldImageBk = SetBkColor( hImageDC, RGB( 0xff, 0xff, 0xff ) );
 
+ERR("himl=%p: A\n", himl);
     /* If we have an opaque image, draw the background */
     if (!bIsTransparent && himl->hbmMask) {
         HBRUSH hOldBrush = SelectObject (hImageDC, CreateSolidBrush (clrBk));
         PatBlt( hImageDC, 0, 0, cx, cy, PATCOPY );
         DeleteObject (SelectObject (hImageDC, hOldBrush));
+ERR("himl=%p: B\n", himl);
     }
 
     /*
@@ -1127,18 +1131,22 @@
      */
     if(fStyle & ILD_MASK) {
 	if (himl->hbmMask) {
+ERR("himl=%p: C\n", himl);
             BitBlt(hImageDC, 0, 0, cx, cy, hMaskListDC, lx, ly, SRCCOPY);
 	} else {
 	    HBRUSH hOldBrush = SelectObject (hImageDC, GetStockObject(BLACK_BRUSH));
 	    PatBlt( hImageDC, 0, 0, cx, cy, PATCOPY);
 	    SelectObject(hImageDC, hOldBrush);
+ERR("himl=%p: D\n", himl);
 	}
     } else if (himl->hbmMask) {
+ERR("himl=%p: E\n", himl);
         BitBlt( hImageDC, 0, 0, cx, cy, hMaskListDC, lx, ly, SRCAND );
         BitBlt( hImageDC, 0, 0, cx, cy, hImageListDC, lx, ly, SRCPAINT );
     } else {
 	/* the image is opaque, just copy it */
 	TRACE("    - Image is opaque\n");
+ERR("himl=%p: F\n", himl);
         BitBlt( hImageDC, 0, 0, cx, cy, hImageListDC, lx, ly, SRCCOPY);
     }
   
@@ -1149,6 +1157,7 @@
 	HDC hBlendMaskDC = hImageListDC;
 	HBITMAP hOldBitmap;
 
+ERR("himl=%p: G\n", himl);
 	/* Create the blend Mask */
     	hOldBitmap = SelectObject(hBlendMaskDC, hBlendMaskBmp);
 	hBlendBrush = fStyle & ILD_BLEND50 ? himl->hbrBlend50 : himl->hbrBlend25;
@@ -1158,13 +1167,16 @@
 
     	/* Modify the blend mask if an Image Mask exist */
     	if(himl->hbmMask) {
+ERR("himl=%p: H\n", himl);
 	    BitBlt(hBlendMaskDC, 0, 0, cx, cy, hMaskListDC, lx, ly, 0x220326); /* NOTSRCAND */
 	    BitBlt(hBlendMaskDC, 0, 0, cx, cy, hBlendMaskDC, 0, 0, NOTSRCCOPY);
 	}
 	
 	/* now apply blend to the current image given the BlendMask */
+ERR("himl=%p: I, clrBlend=0x%08lx\n", himl, clrBlend);
         if (clrBlend == CLR_DEFAULT) clrBlend = GetSysColor (COLOR_HIGHLIGHT);
         else if (clrBlend == CLR_NONE) clrBlend = GetTextColor (pimldp->hdcDst);
+ERR("himl=%p: J, clrBlend=0x%08lx\n", himl, clrBlend);
 	hOldBrush = (HBRUSH) SelectObject (hImageDC, CreateSolidBrush(clrBlend));
 	BitBlt (hImageDC, 0, 0, cx, cy, hBlendMaskDC, 0, 0, 0xB8074A); /* PSDPxax */
 	DeleteObject(SelectObject(hImageDC, hOldBrush));
@@ -1177,8 +1189,12 @@
     	nOvlIdx = himl->nOvlIdx[nOvlIdx - 1];
     	if ((nOvlIdx >= 0) && (nOvlIdx < himl->cCurImage)) {
     	    const INT ox = himl->cx * nOvlIdx + pimldp->xBitmap;
+ERR("himl=%p: K\n", himl);
 	    if (himl->hbmMask && !(fStyle & ILD_IMAGE))
+	    {
+ERR("himl=%p: L\n", himl);
 		BitBlt (hImageDC, 0, 0, cx, cy, hMaskListDC, ox, ly, SRCAND);
+	    }
 	    BitBlt (hImageDC, 0, 0, cx, cy, hImageListDC, ox, ly, SRCPAINT);
 	}
     }
@@ -1197,12 +1213,13 @@
     if (bIsTransparent && !(fStyle & ILD_MASK)) {
 	COLORREF oldDstFg = SetTextColor(pimldp->hdcDst, RGB( 0, 0, 0 ) );
 	COLORREF oldDstBk = SetBkColor(pimldp->hdcDst, RGB( 0xff, 0xff, 0xff ));
+ERR("himl=%p: M\n", himl);
         BitBlt (pimldp->hdcDst, pimldp->x,  pimldp->y, cx, cy, hMaskListDC, lx, ly, SRCAND);
 	SetBkColor(pimldp->hdcDst, oldDstBk);
 	SetTextColor(pimldp->hdcDst, oldDstFg);
 	dwRop = SRCPAINT;
     }
-    if (fStyle & ILD_ROP) dwRop = pimldp->dwRop;
+    /*if (fStyle & ILD_ROP) dwRop = pimldp->dwRop;*/
     BitBlt (pimldp->hdcDst, pimldp->x,  pimldp->y, cx, cy, hImageDC, 0, 0, dwRop);
 
     bResult = TRUE;




More information about the wine-devel mailing list