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

Unified Diff: tests/CachedDecodingPixelRefTest.cpp

Issue 2333713002: change SkStreams to work with sk_sp<SkData> instead of SkData* (Closed)
Patch Set: fix xpsdevice Created 4 years, 3 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
« no previous file with comments | « tests/AnnotationTest.cpp ('k') | tests/CodecPriv.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/CachedDecodingPixelRefTest.cpp
diff --git a/tests/CachedDecodingPixelRefTest.cpp b/tests/CachedDecodingPixelRefTest.cpp
index 1c89895d0bfa47cbb9553dfd176cf844ef642e26..b6253c73a200df0a54f49236ba7b1269420c5a52 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;
« no previous file with comments | « tests/AnnotationTest.cpp ('k') | tests/CodecPriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698