diff options
author | reed <reed@google.com> | 2016-09-12 12:01:44 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-09-12 12:01:44 -0700 |
commit | 42943c8aa9c611c18ad0f1a30a27669f3d82239c (patch) | |
tree | deff0bbc59dd92559191c188d73f97b4f9c580aa /tests/CachedDecodingPixelRefTest.cpp | |
parent | 09524ae42998ece3a8e7973064ab286646511b31 (diff) |
change SkStreams to work with sk_sp<SkData> instead of SkData*
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2333713002
Review-Url: https://codereview.chromium.org/2333713002
Diffstat (limited to 'tests/CachedDecodingPixelRefTest.cpp')
-rw-r--r-- | tests/CachedDecodingPixelRefTest.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/CachedDecodingPixelRefTest.cpp b/tests/CachedDecodingPixelRefTest.cpp index 1c89895d0b..b6253c73a2 100644 --- a/tests/CachedDecodingPixelRefTest.cpp +++ b/tests/CachedDecodingPixelRefTest.cpp @@ -38,11 +38,10 @@ static void make_test_image(SkBitmap* bm) { /** * encode this bitmap into some data via SkImageEncoder */ -static SkData* create_data_from_bitmap(const SkBitmap& bm, - SkImageEncoder::Type type) { +static sk_sp<SkData> create_data_from_bitmap(const SkBitmap& bm, SkImageEncoder::Type type) { SkDynamicMemoryWStream stream; if (SkImageEncoder::EncodeStream(&stream, bm, type, 100)) { - return stream.copyToData(); + return stream.detachAsData(); } return nullptr; } @@ -107,7 +106,7 @@ static void test_three_encodings(skiatest::Reporter* reporter, }; for (size_t i = 0; i < SK_ARRAY_COUNT(types); i++) { SkImageEncoder::Type type = types[i]; - sk_sp<SkData> encoded(create_data_from_bitmap(original, type)); + sk_sp<SkData> encoded = create_data_from_bitmap(original, type); REPORTER_ASSERT(reporter, encoded.get() != nullptr); if (nullptr == encoded.get()) { continue; |