OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2015 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 SkGScalerContext_DEFINED | 8 #ifndef SkRandomScalerContext_DEFINED |
9 #define SkGScalerContext_DEFINED | 9 #define SkRandomScalerContext_DEFINED |
10 | 10 |
11 #include "SkScalerContext.h" | 11 #include "SkScalerContext.h" |
12 #include "SkTypeface.h" | 12 #include "SkTypeface.h" |
13 | 13 |
14 class SkGTypeface : public SkTypeface { | 14 /* |
| 15 * This scaler context is for debug only purposes. It will 'randomly' but deter
ministically return |
| 16 * LCD / A8 / BW / RBGA masks based off of the Glyph ID |
| 17 */ |
| 18 |
| 19 class SkRandomTypeface : public SkTypeface { |
15 public: | 20 public: |
16 SkGTypeface(SkTypeface* proxy, const SkPaint&); | 21 SkRandomTypeface(SkTypeface* proxy, const SkPaint&); |
17 virtual ~SkGTypeface(); | 22 virtual ~SkRandomTypeface(); |
18 | 23 |
19 SkTypeface* proxy() const { return fProxy; } | 24 SkTypeface* proxy() const { return fProxy; } |
20 const SkPaint& paint() const { return fPaint; } | 25 const SkPaint& paint() const { return fPaint; } |
21 | 26 |
22 protected: | 27 protected: |
23 SkScalerContext* onCreateScalerContext(const SkDescriptor*) const override; | 28 SkScalerContext* onCreateScalerContext(const SkDescriptor*) const override; |
24 void onFilterRec(SkScalerContextRec*) const override; | 29 void onFilterRec(SkScalerContextRec*) const override; |
25 SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics( | 30 SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics( |
26 PerGlyphInfo, | 31 PerGlyphInfo, |
27 const uint32_t* glyphIDs, | 32 const uint32_t* glyphIDs, |
(...skipping 12 matching lines...) Expand all Loading... |
40 int onGetTableTags(SkFontTableTag tags[]) const override; | 45 int onGetTableTags(SkFontTableTag tags[]) const override; |
41 size_t onGetTableData(SkFontTableTag, size_t offset, | 46 size_t onGetTableData(SkFontTableTag, size_t offset, |
42 size_t length, void* data) const override; | 47 size_t length, void* data) const override; |
43 | 48 |
44 private: | 49 private: |
45 SkTypeface* fProxy; | 50 SkTypeface* fProxy; |
46 SkPaint fPaint; | 51 SkPaint fPaint; |
47 }; | 52 }; |
48 | 53 |
49 #endif | 54 #endif |
OLD | NEW |