Fixed garbage in toolbar buttons

Carlos clozano at andago.com
Mon Oct 14 10:16:55 CDT 2002


El lun, 14 de oct de 2002, a las 10:40, Dimitrie O. Paun escribio:
> On October 13, 2002 12:57 pm, Carlos wrote:
> > Changelog:
> >  * Changed SRCPAINT to SRCCOPY, the first time what
> >    it paints in hImageDC.
> 
> 
> >     } else if (himl->hbmMask) {
> >          BitBlt( hImageDC, 0, 0, cx, cy, hMaskListDC, lx, ly, SRCAND );
> > -        BitBlt( hImageDC, 0, 0, cx, cy, hImageListDC, lx, ly, SRCPAINT );
> > +	   if (!bIsTransparent && himl->hbmMask) {
> > +            BitBlt( hImageDC, 0, 0, cx, cy, hImageListDC, lx, ly, SRCPAINT );
> > +	   } else {
> > +	      BitBlt( hImageDC, 0, 0, cx, cy, hImageListDC, lx, ly, SRCCOPY );
> > +	   }
> 
> This can not be right. It is equivalent to:
> 
>             PatBlt( hImageDC, 0, 0, cx, cy, PATCOPY);
>             SelectObject(hImageDC, hOldBrush);
>         }
> -    } else if (himl->hbmMask) {
> +    } else if (himl->hbmMask && !(fStyle & ILD_TRANSPARENT) && clrBk != CLR_NONE) {
>          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");
>         BitBlt( hImageDC, 0, 0, cx, cy, hImageListDC, lx, ly, SRCCOPY);
>     }

The code is equivalent (i agree that i was not too clear :/) to:

if the code passed by:
 /* If we have an opaque image, draw the background */
     if (!bIsTransparent && himl->hbmMask) {

Then it has initted the bitmap, and with a SRCPAINT the result is
correct, but if it hasn't passed by this point, when it uses SRCPAINT
it mixes with the garbage in the buffer, because it wasn't cleared,
then in this case SRCCOPY looks like correct. Maybe that it should be
CLEAR+SRCAND+SRCPAINT?

Regards,
Carlos.

-- 
____________________________________________________
     ___   _____  _   ____
    / __// _   // /  / o)    clozano
   / /_ / /_/ // /_ /  \  @andago.com
  /___//_/ /_//___//__)
____________________________________________________



More information about the wine-devel mailing list