OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #include "SkScalerContext.h" | 10 #include "SkScalerContext.h" |
11 #include "SkColorPriv.h" | 11 #include "SkColorPriv.h" |
12 #include "SkDescriptor.h" | 12 #include "SkDescriptor.h" |
13 #include "SkDraw.h" | 13 #include "SkDraw.h" |
14 #include "SkFontHost.h" | |
15 #include "SkGlyph.h" | 14 #include "SkGlyph.h" |
16 #include "SkMaskFilter.h" | 15 #include "SkMaskFilter.h" |
17 #include "SkMaskGamma.h" | 16 #include "SkMaskGamma.h" |
18 #include "SkMatrix22.h" | 17 #include "SkMatrix22.h" |
19 #include "SkReadBuffer.h" | 18 #include "SkReadBuffer.h" |
20 #include "SkWriteBuffer.h" | 19 #include "SkWriteBuffer.h" |
21 #include "SkPathEffect.h" | 20 #include "SkPathEffect.h" |
22 #include "SkRasterizer.h" | 21 #include "SkRasterizer.h" |
23 #include "SkRasterClip.h" | 22 #include "SkRasterClip.h" |
24 #include "SkStroke.h" | 23 #include "SkStroke.h" |
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
844 return kX_SkAxisAlignment; | 843 return kX_SkAxisAlignment; |
845 } | 844 } |
846 if (0 == matrix[SkMatrix::kMScaleX]) { | 845 if (0 == matrix[SkMatrix::kMScaleX]) { |
847 return kY_SkAxisAlignment; | 846 return kY_SkAxisAlignment; |
848 } | 847 } |
849 return kNone_SkAxisAlignment; | 848 return kNone_SkAxisAlignment; |
850 } | 849 } |
851 | 850 |
852 /////////////////////////////////////////////////////////////////////////////// | 851 /////////////////////////////////////////////////////////////////////////////// |
853 | 852 |
854 #include "SkFontHost.h" | |
855 | |
856 class SkScalerContext_Empty : public SkScalerContext { | 853 class SkScalerContext_Empty : public SkScalerContext { |
857 public: | 854 public: |
858 SkScalerContext_Empty(SkTypeface* face, const SkDescriptor* desc) | 855 SkScalerContext_Empty(SkTypeface* face, const SkDescriptor* desc) |
859 : SkScalerContext(face, desc) {} | 856 : SkScalerContext(face, desc) {} |
860 | 857 |
861 protected: | 858 protected: |
862 virtual unsigned generateGlyphCount() SK_OVERRIDE { | 859 virtual unsigned generateGlyphCount() SK_OVERRIDE { |
863 return 0; | 860 return 0; |
864 } | 861 } |
865 virtual uint16_t generateCharToGlyph(SkUnichar uni) SK_OVERRIDE { | 862 virtual uint16_t generateCharToGlyph(SkUnichar uni) SK_OVERRIDE { |
(...skipping 19 matching lines...) Expand all Loading... |
885 SkScalerContext* SkTypeface::createScalerContext(const SkDescriptor* desc, | 882 SkScalerContext* SkTypeface::createScalerContext(const SkDescriptor* desc, |
886 bool allowFailure) const { | 883 bool allowFailure) const { |
887 SkScalerContext* c = this->onCreateScalerContext(desc); | 884 SkScalerContext* c = this->onCreateScalerContext(desc); |
888 | 885 |
889 if (!c && !allowFailure) { | 886 if (!c && !allowFailure) { |
890 c = SkNEW_ARGS(SkScalerContext_Empty, | 887 c = SkNEW_ARGS(SkScalerContext_Empty, |
891 (const_cast<SkTypeface*>(this), desc)); | 888 (const_cast<SkTypeface*>(this), desc)); |
892 } | 889 } |
893 return c; | 890 return c; |
894 } | 891 } |
OLD | NEW |