Closed Bug 121264 Opened 23 years ago Closed 20 years ago

gtk2 should use the region for invalidation, not the rect

Categories

(Core :: XUL, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: blizzard, Assigned: bryner)

References

Details

(Keywords: perf)

Attachments

(4 files)

gtk2 should be using the region for invalidation, not the rect supplied.  This
could make things a good bit faster.
Blocks: gtk2
Are you talking about invalidation or painting?

You can already pass a region to be painted as a parameter to an NS_PAINT event.
I once had nsViewManager patches to use it instead of the rect if a non-null
region was provided; it wasn't hard to do. Unfortunately the patches couldn't be
just be applied because certain platforms (*cough* gtk *cough*) left garbage in
the region field of the event, so I couldn't reliably tell if it had been
initialized. But we can audit all the gfx implementations and fix them up if
necessary.
I'm talking about using the region field of the NS_PAINT event.  It is reliably
used in gtk2.  It's also relatively trivial to fix it if it's busted with gtk1.
roc, is there a bug open on the region code in the view manager that I can link
to with this bug?
No. We should have separate bugs for "make toolkit X set region correctly" (for
each X) and "use paint region in view manager".
Keywords: perf
Attached patch patchSplinter Review
Assignee: blizzard → bryner
Status: NEW → ASSIGNED
Attachment #159624 - Flags: superreview?(blizzard)
Attachment #159624 - Flags: review?(blizzard)
Comment on attachment 159624 [details] [diff] [review]
patch

Woo!
Attachment #159624 - Flags: superreview?(blizzard)
Attachment #159624 - Flags: superreview+
Attachment #159624 - Flags: review?(blizzard)
Attachment #159624 - Flags: review+
dbaron and I talked about this some and we're not sure that having a cached
update region is really a win here.  You do avoid a call to CreateInstance, but
there's additional overhead from managing the cached region, and it has to
delete the underlying GdkRegion in that region every time as well.  I think we
should probably go with the simpler approach.
Attachment #159636 - Flags: superreview?(blizzard)
Attachment #159636 - Flags: review?(blizzard)
Attachment #159636 - Flags: superreview?(blizzard)
Attachment #159636 - Flags: superreview+
Attachment #159636 - Flags: review?(blizzard)
Attachment #159636 - Flags: review+
checked in
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
I'm pretty sure this just broke my build.  Using testgtkembed.
Attached file stack trace
Looks like there's some hard-coded knowledge on the rect element.
Attached patch fix crashSplinter Review
Attachment #159998 - Flags: superreview+
Attachment #159998 - Flags: review+
Attachment #159998 - Flags: approval1.8a4+
follow-up patch checked in.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: