diff options
author | Adam Lesinski <adamlesinski@google.com> | 2016-10-21 13:38:42 -0700 |
---|---|---|
committer | Adam Lesinski <adamlesinski@google.com> | 2016-10-21 13:51:59 -0700 |
commit | b54ef10f55ab9f11fdc73b0436b708e518fb5029 (patch) | |
tree | 52b1225899d166dd1f65a576bdf7fcc6796f0224 /tools/aapt2/StringPool.h | |
parent | 011cef54ee0a8260f6b4381c7ea28a450cd3cbce (diff) |
AAPT2: Ensure string pool ordering is compact
Keep styledstrings at the beginning of the StringPool
to reduce the padding in the StyledString array.
Bug:32336940
Test: manual
Change-Id: Iec820c21a54daac40ecc3b2f87517a0f1efc9d3d
Diffstat (limited to 'tools/aapt2/StringPool.h')
-rw-r--r-- | tools/aapt2/StringPool.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/tools/aapt2/StringPool.h b/tools/aapt2/StringPool.h index 05c26e7e4ea1..6e0d646cae12 100644 --- a/tools/aapt2/StringPool.h +++ b/tools/aapt2/StringPool.h @@ -42,9 +42,22 @@ struct StyleString { class StringPool { public: - struct Context { - uint32_t priority; + class Context { + public: + enum : uint32_t { + kStylePriority = 0u, + kHighPriority = 1u, + kNormalPriority = 0x7fffffffu, + kLowPriority = 0xffffffffu, + }; + uint32_t priority = kNormalPriority; ConfigDescription config; + + Context() = default; + Context(uint32_t p, const ConfigDescription& c) : priority(p), config(c) {} + explicit Context(uint32_t p) : priority(p) {} + explicit Context(const ConfigDescription& c) + : priority(kNormalPriority), config(c) {} }; class Entry; |