DescriptionMac: 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
Committed: https://crrev.com/15439381be5c6b93dfc80ff0fec4a9d98823dba8
Cr-Commit-Position: refs/heads/master@{#316161}
Patch Set 1 : #
Total comments: 2
Patch Set 2 : Split ThreePartImage #
Total comments: 6
Patch Set 3 : Fix for rsesek #
Total comments: 1
Messages
Total messages: 23 (8 generated)
|