aboutsummaryrefslogtreecommitdiffhomepage
path: root/dm
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2017-10-02 13:44:11 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-10-02 13:44:18 +0000
commit5a2e50edc51006ce91366e177a9d21a16775d7fd (patch)
tree6301e052ffd179fc8c61681c0f8a0d7b175d4401 /dm
parentcd284c532376d16fcc4ed75baf3da65c3e4a2e95 (diff)
Revert "Revert "Revert "guard old apis for querying byte-size of a bitmap/imageinfo/pixmap"""
This reverts commit cd284c532376d16fcc4ed75baf3da65c3e4a2e95. Reason for revert: assert fired in SkMallocPixelRef.cpp:61: fatal error: "assert(info.computeByteSize(rowBytes) == info.getSafeSize(rowBytes))" google3 thinks it was from surface_rowbytes Original change's description: > Revert "Revert "guard old apis for querying byte-size of a bitmap/imageinfo/pixmap"" > > This reverts commit 809cbedd4b252be221b2ac3b4269d312fd8f53a0. > > Bug: skia: > Change-Id: I680d8daeeeeb15526b44c1305d8fb0c6bfa38e1d > Reviewed-on: https://skia-review.googlesource.com/52665 > Commit-Queue: Mike Reed <reed@google.com> > Reviewed-by: Florin Malita <fmalita@chromium.org> TBR=fmalita@chromium.org,reed@google.com Change-Id: I41e3f7a3f791cc8183291847e783ed8a53bc91d2 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/53802 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'dm')
-rw-r--r--dm/DM.cpp4
-rw-r--r--dm/DMSrcSink.cpp8
2 files changed, 6 insertions, 6 deletions
diff --git a/dm/DM.cpp b/dm/DM.cpp
index ea8ec2742e..777a59345d 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -1128,9 +1128,9 @@ struct Task {
SkBitmap swizzle;
SkAssertResult(sk_tool_utils::copy_to(&swizzle, kRGBA_8888_SkColorType,
bitmap));
- hash.write(swizzle.getPixels(), swizzle.computeByteSize());
+ hash.write(swizzle.getPixels(), swizzle.getSize());
} else {
- hash.write(bitmap.getPixels(), bitmap.computeByteSize());
+ hash.write(bitmap.getPixels(), bitmap.getSize());
}
}
SkMD5::Digest digest;
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index 0968aca705..2a0b59841c 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -454,7 +454,7 @@ Error CodecSrc::draw(SkCanvas* canvas) const {
const int bpp = SkColorTypeBytesPerPixel(decodeInfo.colorType());
const size_t rowBytes = size.width() * bpp;
- const size_t safeSize = decodeInfo.computeByteSize(rowBytes);
+ const size_t safeSize = decodeInfo.getSafeSize(rowBytes);
SkAutoMalloc pixels(safeSize);
SkCodec::Options options;
@@ -1468,12 +1468,12 @@ static bool encode_png_base64(const SkBitmap& bitmap, SkString* dst) {
static Error compare_bitmaps(const SkBitmap& reference, const SkBitmap& bitmap) {
// The dimensions are a property of the Src only, and so should be identical.
- SkASSERT(reference.computeByteSize() == bitmap.computeByteSize());
- if (reference.computeByteSize() != bitmap.computeByteSize()) {
+ SkASSERT(reference.getSize() == bitmap.getSize());
+ if (reference.getSize() != bitmap.getSize()) {
return "Dimensions don't match reference";
}
// All SkBitmaps in DM are tight, so this comparison is easy.
- if (0 != memcmp(reference.getPixels(), bitmap.getPixels(), reference.computeByteSize())) {
+ if (0 != memcmp(reference.getPixels(), bitmap.getPixels(), reference.getSize())) {
SkString encoded;
SkString errString("Pixels don't match reference");
if (encode_png_base64(reference, &encoded)) {