Re: rendering-cleanup-next


On Mon, Sep 13, 2010 at 12:05 AM, John Ralls <jralls ceridwen us> wrote:
>> Could also  make it a gdk_x11 api.
>> But maybe a hint that is a no-op on other backends is better.
> I'm in favor of keeping platform-specific stuff in platform-specific files and directories, but that's in large part just because I'm a bit compulsive when it comes to code organization.

Making it gdk_x11 doesn't keep the platform-specific in
platform-specific files. It would make all files touched by
d3802ca8331ab09fe752407577b12d1525b5d89e now include gdkx.h and an
#ifdef'd call to the gdk_x11 API. So textview, layout, treeview,
viewport would all now have x11-specific code.

The API need not be X specific, though the details depend on how
Windows and Mac work and I don't know them.

* gdk_window_set_clears_background:
* @window: a #GdkWindow
* @value: #TRUE to clear window to its background when damage occurs
* If a window is set to clear its background, when a region of the
window needs repainting because the underlying window system has
* discarded the window's pixels, the window system will first clear
the region to the window background
* (see gdk_window_set_background_pattern()) and then GDK will send a
#GdkEventExpose indicating the need to repaint.
* If a window is not set to clear its background, the #GdkEventExpose
will be sent but no extra work will be done by the
* window system to update the window's pixels. The first change in
pixels will come from the expose event handler.
* Clearing the background may produce a superior visual effect in some
cases, because the window background may be a more appealing
* or less confusing thing to show the user than potentially undefined
pixels or leftover framebuffer contents.  However, in other contexts,
* painting the background creates flicker because the background has
little to do with the final window contents, and it's better
* to leave whatever is onscreen until the actual window contents can be painted.
* For expose events generated internally to GDK with
gdk_window_invalidate_region(), the background will never be cleared.
* This is because the purpose of the background clearing is to show
the background in the time between window system
* losing the pixels, and the application repainting. For
application-generated invalidations, the window system is not throwing
* away any pixels so there is no issue.
* gdk_window_begin_paint_region() always paints the background, and
GTK+ always uses gdk_window_begin_paint_region()
* around expose event handlers.
* As a result, expose event handlers can assume the background has
been painted, even if the window is set not to
* clear its background.
* On window systems that retain window contents, there is no need to
generate expose events in the window system and
* thus gdk_window_set_clears_background() would not do anything.
* On window systems that do not support clearing to background, or do
not support clearing to the particular kind of
* background pattern you've set, the background will not be cleared.
As long as you paint using gdk_window_begin_paint_region()
* the final result of your repaint will still be correct, however.


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