Index: src/core/SkPixmap.cpp |
diff --git a/src/core/SkPixmap.cpp b/src/core/SkPixmap.cpp |
index 57bb194258d5f2bdc7b6eb1953c2108d565eaf2b..d7c4cffb7ecea0d6d25c3cec50b804f83e62c7f9 100644 |
--- a/src/core/SkPixmap.cpp |
+++ b/src/core/SkPixmap.cpp |
@@ -287,11 +287,19 @@ SkAutoPixmapStorage::~SkAutoPixmapStorage() { |
this->freeStorage(); |
} |
+size_t SkAutoPixmapStorage::AllocSize(const SkImageInfo& info, size_t* rowBytes) { |
+ size_t rb = info.minRowBytes(); |
+ if (rowBytes) { |
+ *rowBytes = rb; |
+ } |
+ return info.getSafeSize(rb); |
+} |
+ |
bool SkAutoPixmapStorage::tryAlloc(const SkImageInfo& info) { |
this->freeStorage(); |
- |
- size_t rb = info.minRowBytes(); |
- size_t size = info.getSafeSize(rb); |
+ |
+ size_t rb; |
+ size_t size = AllocSize(info, &rb); |
if (0 == size) { |
return false; |
} |