| 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 <string> | 10 #include <string> |
| 11 #include <unistd.h> | 11 #include <unistd.h> |
| 12 #include <fcntl.h> | 12 #include <fcntl.h> |
| 13 | 13 |
| 14 #include <fontconfig/fontconfig.h> | 14 #include <fontconfig/fontconfig.h> |
| 15 | 15 |
| 16 #include "SkBuffer.h" | 16 #include "SkBuffer.h" |
| 17 #include "SkFontConfigInterface.h" | 17 #include "SkFontConfigInterface.h" |
| 18 #include "SkStream.h" | 18 #include "SkStream.h" |
| 19 | 19 |
| 20 SK_DEFINE_INST_COUNT(SkFontConfigInterface) |
| 21 |
| 20 size_t SkFontConfigInterface::FontIdentity::writeToMemory(void* addr) const { | 22 size_t SkFontConfigInterface::FontIdentity::writeToMemory(void* addr) const { |
| 21 size_t size = sizeof(fID) + sizeof(fTTCIndex); | 23 size_t size = sizeof(fID) + sizeof(fTTCIndex); |
| 22 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 |
| 23 size += sizeof(int32_t) + fString.size(); // store length+data | 25 size += sizeof(int32_t) + fString.size(); // store length+data |
| 24 if (addr) { | 26 if (addr) { |
| 25 SkWBuffer buffer(addr, size); | 27 SkWBuffer buffer(addr, size); |
| 26 | 28 |
| 27 buffer.write32(fID); | 29 buffer.write32(fID); |
| 28 buffer.write32(fTTCIndex); | 30 buffer.write32(fTTCIndex); |
| 29 buffer.write32(fString.size()); | 31 buffer.write32(fString.size()); |
| (...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 *trimmedMatches.append() = match[i]; | 727 *trimmedMatches.append() = match[i]; |
| 726 } | 728 } |
| 727 } | 729 } |
| 728 | 730 |
| 729 SkFontStyleSet_FC* sset = SkNEW_ARGS(SkFontStyleSet_FC, | 731 SkFontStyleSet_FC* sset = SkNEW_ARGS(SkFontStyleSet_FC, |
| 730 (trimmedMatches.begin(), | 732 (trimmedMatches.begin(), |
| 731 trimmedMatches.count())); | 733 trimmedMatches.count())); |
| 732 #endif | 734 #endif |
| 733 return false; | 735 return false; |
| 734 } | 736 } |
| OLD | NEW |