Re: why not empty the scratch image when flush_all_displays

On Mon, 2006-11-13 at 20:28 +0800, jianjun.yang wrote:
> Hi All,
> When gdk_window_process_all_updates, flush_all_displays is invoked.
> Then all the drawing commands are sent to server. Meanwhile, I think
> the contents of the scratch image corresponding current display are no
> longer useful, and should be thrown away. Otherwise, it may increase
> the frequency of invoking to gdk_flush while alloc_scratch_image. So I
> add the gdk_scratch_image_reset to gdk_window_process_all_updates.

gdk_display_flush() [what flush_all_displays() does] actually calls
XFlush(), unlike gdk_flush(), which for weird historical reasons
calls XSync.

Scratch images can only be recycled after XSync(), not after XFlush().

(To reduce the calls to XSync() used with the scratch image cache you
*could* watch for XShmCompletionEvent, though I don't think the
improvement would be that big.)

					- Owen 

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