Chromium Code Reviews
DescriptionMac: Use a cache for ScreenMac::GetDisplayForScreen().
Performance traces on the associated bugs turn up a lot of time spent in
display::screen_mac::GetDisplayForScreen(). It does a lot of work, and
calls some expensive AppKit and CoreGraphics methods. It's currently
invoked multiple times during a window resize.
GetDisplayNearestWindow would also invoke -[NSWindow
_bestScreenBySpaceAssignmentOrGeometry] which does some synchronous
messaging with the window server process, adding significant latency.
ScreenMac already maintains a std::vector<Display>, but
GetDisplayForScreen() does not use it.
Use it.
Optimize GetDisplayNearestWindow for the case of a single display.
BUG=666556, 665280
Committed: https://crrev.com/7330ed4e42141778cb25604dd4949471f034a38f
Cr-Commit-Position: refs/heads/master@{#433463}
Patch Set 1 #Patch Set 2 : USe ID not geometry #Patch Set 3 : Early exit #Messages
Total messages: 17 (12 generated)
|