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

Unified Diff: blimp/engine/renderer/blimp_engine_picture_cache.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 | « 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..f70b3409535f91a2f14142f646552c53c643e59d 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);
// 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(), 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