diff options
author | bungeman <bungeman@google.com> | 2016-05-09 08:41:01 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-09 08:41:01 -0700 |
commit | 5a493cdbeca87f85e2b08914c176c29d914083d9 (patch) | |
tree | 0f64a7e24392bde722301e788690b951f6e14abb /src | |
parent | ab12c788e2d8f7768c65c65ec6d6190ffb2f3fcc (diff) |
Less indentation.
Review-Url: https://codereview.chromium.org/1963693002
Diffstat (limited to 'src')
-rw-r--r-- | src/ports/SkFontHost_FreeType.cpp | 25 | ||||
-rw-r--r-- | src/ports/SkFontHost_mac.cpp | 25 | ||||
-rw-r--r-- | src/ports/SkFontHost_win.cpp | 37 | ||||
-rw-r--r-- | src/ports/SkTypeface_win_dw.cpp | 12 |
4 files changed, 52 insertions, 47 deletions
diff --git a/src/ports/SkFontHost_FreeType.cpp b/src/ports/SkFontHost_FreeType.cpp index 4dc401c59a..2e0b8b6ee3 100644 --- a/src/ports/SkFontHost_FreeType.cpp +++ b/src/ports/SkFontHost_FreeType.cpp @@ -606,18 +606,19 @@ SkAdvancedTypefaceMetrics* SkTypeface_FreeType::onGetAdvancedTypefaceMetrics( info->fGlyphWidths.emplace_back(std::move(range)); } else { info->setGlyphWidths( - face->num_glyphs, glyphIDs, glyphIDsCount, - SkAdvancedTypefaceMetrics::GetAdvance( - [face](int gId, int16_t* data) { - FT_Fixed advance = 0; - if (FT_Get_Advances(face, gId, 1, - FT_LOAD_NO_SCALE, &advance)) { - return false; - } - SkASSERT(data); - *data = advance; - return true; - })); + face->num_glyphs, + glyphIDs, + glyphIDsCount, + SkAdvancedTypefaceMetrics::GetAdvance([face](int gId, int16_t* data) { + FT_Fixed advance = 0; + if (FT_Get_Advances(face, gId, 1, FT_LOAD_NO_SCALE, &advance)) { + return false; + } + SkASSERT(data); + *data = advance; + return true; + }) + ); } } diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp index cff69b315c..0cc436f7c3 100644 --- a/src/ports/SkFontHost_mac.cpp +++ b/src/ports/SkFontHost_mac.cpp @@ -1618,18 +1618,19 @@ SkAdvancedTypefaceMetrics* SkTypeface_Mac::onGetAdvancedTypefaceMetrics( } else { CTFontRef borrowedCTFont = ctFont.get(); info->setGlyphWidths( - SkToInt(glyphCount), glyphIDs, glyphIDsCount, - SkAdvancedTypefaceMetrics::GetAdvance( - [borrowedCTFont](int gId, int16_t* data) { - CGSize advance; - advance.width = 0; - CGGlyph glyph = gId; - CTFontGetAdvancesForGlyphs( - borrowedCTFont, kCTFontHorizontalOrientation, - &glyph, &advance, 1); - *data = sk_float_round2int(advance.width); - return true; - })); + SkToInt(glyphCount), + glyphIDs, + glyphIDsCount, + SkAdvancedTypefaceMetrics::GetAdvance([borrowedCTFont](int gId, int16_t* data) { + CGSize advance; + advance.width = 0; + CGGlyph glyph = gId; + CTFontGetAdvancesForGlyphs(borrowedCTFont, kCTFontHorizontalOrientation, + &glyph, &advance, 1); + *data = sk_float_round2int(advance.width); + return true; + }) + ); } } return info; diff --git a/src/ports/SkFontHost_win.cpp b/src/ports/SkFontHost_win.cpp index 898aa42309..25038dcf38 100644 --- a/src/ports/SkFontHost_win.cpp +++ b/src/ports/SkFontHost_win.cpp @@ -1826,24 +1826,25 @@ SkAdvancedTypefaceMetrics* LogFontTypeface::onGetAdvancedTypefaceMetrics( info->fGlyphWidths.emplace_back(std::move(range)); } else { info->setGlyphWidths( - glyphCount, glyphIDs, glyphIDsCount, - SkAdvancedTypefaceMetrics::GetAdvance( - [hdc](int gId, int16_t* advance) { - // Initialize the MAT2 structure to - // the identify transformation matrix. - static const MAT2 mat2 = { - SkScalarToFIXED(1), SkScalarToFIXED(0), - SkScalarToFIXED(0), SkScalarToFIXED(1)}; - int flags = GGO_METRICS | GGO_GLYPH_INDEX; - GLYPHMETRICS gm; - if (GDI_ERROR == GetGlyphOutline( - hdc, gId, flags, &gm, 0, nullptr, &mat2)) { - return false; - } - SkASSERT(advance); - *advance = gm.gmCellIncX; - return true; - })); + glyphCount, + glyphIDs, + glyphIDsCount, + SkAdvancedTypefaceMetrics::GetAdvance([hdc](int gId, int16_t* advance) { + // Initialize the MAT2 structure to + // the identify transformation matrix. + static const MAT2 mat2 = { + SkScalarToFIXED(1), SkScalarToFIXED(0), + SkScalarToFIXED(0), SkScalarToFIXED(1)}; + int flags = GGO_METRICS | GGO_GLYPH_INDEX; + GLYPHMETRICS gm; + if (GDI_ERROR == GetGlyphOutline(hdc, gId, flags, &gm, 0, nullptr, &mat2)) { + return false; + } + SkASSERT(advance); + *advance = gm.gmCellIncX; + return true; + }) + ); } } diff --git a/src/ports/SkTypeface_win_dw.cpp b/src/ports/SkTypeface_win_dw.cpp index 87fbcd2f6c..0f22e471cf 100644 --- a/src/ports/SkTypeface_win_dw.cpp +++ b/src/ports/SkTypeface_win_dw.cpp @@ -452,11 +452,13 @@ SkAdvancedTypefaceMetrics* DWriteFontTypeface::onGetAdvancedTypefaceMetrics( } else { IDWriteFontFace* borrowedFontFace = fDWriteFontFace.get(); info->setGlyphWidths( - glyphCount, glyphIDs, glyphIDsCount, - SkAdvancedTypefaceMetrics::GetAdvance( - [borrowedFontFace](int gId, int16_t* data) { - return getWidthAdvance(borrowedFontFace, gId, data); - })); + glyphCount, + glyphIDs, + glyphIDsCount, + SkAdvancedTypefaceMetrics::GetAdvance([borrowedFontFace](int gId, int16_t* data) { + return getWidthAdvance(borrowedFontFace, gId, data); + }) + ); } } |