Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(385)

Issue 2514703002: Mac: Use a cache for ScreenMac::GetDisplayForScreen(). (Closed)

Created:
4 years, 1 month ago by tapted
Modified:
4 years, 1 month ago
Reviewers:
ccameron
CC:
chromium-reviews, mac-reviews_chromium.org, chrome-apps-syd-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Mac: 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+65 lines, -34 lines) Patch
M ui/display/mac/screen_mac.mm View 1 2 11 chunks +65 lines, -34 lines 0 comments Download

Messages

Total messages: 17 (12 generated)
tapted
Hi Chris - WDYT?
4 years, 1 month ago (2016-11-18 07:42:06 UTC) #9
ccameron
Yes, lgtm.
4 years, 1 month ago (2016-11-18 17:55:51 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2514703002/40001
4 years, 1 month ago (2016-11-20 22:56:14 UTC) #12
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 1 month ago (2016-11-20 23:49:23 UTC) #15
commit-bot: I haz the power
4 years, 1 month ago (2016-11-20 23:52:00 UTC) #17
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/7330ed4e42141778cb25604dd4949471f034a38f
Cr-Commit-Position: refs/heads/master@{#433463}

Powered by Google App Engine
This is Rietveld 408576698