move zero-init to sk_malloc for masks
Bug: skia:
Change-Id: I75d557068bdcd9e9f7e380e4fa447f9d83dd1554
Reviewed-on: https://skia-review.googlesource.com/98200
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Reed <reed@google.com>
diff --git a/src/core/SkSafeMath.h b/src/core/SkSafeMath.h
index 7afd482..98bd07b 100644
--- a/src/core/SkSafeMath.h
+++ b/src/core/SkSafeMath.h
@@ -51,6 +51,10 @@
// These saturate to their results
static size_t Add(size_t x, size_t y);
static size_t Mul(size_t x, size_t y);
+ static size_t Align4(size_t x) {
+ SkSafeMath safe;
+ return safe.alignUp(x, 4);
+ }
private:
uint32_t mul32(uint32_t x, uint32_t y) {