diff options
author | andresantoso <andresantoso@chromium.org> | 2015-02-12 20:21:55 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-13 04:22:49 +0000 |
commit | 15439381be5c6b93dfc80ff0fec4a9d98823dba8 (patch) | |
tree | 08f18e095b7a470dd312a25c3a9a79ca4396cca2 /chrome/browser/web_applications/web_app_mac.mm | |
parent | 7e6ebfdc8f3536dc0246fcec458b27cdd836c3b5 (diff) | |
download | chromium_src-15439381be5c6b93dfc80ff0fec4a9d98823dba8.zip chromium_src-15439381be5c6b93dfc80ff0fec4a9d98823dba8.tar.gz chromium_src-15439381be5c6b93dfc80ff0fec4a9d98823dba8.tar.bz2 |
Mac: Optimize TabView drawing.
This change speeds up -[TabView drawFill:] by about 2x.
Previously each tab had to regenerate a new CGImage for setting the context's
mask every time the tab size changed. This is expensive.
Instead, just fill without the mask and then use NSCompositeDestinationIn to
erase the fill outside the tab's shape. We also save some memory from not
having each tab cache a mask image.
Factor out three part image drawing to a separate class to simplify the code,
and to cache the tab images since we ask for it a lot and ResourceBundle's
cache lookup is not particularly fast.
BUG=453996
Review URL: https://codereview.chromium.org/918533005
Cr-Commit-Position: refs/heads/master@{#316161}
Diffstat (limited to 'chrome/browser/web_applications/web_app_mac.mm')
0 files changed, 0 insertions, 0 deletions