OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2009 Google Inc. | 2 * Copyright 2009 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 /* migrated from chrome/src/skia/ext/SkFontHost_fontconfig_direct.cpp */ | 8 /* migrated from chrome/src/skia/ext/SkFontHost_fontconfig_direct.cpp */ |
9 | 9 |
10 #include <unistd.h> | 10 #include <unistd.h> |
11 #include <fcntl.h> | 11 #include <fcntl.h> |
12 | 12 |
13 #include <fontconfig/fontconfig.h> | 13 #include <fontconfig/fontconfig.h> |
14 | 14 |
15 #include "SkBuffer.h" | 15 #include "SkBuffer.h" |
16 #include "SkFontConfigInterface.h" | 16 #include "SkFontConfigInterface.h" |
17 #include "SkLazyPtr.h" | 17 #include "SkLazyPtr.h" |
| 18 #include "SkMutex.h" |
18 #include "SkStream.h" | 19 #include "SkStream.h" |
19 #include "SkString.h" | 20 #include "SkString.h" |
20 | 21 |
21 size_t SkFontConfigInterface::FontIdentity::writeToMemory(void* addr) const { | 22 size_t SkFontConfigInterface::FontIdentity::writeToMemory(void* addr) const { |
22 size_t size = sizeof(fID) + sizeof(fTTCIndex); | 23 size_t size = sizeof(fID) + sizeof(fTTCIndex); |
23 size += sizeof(int32_t) + sizeof(int32_t) + sizeof(uint8_t); // weight, widt
h, italic | 24 size += sizeof(int32_t) + sizeof(int32_t) + sizeof(uint8_t); // weight, widt
h, italic |
24 size += sizeof(int32_t) + fString.size(); // store length+data | 25 size += sizeof(int32_t) + fString.size(); // store length+data |
25 if (addr) { | 26 if (addr) { |
26 SkWBuffer buffer(addr, size); | 27 SkWBuffer buffer(addr, size); |
27 | 28 |
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
727 *trimmedMatches.append() = match[i]; | 728 *trimmedMatches.append() = match[i]; |
728 } | 729 } |
729 } | 730 } |
730 | 731 |
731 SkFontStyleSet_FC* sset = SkNEW_ARGS(SkFontStyleSet_FC, | 732 SkFontStyleSet_FC* sset = SkNEW_ARGS(SkFontStyleSet_FC, |
732 (trimmedMatches.begin(), | 733 (trimmedMatches.begin(), |
733 trimmedMatches.count())); | 734 trimmedMatches.count())); |
734 #endif | 735 #endif |
735 return false; | 736 return false; |
736 } | 737 } |
OLD | NEW |