OLD | NEW |
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 #ifndef SkTestScalerContext_DEFINED | 8 #ifndef SkTestScalerContext_DEFINED |
9 #define SkTestScalerContext_DEFINED | 9 #define SkTestScalerContext_DEFINED |
10 | 10 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 const SkPaint::FontMetrics& fMetrics; | 50 const SkPaint::FontMetrics& fMetrics; |
51 const char* fName; | 51 const char* fName; |
52 SkPath** fPaths; | 52 SkPath** fPaths; |
53 friend class SkTestTypeface; | 53 friend class SkTestTypeface; |
54 typedef SkRefCnt INHERITED; | 54 typedef SkRefCnt INHERITED; |
55 }; | 55 }; |
56 | 56 |
57 | 57 |
58 class SkTestTypeface : public SkTypeface { | 58 class SkTestTypeface : public SkTypeface { |
59 public: | 59 public: |
60 SkTestTypeface(SkTestFont* , SkTypeface::Style style); | 60 SkTestTypeface(SkTestFont*, const SkFontStyle& style); |
61 virtual ~SkTestTypeface() { | 61 virtual ~SkTestTypeface() { |
62 SkSafeUnref(fTestFont); | 62 SkSafeUnref(fTestFont); |
63 } | 63 } |
64 void getAdvance(SkGlyph* glyph); | 64 void getAdvance(SkGlyph* glyph); |
65 void getFontMetrics(SkPaint::FontMetrics* metrics); | 65 void getFontMetrics(SkPaint::FontMetrics* metrics); |
66 void getMetrics(SkGlyph* glyph); | 66 void getMetrics(SkGlyph* glyph); |
67 void getPath(const SkGlyph& glyph, SkPath* path); | 67 void getPath(const SkGlyph& glyph, SkPath* path); |
68 protected: | 68 protected: |
69 virtual SkScalerContext* onCreateScalerContext(const SkDescriptor* desc) con
st SK_OVERRIDE; | 69 virtual SkScalerContext* onCreateScalerContext(const SkDescriptor* desc) con
st SK_OVERRIDE; |
70 virtual void onFilterRec(SkScalerContextRec* rec) const SK_OVERRIDE; | 70 virtual void onFilterRec(SkScalerContextRec* rec) const SK_OVERRIDE; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 return 0; | 104 return 0; |
105 } | 105 } |
106 private: | 106 private: |
107 SkTestFont* fTestFont; | 107 SkTestFont* fTestFont; |
108 friend class SkTestScalerContext; | 108 friend class SkTestScalerContext; |
109 }; | 109 }; |
110 | 110 |
111 SkTypeface* CreateTestTypeface(const char* name, SkTypeface::Style style); | 111 SkTypeface* CreateTestTypeface(const char* name, SkTypeface::Style style); |
112 | 112 |
113 #endif | 113 #endif |
OLD | NEW |