Chromium Code Reviews| Index: blimp/test/support/compositor/picture_cache_test_support.cc |
| diff --git a/blimp/test/support/compositor/picture_cache_test_support.cc b/blimp/test/support/compositor/picture_cache_test_support.cc |
| index c58b941aeaa19bdf4eeeb7263eccfd939352b306..13cce4447071c29e56fe40eb896f5bfd27b6a14a 100644 |
| --- a/blimp/test/support/compositor/picture_cache_test_support.cc |
| +++ b/blimp/test/support/compositor/picture_cache_test_support.cc |
| @@ -13,7 +13,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" |
| #include "ui/gfx/geometry/point_f.h" |
| #include "ui/gfx/geometry/rect.h" |
| #include "ui/gfx/geometry/rect_f.h" |
| @@ -30,10 +29,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(data->size()); |
|
Wez
2016/09/16 16:34:02
nit: I realise this was already in this state, but
reed1
2016/09/16 20:06:29
That seems related to the other question about zer
Wez
2016/09/17 01:50:03
No, my point here was simply to be consistent in u
|
| + return data; |
| } |
| BlobId GetBlobId(sk_sp<const SkPicture> picture) { |
| @@ -42,8 +40,7 @@ BlobId GetBlobId(sk_sp<const SkPicture> picture) { |
| } |
| sk_sp<const SkPicture> DeserializePicture(sk_sp<SkData> data) { |
| - SkMemoryStream stream(data); |
| - return SkPicture::MakeFromStream(&stream, nullptr); |
| + return SkPicture::MakeFromData(data.get()); |
| } |
| bool PicturesEqual(sk_sp<const SkPicture> picture, |