Merge "Remove usage of SkIsPow2"
This commit is contained in:
@@ -605,12 +605,17 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static constexpr inline bool is_power_of_two(int value) {
|
||||
return (value & (value - 1)) == 0;
|
||||
}
|
||||
|
||||
template <typename T, typename... Args>
|
||||
void* DisplayListData::push(size_t pod, Args&&... args) {
|
||||
size_t skip = SkAlignPtr(sizeof(T) + pod);
|
||||
SkASSERT(skip < (1 << 24));
|
||||
if (fUsed + skip > fReserved) {
|
||||
static_assert(SkIsPow2(SKLITEDL_PAGE), "This math needs updating for non-pow2.");
|
||||
static_assert(is_power_of_two(SKLITEDL_PAGE),
|
||||
"This math needs updating for non-pow2.");
|
||||
// Next greater multiple of SKLITEDL_PAGE.
|
||||
fReserved = (fUsed + skip + SKLITEDL_PAGE) & ~(SKLITEDL_PAGE - 1);
|
||||
fBytes.realloc(fReserved);
|
||||
|
||||
Reference in New Issue
Block a user