Closed Bug 957192 Opened 10 years ago Closed 10 years ago

Unnecessary -[ChildView drawRect:] calls during normal browsing

Categories

(Core :: Widget: Cocoa, defect)

All
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla29

People

(Reporter: mstange, Assigned: mstange)

References

Details

Attachments

(1 file)

In the OMTC world, drawRect is expensive because it makes the main thread block while the compositor thread composites the window. We do this so that window resizing looks good.

So we should try to avoid all drawRect calls that don't come from resizing.

I've found two cases where drawRect is still called during normal browsing:
 (1) When scrolling a page with plugins and
 (2) when the window title changes, for example due to clicking a link.

This patch avoids invalidations in both scenarios and (for me) results in a noticeable improvement of scrolling smoothness on pages with plugins.
Attachment #8356635 - Flags: review?(smichaud)
Comment on attachment 8356635 [details] [diff] [review]
dontinvalidatewhenmovingview

This looks promising, but of course we'll need to look out for unwanted side effects.

By the way, I checked and found that -[NSWindow _setNeedsDisplayInRect:] has been present since at least OS X 10.5.
Attachment #8356635 - Flags: review?(smichaud) → review+
https://hg.mozilla.org/mozilla-central/rev/9bbdc400dc1f
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
Depends on: 958674
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: