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

Unified Diff: blimp/engine/renderer/blimp_engine_picture_cache.cc

Issue 2343993002: use SkData oriented picture serialize api (Closed)
Patch Set: fix webkit instance 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 | « no previous file | blimp/test/support/compositor/picture_cache_test_support.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..0448d531217fa1f80965f58df651722b9ba87ecc 100644
--- a/blimp/engine/renderer/blimp_engine_picture_cache.cc
+++ b/blimp/engine/renderer/blimp_engine_picture_cache.cc
@@ -52,15 +52,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);
// 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)));
f(malita) 2016/09/16 13:18:09 nit: std::move(data)
}
} // namespace engine
« no previous file with comments | « no previous file | blimp/test/support/compositor/picture_cache_test_support.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698