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

Side by Side Diff: src/ports/SkTypeface_win_dw.cpp

Issue 1955053002: SkAdvancedTypefaceMetrics: getAdvanceData uses std::function (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: typedef Created 4 years, 7 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/ports/SkFontHost_win.cpp ('k') | tests/WArrayTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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)
OLDNEW
« no previous file with comments | « src/ports/SkFontHost_win.cpp ('k') | tests/WArrayTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698