aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2017-10-13 09:43:04 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-10-13 14:03:07 +0000
commit3bd0fece5fadd522c2e8c1b0ca9934d7455d9ccd (patch)
treec44783056b83da3314dcdc6ed0757d6eb90d1f42 /src
parentea878b9a6ba2928009da11e1d96933d5b983c0dd (diff)
remove dead code for getSize, getSafeSize, etc.
Bug: skia: Change-Id: I7dcdfaa539040b95e5b62174ccd22a94212980e0 Reviewed-on: https://skia-review.googlesource.com/59442 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/core/SkMallocPixelRef.cpp32
1 files changed, 0 insertions, 32 deletions
diff --git a/src/core/SkMallocPixelRef.cpp b/src/core/SkMallocPixelRef.cpp
index 4a34d39170..6e402c98f7 100644
--- a/src/core/SkMallocPixelRef.cpp
+++ b/src/core/SkMallocPixelRef.cpp
@@ -38,36 +38,6 @@ sk_sp<SkPixelRef> SkMallocPixelRef::MakeDirect(const SkImageInfo& info,
sk_sp<SkPixelRef> SkMallocPixelRef::MakeUsing(void*(*allocProc)(size_t),
const SkImageInfo& info,
size_t requestedRowBytes) {
-#ifdef SK_SUPPORT_LEGACY_SAFESIZE64
- if (!is_valid(info)) {
- return nullptr;
- }
-
- // only want to permit 31bits of rowBytes
- int64_t minRB = (int64_t)info.minRowBytes64();
- if (minRB < 0 || !sk_64_isS32(minRB)) {
- return nullptr; // allocation will be too large
- }
- if (requestedRowBytes > 0 && (int32_t)requestedRowBytes < minRB) {
- return nullptr; // cannot meet requested rowbytes
- }
-
- int32_t rowBytes;
- if (requestedRowBytes) {
- rowBytes = SkToS32(requestedRowBytes);
- } else {
- rowBytes = minRB;
- }
-
- int64_t bigSize = (int64_t)info.height() * rowBytes;
- if (!sk_64_isS32(bigSize)) {
- return nullptr;
- }
-
- size_t size = sk_64_asS32(bigSize);
- SkASSERT(size >= info.getSafeSize(rowBytes));
- SkASSERT(info.getSafeSize(rowBytes) == info.computeByteSize(rowBytes));
-#else
size_t rowBytes = requestedRowBytes;
if (rowBytes == 0) {
rowBytes = info.minRowBytes();
@@ -84,8 +54,6 @@ sk_sp<SkPixelRef> SkMallocPixelRef::MakeUsing(void*(*allocProc)(size_t),
return nullptr;
}
}
-#endif
-
void* addr = allocProc(size);
if (nullptr == addr) {
return nullptr;