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 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 if (fRec.fFlags & SkScalerContext::kLCD_BGROrder_Flag) { | 715 if (fRec.fFlags & SkScalerContext::kLCD_BGROrder_Flag) { |
716 rgb_to_lcd16<false, false>(src, glyph, fPreBlend.fR, fPreBlend.f
G, fPreBlend.fB); | 716 rgb_to_lcd16<false, false>(src, glyph, fPreBlend.fR, fPreBlend.f
G, fPreBlend.fB); |
717 } else { | 717 } else { |
718 rgb_to_lcd16<false, true>(src, glyph, fPreBlend.fR, fPreBlend.fG
, fPreBlend.fB); | 718 rgb_to_lcd16<false, true>(src, glyph, fPreBlend.fR, fPreBlend.fG
, fPreBlend.fB); |
719 } | 719 } |
720 } | 720 } |
721 } | 721 } |
722 } | 722 } |
723 | 723 |
724 void SkScalerContext_DW::generatePath(const SkGlyph& glyph, SkPath* path) { | 724 void SkScalerContext_DW::generatePath(const SkGlyph& glyph, SkPath* path) { |
725 SkASSERT(&glyph && path); | 725 SkASSERT(path); |
726 | 726 |
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 NULL, //advances |
738 NULL, //offsets | 738 NULL, //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 |