Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Unified Diff: src/core/SkMallocPixelRef.cpp

Issue 1212373006: Swizzling, except for premultiplying, done using libpng transforms (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fixing size of row allocation, member variable initialization, and synax issues Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/codec/SkCodec_libpng.cpp ('K') | « src/codec/SkCodec_libpng.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkMallocPixelRef.cpp
diff --git a/src/core/SkMallocPixelRef.cpp b/src/core/SkMallocPixelRef.cpp
index 12aa1f63d6197c1e189e6ca877df4b3d7694d923..35075d8f58313bf3cdb1743067672b4ac552428f 100644
--- a/src/core/SkMallocPixelRef.cpp
+++ b/src/core/SkMallocPixelRef.cpp
@@ -53,15 +53,18 @@ SkMallocPixelRef* SkMallocPixelRef::NewAllocate(const SkImageInfo& info,
size_t requestedRowBytes,
SkColorTable* ctable) {
if (!is_valid(info, ctable)) {
+ SkDebugf("failing 1\n");
scroggo 2015/06/30 20:50:04 I think you didn't mean to include the changes to
return NULL;
}
// only want to permit 31bits of rowBytes
int64_t minRB = (int64_t)info.minRowBytes64();
if (minRB < 0 || !sk_64_isS32(minRB)) {
+ SkDebugf("failing 2\n");
return NULL; // allocation will be too large
}
if (requestedRowBytes > 0 && (int32_t)requestedRowBytes < minRB) {
+ SkDebugf("failing 3\n");
return NULL; // cannot meet requested rowbytes
}
@@ -74,6 +77,7 @@ SkMallocPixelRef* SkMallocPixelRef::NewAllocate(const SkImageInfo& info,
int64_t bigSize = (int64_t)info.height() * rowBytes;
if (!sk_64_isS32(bigSize)) {
+ SkDebugf("failing 4\n");
return NULL;
}
@@ -81,6 +85,7 @@ SkMallocPixelRef* SkMallocPixelRef::NewAllocate(const SkImageInfo& info,
SkASSERT(size >= info.getSafeSize(rowBytes));
void* addr = sk_malloc_flags(size, 0);
if (NULL == addr) {
+ SkDebugf("failing 5\n");
return NULL;
}
« src/codec/SkCodec_libpng.cpp ('K') | « src/codec/SkCodec_libpng.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698