DescriptionReduce footprint of FilterEffectBuilder::build
Since we know the resulting size of the sepia(...) and grayscale(...)
matrices, allocate the space for them up front, and then use
uncheckedAppend(...) to reduce the code bloat from regular append(...).
This strikes a balance between using float[20] (entirely unchecked but
less code) and what's currently there.
Move the setup of the matrices to helper functions to reduce the
"weight" (cognitive load) of these two cases in the switch somewhat.
Code size is reduced by ~1.35kB on x86-64/Linux.
Committed: https://crrev.com/339ec33bc366ee9f757ef8a2ff93eb5183c38448
Cr-Commit-Position: refs/heads/master@{#357365}
Patch Set 1 #
Messages
Total messages: 7 (2 generated)
|