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

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

Issue 2206263003: Remove SK_SUPPORT_LEGACY_DATA_FACTORIES. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ref when needed. Created 4 years, 4 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 | cc/blimp/picture_data_conversions_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/engine/renderer/engine_image_serialization_processor.cc
diff --git a/blimp/engine/renderer/engine_image_serialization_processor.cc b/blimp/engine/renderer/engine_image_serialization_processor.cc
index 8c5aed6a026632540d9d87c311f54174ba654e2c..e62b1310a69f6cef69592d4026781f2bd6f86e67 100644
--- a/blimp/engine/renderer/engine_image_serialization_processor.cc
+++ b/blimp/engine/renderer/engine_image_serialization_processor.cc
@@ -29,13 +29,13 @@ namespace blimp {
namespace engine {
namespace {
-SkData* BlobCacheImageMetadataProtoAsSkData(
+sk_sp<SkData> BlobCacheImageMetadataProtoAsSkData(
const BlobCacheImageMetadata& proto) {
int signed_size = proto.ByteSize();
size_t unsigned_size = base::checked_cast<size_t>(signed_size);
std::vector<uint8_t> serialized(unsigned_size);
proto.SerializeWithCachedSizesToArray(serialized.data());
- return SkData::NewWithCopy(serialized.data(), serialized.size());
+ return SkData::MakeWithCopy(serialized.data(), serialized.size());
}
// For each pixel, un-premultiplies the alpha-channel for each of the RGB
@@ -145,9 +145,9 @@ SkData* EngineImageSerializationProcessor::onEncode(const SkPixmap& pixmap) {
proto.set_width(pixmap.width());
proto.set_height(pixmap.height());
- SkData* sk_data = BlobCacheImageMetadataProtoAsSkData(proto);
+ sk_sp<SkData> sk_data = BlobCacheImageMetadataProtoAsSkData(proto);
DVLOG(3) << "Returning image ID " << BlobIdToString(blob_id);
- return sk_data;
+ return sk_data.release();
}
scoped_refptr<BlobData> EngineImageSerializationProcessor::EncodeImageAsBlob(
« no previous file with comments | « no previous file | cc/blimp/picture_data_conversions_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698