OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 #undef GetGlyphIndices | 9 #undef GetGlyphIndices |
10 | 10 |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 "Fallback bounding box could not be determined."); | 460 "Fallback bounding box could not be determined."); |
461 if (glyph_check_and_set_bounds(glyph, bbox)) { | 461 if (glyph_check_and_set_bounds(glyph, bbox)) { |
462 glyph->fForceBW = 1; | 462 glyph->fForceBW = 1; |
463 } | 463 } |
464 } | 464 } |
465 // TODO: handle the case where a request for DWRITE_TEXTURE_ALIASED_1x1 | 465 // TODO: handle the case where a request for DWRITE_TEXTURE_ALIASED_1x1 |
466 // fails, and try DWRITE_TEXTURE_CLEARTYPE_3x1. | 466 // fails, and try DWRITE_TEXTURE_CLEARTYPE_3x1. |
467 } | 467 } |
468 | 468 |
469 void SkScalerContext_DW::generateFontMetrics(SkPaint::FontMetrics* metrics) { | 469 void SkScalerContext_DW::generateFontMetrics(SkPaint::FontMetrics* metrics) { |
470 if (NULL == metrics) { | 470 if (nullptr == metrics) { |
471 return; | 471 return; |
472 } | 472 } |
473 | 473 |
474 sk_bzero(metrics, sizeof(*metrics)); | 474 sk_bzero(metrics, sizeof(*metrics)); |
475 | 475 |
476 DWRITE_FONT_METRICS dwfm; | 476 DWRITE_FONT_METRICS dwfm; |
477 if (DWRITE_MEASURING_MODE_GDI_CLASSIC == fMeasuringMode || | 477 if (DWRITE_MEASURING_MODE_GDI_CLASSIC == fMeasuringMode || |
478 DWRITE_MEASURING_MODE_GDI_NATURAL == fMeasuringMode) | 478 DWRITE_MEASURING_MODE_GDI_NATURAL == fMeasuringMode) |
479 { | 479 { |
480 fTypeface->fDWriteFontFace->GetGdiCompatibleMetrics( | 480 fTypeface->fDWriteFontFace->GetGdiCompatibleMetrics( |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
727 path->reset(); | 727 path->reset(); |
728 | 728 |
729 SkTScopedComPtr<IDWriteGeometrySink> geometryToPath; | 729 SkTScopedComPtr<IDWriteGeometrySink> geometryToPath; |
730 HRVM(SkDWriteGeometrySink::Create(path, &geometryToPath), | 730 HRVM(SkDWriteGeometrySink::Create(path, &geometryToPath), |
731 "Could not create geometry to path converter."); | 731 "Could not create geometry to path converter."); |
732 uint16_t glyphId = glyph.getGlyphID(); | 732 uint16_t glyphId = glyph.getGlyphID(); |
733 //TODO: convert to<->from DIUs? This would make a difference if hinting. | 733 //TODO: convert to<->from DIUs? This would make a difference if hinting. |
734 //It may not be needed, it appears that DirectWrite only hints at em size. | 734 //It may not be needed, it appears that DirectWrite only hints at em size. |
735 HRVM(fTypeface->fDWriteFontFace->GetGlyphRunOutline(SkScalarToFloat(fTextSiz
eRender), | 735 HRVM(fTypeface->fDWriteFontFace->GetGlyphRunOutline(SkScalarToFloat(fTextSiz
eRender), |
736 &glyphId, | 736 &glyphId, |
737 NULL, //advances | 737 nullptr, //advances |
738 NULL, //offsets | 738 nullptr, //offsets |
739 1, //num glyphs | 739 1, //num glyphs |
740 FALSE, //sideways | 740 FALSE, //sideways |
741 FALSE, //rtl | 741 FALSE, //rtl |
742 geometryToPath.get()), | 742 geometryToPath.get()), |
743 "Could not create glyph outline."); | 743 "Could not create glyph outline."); |
744 | 744 |
745 path->transform(fSkXform); | 745 path->transform(fSkXform); |
746 } | 746 } |
OLD | NEW |