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

Side by Side Diff: src/core/SkPaintOptionsAndroid.cpp

Issue 450513002: Revert "Remove SkPaintOptionsAndroid" (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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 unified diff | Download patch
« no previous file with comments | « src/core/SkPaint.cpp ('k') | src/core/SkScalerContext.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1
2 /*
3 * Copyright 2012 The Android Open Source Project
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8
9 #include "SkPaintOptionsAndroid.h"
10 #include "SkReadBuffer.h"
11 #include "SkWriteBuffer.h"
12 #include "SkTDict.h"
13 #include "SkThread.h"
14 #include <cstring>
15
16 SkLanguage SkLanguage::getParent() const {
17 SkASSERT(!fTag.isEmpty());
18 const char* tag = fTag.c_str();
19
20 // strip off the rightmost "-.*"
21 const char* parentTagEnd = strrchr(tag, '-');
22 if (parentTagEnd == NULL) {
23 return SkLanguage();
24 }
25 size_t parentTagLen = parentTagEnd - tag;
26 return SkLanguage(tag, parentTagLen);
27 }
28
29 void SkPaintOptionsAndroid::flatten(SkWriteBuffer& buffer) const {
30 buffer.writeUInt(fFontVariant);
31 buffer.writeString(fLanguage.getTag().c_str());
32 // to maintain picture compatibility for the old fUseFontFallbacks variable
33 buffer.writeBool(false);
34 }
35
36 void SkPaintOptionsAndroid::unflatten(SkReadBuffer& buffer) {
37 fFontVariant = (FontVariant)buffer.readUInt();
38 SkString tag;
39 buffer.readString(&tag);
40 fLanguage = SkLanguage(tag);
41 // to maintain picture compatibility for the old fUseFontFallbacks variable
42 buffer.readBool();
43 }
OLDNEW
« no previous file with comments | « src/core/SkPaint.cpp ('k') | src/core/SkScalerContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698