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

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: 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
« src/core/SkOrderedReadBuffer.cpp ('K') | « src/core/SkOrderedReadBuffer.cpp ('k') | no next file » | 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 7bf6fc44cd020ce269c865b10527625522b4a2dd..3b92f0a3fbc6840ebbf5175deb8ac05e775bcf9d 100644
--- a/src/core/SkPaintOptionsAndroid.cpp
+++ b/src/core/SkPaintOptionsAndroid.cpp
@@ -34,9 +34,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);
}
#endif
« src/core/SkOrderedReadBuffer.cpp ('K') | « src/core/SkOrderedReadBuffer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698