Re: problems understanding gtk3/gdk/cairo interaction




On Thu, 12 Apr 2012, Simon Feltman wrote:

You should be able to just fill the delta regions between the cursor position
changes right? Basically a backwards "L" shape if you're dragging upper-left
to lower-right. You would need to do two rect copies (or two calls
to gtk_widget_queue_draw_area for each part of the L) as opposed to one. If
items have a visible selected state that changes as you drag, then the regions
for those items should simply be invalidated (but only if their state changes)
along with the rubber band regions using gtk_widget_queue_draw_area.

If I was only drawing a rubberbanding rectangle or a single line, yes. But sometimes I'm doing something much more complicated, like dragging an entire spiderweb of lines (which often spans virtually all of the visible window) across the top of a full-screen image -- in this case the damaged rect is virtually always the entire window, or near enough to it to make practically no difference. Xlib's bitwise-XOR was really nice for this, as I could individually redraw each overlaid line, probably a maximum of a few thousand pixels all together, instead of having to restore a full megapixel+, for each motion notify. cairo does have an XOR operator but it's not bitwise (rather some kind of Porter-Duff XOR which I don't exactly understand but which I am told is definitely not bitwise), hence of no use for this kind of thing as far as I can make out.

Thanks,

Roger


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