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

Unified Diff: src/core/SkPaintOptionsAndroid.cpp

Issue 15179008: Add buffer helper to read directly into SkString to avoid extra copying (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebasing Created 7 years, 7 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 | « src/core/SkOrderedReadBuffer.cpp ('k') | src/images/SkImageRef_ashmem.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPaintOptionsAndroid.cpp
diff --git a/src/core/SkPaintOptionsAndroid.cpp b/src/core/SkPaintOptionsAndroid.cpp
index a08845a0b447a8c4a8ecacc45718434095db9df2..46e8060073d3e517662bc530173658cf4f04813d 100644
--- a/src/core/SkPaintOptionsAndroid.cpp
+++ b/src/core/SkPaintOptionsAndroid.cpp
@@ -35,9 +35,9 @@ void SkPaintOptionsAndroid::flatten(SkFlattenableWriteBuffer& buffer) const {
void SkPaintOptionsAndroid::unflatten(SkFlattenableReadBuffer& buffer) {
fFontVariant = (FontVariant)buffer.readUInt();
- char* tag = buffer.readString();
+ SkString tag;
+ buffer.readString(&tag);
fLanguage = SkLanguage(tag);
- sk_free(tag);
fUseFontFallbacks = buffer.readBool();
}
« no previous file with comments | « src/core/SkOrderedReadBuffer.cpp ('k') | src/images/SkImageRef_ashmem.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698