OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 The Android Open Source Project | 3 * Copyright 2012 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #ifdef SK_BUILD_FOR_ANDROID | 9 #ifdef SK_BUILD_FOR_ANDROID |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 return SkLanguage(tag, parentTagLen); | 27 return SkLanguage(tag, parentTagLen); |
28 } | 28 } |
29 | 29 |
30 void SkPaintOptionsAndroid::flatten(SkFlattenableWriteBuffer& buffer) const { | 30 void SkPaintOptionsAndroid::flatten(SkFlattenableWriteBuffer& buffer) const { |
31 buffer.writeUInt(fFontVariant); | 31 buffer.writeUInt(fFontVariant); |
32 buffer.writeString(fLanguage.getTag().c_str()); | 32 buffer.writeString(fLanguage.getTag().c_str()); |
33 } | 33 } |
34 | 34 |
35 void SkPaintOptionsAndroid::unflatten(SkFlattenableReadBuffer& buffer) { | 35 void SkPaintOptionsAndroid::unflatten(SkFlattenableReadBuffer& buffer) { |
36 fFontVariant = (FontVariant)buffer.readUInt(); | 36 fFontVariant = (FontVariant)buffer.readUInt(); |
37 char* tag = buffer.readString(); | 37 SkString tag; |
| 38 buffer.readString(tag); |
38 fLanguage = SkLanguage(tag); | 39 fLanguage = SkLanguage(tag); |
39 sk_free(tag); | |
40 } | 40 } |
41 | 41 |
42 #endif | 42 #endif |
OLD | NEW |