OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 #include "SkTypes.h" | 8 #include "SkTypes.h" |
9 #if defined(SK_BUILD_FOR_WIN32) | 9 #if defined(SK_BUILD_FOR_WIN32) |
10 | 10 |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 if (perGlyphInfo & kHAdvance_PerGlyphInfo) { | 443 if (perGlyphInfo & kHAdvance_PerGlyphInfo) { |
444 if (fixedWidth) { | 444 if (fixedWidth) { |
445 SkAdvancedTypefaceMetrics::WidthRange range(0); | 445 SkAdvancedTypefaceMetrics::WidthRange range(0); |
446 int16_t advance; | 446 int16_t advance; |
447 getWidthAdvance(fDWriteFontFace.get(), 1, &advance); | 447 getWidthAdvance(fDWriteFontFace.get(), 1, &advance); |
448 range.fAdvance.append(1, &advance); | 448 range.fAdvance.append(1, &advance); |
449 SkAdvancedTypefaceMetrics::FinishRange( | 449 SkAdvancedTypefaceMetrics::FinishRange( |
450 &range, 0, SkAdvancedTypefaceMetrics::WidthRange::kDefault); | 450 &range, 0, SkAdvancedTypefaceMetrics::WidthRange::kDefault); |
451 info->fGlyphWidths.emplace_back(std::move(range)); | 451 info->fGlyphWidths.emplace_back(std::move(range)); |
452 } else { | 452 } else { |
453 info->setGlyphWidths(fDWriteFontFace.get(), glyphCount, glyphIDs, | 453 IDWriteFontFace* borrowedFontFace = fDWriteFontFace.get(); |
454 glyphIDsCount, getWidthAdvance); | 454 info->setGlyphWidths( |
| 455 glyphCount, glyphIDs, glyphIDsCount, |
| 456 SkAdvancedTypefaceMetrics::GetAdvance( |
| 457 [borrowedFontFace](int gId, int16_t* data) { |
| 458 return getWidthAdvance(borrowedFontFace, gId, da
ta); |
| 459 })); |
455 } | 460 } |
456 } | 461 } |
457 | 462 |
458 return info; | 463 return info; |
459 } | 464 } |
460 #endif//defined(SK_BUILD_FOR_WIN32) | 465 #endif//defined(SK_BUILD_FOR_WIN32) |
OLD | NEW |