SPM: Reduce the number of pixels sent to Ash for window icons.
There are two icon properties, kAppIcon and kWindowIcon. For the purposes of Ash, these are used interchangeably (kAppIcon is preferred and kWindowIcon is a fallback). Thus we can skip sending kWindowIcon. This should cut down on memory usage by half. Further, the only place that the icon is used for single process mash is in overview mode, which displays the icon at 24dip. We can downscale the icon before sending it over. For tabbed browser windows, that's 24dip*24dip instead of 192px * 192px. Since the icons are set on the content window as well as the root window, they are each copied to the window service twice. We do need to transport the icons that are set on the root window, but not on the content window. PropertyConverter doesn't distinguish on the window type, so new keys are introduced for the root window: kAppIconSmallKey and kAppIconLargeKey. These are the only ones that are sent to the WS. They are only used in Mash. kAppIconKey and kWindowIconKey are retained for use in the browser, e.g. by AppWindowLauncherItemController. kAppIconLargeKey is only set by the task manager and used by ShelfWindowWatcher for the shelf icon. The net effect is that every browser window goes from allocating 192x192px four times, to 24x24dip once. According to chrome://tracing this lops about 4MiB off malloc'd memory in the browser process when there are 10 browser windows open. Bug: 938105 Change-Id: I7bc04784ff3fb1d0857219eae2184542b1f14fd4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1504164Reviewed-by:Michael Wasserman <msw@chromium.org> Reviewed-by:
Tom Sepez <tsepez@chromium.org> Reviewed-by:
Scott Violet <sky@chromium.org> Auto-Submit: Evan Stade <estade@chromium.org> Commit-Queue: Evan Stade <estade@chromium.org> Cr-Commit-Position: refs/heads/master@{#638622}
Showing
Please register or sign in to comment