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

Unified Diff: cc/blimp/picture_data_conversions_unittest.cc

Issue 2343993002: use SkData oriented picture serialize api (Closed)
Patch Set: doh -- use 0u for template bad guesses 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 | « blimp/test/support/compositor/picture_cache_test_support.cc ('k') | cc/test/picture_cache_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/blimp/picture_data_conversions_unittest.cc
diff --git a/cc/blimp/picture_data_conversions_unittest.cc b/cc/blimp/picture_data_conversions_unittest.cc
index c4e21202ebe04645cafb806506986e0c4760e0e7..f3e64db53843b860ff47c6b2b654b2ecb75c31e2 100644
--- a/cc/blimp/picture_data_conversions_unittest.cc
+++ b/cc/blimp/picture_data_conversions_unittest.cc
@@ -18,7 +18,6 @@
#include "third_party/skia/include/core/SkPicture.h"
#include "third_party/skia/include/core/SkPictureRecorder.h"
#include "third_party/skia/include/core/SkRefCnt.h"
-#include "third_party/skia/include/core/SkStream.h"
namespace cc {
namespace {
@@ -31,10 +30,9 @@ sk_sp<const SkPicture> CreateSkPicture(SkColor color) {
}
sk_sp<SkData> SerializePicture(sk_sp<const SkPicture> picture) {
- SkDynamicMemoryWStream stream;
- picture->serialize(&stream, nullptr);
- DCHECK(stream.bytesWritten());
- return sk_sp<SkData>(stream.copyToData());
+ sk_sp<SkData> data = picture->serialize();
+ DCHECK_GT(data->size(), 0u);
+ return data;
}
bool SamePicture(sk_sp<const SkPicture> picture,
« no previous file with comments | « blimp/test/support/compositor/picture_cache_test_support.cc ('k') | cc/test/picture_cache_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698