Re: Problems with expose_event->region patch

Sven Neumann <sven gimp org> writes:

> Hi,
> Alexander Larsson <alla lysator liu se> writes:
> > On 7 Mar 2001, Owen Taylor wrote:
> > 
> > > At least with backing store, I don't follow this. Only the region
> > > is copied from the back buffer to the screen, so painting outside
> > > the region doesn't matter. There is an implicit clip to the region
> > > passed to gtk_window_begin_paint().
> > >
> > > (Have you changed gtk_main_do_event to call gtk_window_begin_paint_region?
> > > Now that you have the region in the expose?)
> > 
> > No, i must have missed this. I'm not very good at the backing store stuff,
> > and i don't think many are. Have you written any docs on that?
> > 
> > When i made this change everything works just perfect.
> Well, as expected it seems to work just fine for the backing-store-case
> but breaks redrawing if backing store is not available (or implemented
> differently).

Any correct port will have the property that the same series
of begin-paint / draw calls will produce the same end result as
the X11 port.

If a port missed the fact that begin-paint clears the affected region
or the fact that calls between begin-paint and the corresponding
end-paint are clipped to the region passed, it would be a bug.
> > > For the non-backing-store case we could even add a
> > > gdk_drawable_set_clip_region() call and emulate it by changing the
> > > GC's clips, though that could be rather inefficient without a
> > > lot of complexity.
> I'm now trying to fix redrawing in the DirectFB port (which does a
> much simplified version of backing store in the hardware, not using 
> pixmaps). Just to assure that I got the principle correct:
> The region as passed to gdk_window_begin_paint_region() is supposed to 
> be a list of rectangles all following clearing and drawing operations 
> have to be clipped to until gdk_window_end_paint() is called? If this
> is assured all clearing and redrawing should work correctly. Is this 
> correct?

The API docs for gdk_region_begin_paint() give a complete description
of the way that drawing should work.

Whether there is actually a separate backing store pixmap is not
really the point, and a port could vary that conceptually.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]