ScrollDC fixes.

Rein Klazes wijn at wanadoo.nl
Tue Mar 8 02:53:07 CST 2005


On 07 Mar 2005 19:44:07 +0100, you wrote:

> > +            for( i = 0; i < rdata->rdh.nCount; i++, rect += step) {
> > +                DPtoLP(hdc, (LPPOINT)rect, 2);
> > +                TRACE("Bit blitting %s to %ld,%ld\n", wine_dbgstr_rect(rect),
> > +                        rect->left + dx, rect->top + dy);
> > +                BitBlt( hdc, rect->left + dx, rect->top + dy,
> > +                            rect->right - rect->left, rect->bottom -rect->top,
> > +                            hdc, rect->left, rect->top, SRCCOPY);
> > +            }
> 
> You really shouldn't need to scroll the region rectangle by
> rectangle. Selecting the proper clip region and then copying the whole
> area should have the same effect.

Hmm, this is about pixels that are copied from the outside of the
visible region to the inside (that area will be invalidated and
repainted if called through ScrollWindowEx, but with noticeable
flickering and there might be direct uses of ScrollDC with worse
effects).
Since the visible region did not work, I did not try adding an extra
clip region. Indeed, adding: "SelectClipRgn( hdc, visrgn);" does not
help at all.
Can the real bug perhaps be in BitBlt?


> 
> >                          {
> >                              XEvent event;
> >  
> > -                            XWindowEvent( gdi_display, physDev->drawable, ~0, &event );
> > -                            if (event.type == NoExpose) break;
> > +                            if( !XCheckWindowEvent( gdi_display, physDev->drawable, ~0, &event ))
> > +                                break;
> > +                            if (event.type == NoExpose) continue;
> 
> You can't use XCheckWindowEvent, you need to wait for the events that
> haven't arrived yet.

That is what the XFlush() is for, and it seems to work quite nicely
(after BitBlitting regions of over 50 separate rectangles). Without it,
it is a mess indeed.

Rein.



More information about the wine-devel mailing list