| 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 #include "SkPaintOptionsAndroid.h" | 9 #include "SkPaintOptionsAndroid.h" |
| 10 #include "SkReadBuffer.h" | 10 #include "SkReadBuffer.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 if (parentTagEnd == NULL) { | 22 if (parentTagEnd == NULL) { |
| 23 return SkLanguage(); | 23 return SkLanguage(); |
| 24 } | 24 } |
| 25 size_t parentTagLen = parentTagEnd - tag; | 25 size_t parentTagLen = parentTagEnd - tag; |
| 26 return SkLanguage(tag, parentTagLen); | 26 return SkLanguage(tag, parentTagLen); |
| 27 } | 27 } |
| 28 | 28 |
| 29 void SkPaintOptionsAndroid::flatten(SkWriteBuffer& buffer) const { | 29 void SkPaintOptionsAndroid::flatten(SkWriteBuffer& buffer) const { |
| 30 buffer.writeUInt(fFontVariant); | 30 buffer.writeUInt(fFontVariant); |
| 31 buffer.writeString(fLanguage.getTag().c_str()); | 31 buffer.writeString(fLanguage.getTag().c_str()); |
| 32 buffer.writeBool(fUseFontFallbacks); | 32 // to maintain picture compatibility for the old fUseFontFallbacks variable |
| 33 buffer.writeBool(false); |
| 33 } | 34 } |
| 34 | 35 |
| 35 void SkPaintOptionsAndroid::unflatten(SkReadBuffer& buffer) { | 36 void SkPaintOptionsAndroid::unflatten(SkReadBuffer& buffer) { |
| 36 fFontVariant = (FontVariant)buffer.readUInt(); | 37 fFontVariant = (FontVariant)buffer.readUInt(); |
| 37 SkString tag; | 38 SkString tag; |
| 38 buffer.readString(&tag); | 39 buffer.readString(&tag); |
| 39 fLanguage = SkLanguage(tag); | 40 fLanguage = SkLanguage(tag); |
| 40 fUseFontFallbacks = buffer.readBool(); | 41 // to maintain picture compatibility for the old fUseFontFallbacks variable |
| 42 buffer.readBool(); |
| 41 } | 43 } |
| OLD | NEW |