aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkImageInfo.h
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2017-10-11 11:30:31 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-10-11 15:54:37 +0000
commit3758c755d4102212c4e73cea3917f22ff06f8d95 (patch)
tree65fbb5a8f0bf40695dc74021dd7aa8cecefd45e3 /include/core/SkImageInfo.h
parent019f91e123ffb9b2b990d42ca43557125588e637 (diff)
remove dead code for returning 0 on overflow
Bug: skia: Change-Id: I6e7aae1b09cf3a1c9728bdaaa4dbf4df4b2ec16d Reviewed-on: https://skia-review.googlesource.com/58341 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'include/core/SkImageInfo.h')
-rw-r--r--include/core/SkImageInfo.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/include/core/SkImageInfo.h b/include/core/SkImageInfo.h
index 5e9e80fcdc..e14846fa37 100644
--- a/include/core/SkImageInfo.h
+++ b/include/core/SkImageInfo.h
@@ -317,19 +317,18 @@ public:
}
#endif
-#ifdef SK_SUPPORT_LEGACY_COMPUTEBYTESIZE_RET_0
- /**
- * Returns the size (in bytes) of the image buffer that this info needs, given the specified
- * rowBytes. The rowBytes must be >= this->minRowBytes().
- * If the calculation overflows, or if the height is 0, this returns 0.
- */
-#else
/**
* Returns the size (in bytes) of the image buffer that this info needs, given the specified
* rowBytes. The rowBytes must be >= this->minRowBytes().
+ *
+ * if (height == 0) {
+ * return 0;
+ * } else {
+ * return (height - 1) * rowBytes + width * bytes_per_pixel;
+ * }
+ *
* If the calculation overflows this returns SK_MaxSizeT
*/
-#endif
size_t computeByteSize(size_t rowBytes) const;
/**