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 12 matching lines...) Expand all Loading... |
23 const size_t fCharCodesCount; | 23 const size_t fCharCodesCount; |
24 const SkFixed* fWidths; | 24 const SkFixed* fWidths; |
25 const SkPaint::FontMetrics& fMetrics; | 25 const SkPaint::FontMetrics& fMetrics; |
26 const char* fName; | 26 const char* fName; |
27 SkTypeface::Style fStyle; | 27 SkTypeface::Style fStyle; |
28 SkTestFont* fFontCache; | 28 SkTestFont* fFontCache; |
29 }; | 29 }; |
30 | 30 |
31 class SkTestFont : public SkRefCnt { | 31 class SkTestFont : public SkRefCnt { |
32 public: | 32 public: |
33 SK_DECLARE_INST_COUNT(SkTestFont) | 33 |
34 | 34 |
35 SkTestFont(const SkTestFontData& ); | 35 SkTestFont(const SkTestFontData& ); |
36 virtual ~SkTestFont(); | 36 virtual ~SkTestFont(); |
37 int codeToIndex(SkUnichar charCode) const; | 37 int codeToIndex(SkUnichar charCode) const; |
38 void init(const SkScalar* pts, const unsigned char* verbs); | 38 void init(const SkScalar* pts, const unsigned char* verbs); |
39 #ifdef SK_DEBUG // detect missing test font data | 39 #ifdef SK_DEBUG // detect missing test font data |
40 mutable unsigned char fDebugBits[16]; | 40 mutable unsigned char fDebugBits[16]; |
41 mutable SkUnichar fDebugOverage[8]; | 41 mutable SkUnichar fDebugOverage[8]; |
42 const char* fDebugName; | 42 const char* fDebugName; |
43 SkTypeface::Style fDebugStyle; | 43 SkTypeface::Style fDebugStyle; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 return 0; | 103 return 0; |
104 } | 104 } |
105 private: | 105 private: |
106 SkTestFont* fTestFont; | 106 SkTestFont* fTestFont; |
107 friend class SkTestScalerContext; | 107 friend class SkTestScalerContext; |
108 }; | 108 }; |
109 | 109 |
110 SkTypeface* CreateTestTypeface(const char* name, SkTypeface::Style style); | 110 SkTypeface* CreateTestTypeface(const char* name, SkTypeface::Style style); |
111 | 111 |
112 #endif | 112 #endif |
OLD | NEW |