Chromium Code Reviews| Index: blimp/engine/renderer/blimp_engine_picture_cache.cc |
| diff --git a/blimp/engine/renderer/blimp_engine_picture_cache.cc b/blimp/engine/renderer/blimp_engine_picture_cache.cc |
| index bb67345dca71558cfd387a4c98b5b97dc20c0399..1c09f4bd7b946d7e7cb39975689b6420dfc99b72 100644 |
| --- a/blimp/engine/renderer/blimp_engine_picture_cache.cc |
| +++ b/blimp/engine/renderer/blimp_engine_picture_cache.cc |
| @@ -6,7 +6,6 @@ |
| #include "base/logging.h" |
| #include "base/memory/ptr_util.h" |
| -#include "third_party/skia/include/core/SkStream.h" |
| namespace blimp { |
| namespace engine { |
| @@ -52,15 +51,13 @@ BlimpEnginePictureCache::CalculateCacheUpdateAndFlush() { |
| } |
| void BlimpEnginePictureCache::Put(const SkPicture* picture) { |
| - SkDynamicMemoryWStream stream; |
| - picture->serialize(&stream, pixel_serializer_); |
| - DCHECK_GE(stream.bytesWritten(), 0u); |
| + sk_sp<SkData> data = picture->serialize(pixel_serializer_); |
| + DCHECK_GE(data->size(), 0u); |
|
Wez
2016/09/16 16:34:02
Should this be DCHECK_GT? Is it possible for a pic
reed1
2016/09/16 20:06:29
Well, an empty picture could be zero bytes. I don'
Wez
2016/09/17 01:50:03
Oh my question was just a question, to check that
|
| // Store the picture data until it is sent to the client. |
| pictures_.insert( |
| std::make_pair(picture->uniqueID(), |
| - cc::PictureData(picture->uniqueID(), |
| - sk_sp<SkData>(stream.copyToData())))); |
| + cc::PictureData(picture->uniqueID(), data))); |
| } |
| } // namespace engine |