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 GrStencilAndCoverTextContext_DEFINED | 8 #ifndef GrStencilAndCoverTextContext_DEFINED |
9 #define GrStencilAndCoverTextContext_DEFINED | 9 #define GrStencilAndCoverTextContext_DEFINED |
10 | 10 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 90 |
91 bool isAntiAlias() const { return fFont.isAntiAlias(); } | 91 bool isAntiAlias() const { return fFont.isAntiAlias(); } |
92 | 92 |
93 private: | 93 private: |
94 typedef GrDrawPathRangeBatch::InstanceData InstanceData; | 94 typedef GrDrawPathRangeBatch::InstanceData InstanceData; |
95 | 95 |
96 SkGlyphCache* getGlyphCache() const; | 96 SkGlyphCache* getGlyphCache() const; |
97 GrPathRange* createGlyphs(GrContext*) const; | 97 GrPathRange* createGlyphs(GrContext*) const; |
98 void appendGlyph(const SkGlyph&, const SkPoint&, FallbackBlobBuilder*); | 98 void appendGlyph(const SkGlyph&, const SkPoint&, FallbackBlobBuilder*); |
99 | 99 |
100 GrStyle fStyle; | 100 GrStyle fStyle; |
101 SkPaint fFont; | 101 SkPaint fFont; |
102 SkScalar fTextRatio; | 102 SkScalar fTextRatio; |
103 float fTextInverseRatio; | 103 float fTextInverseRatio; |
104 bool fUsingRawGlyphPaths; | 104 bool fUsingRawGlyphPaths; |
105 GrUniqueKey fGlyphPathsKey; | 105 GrUniqueKey fGlyphPathsKey; |
106 int fTotalGlyphCount; | 106 int fTotalGlyphCount; |
107 SkAutoTUnref<InstanceData> fInstanceData; | 107 SkAutoTUnref<InstanceData> fInstanceData; |
108 int fFallbackGlyphCount; | 108 int fFallbackGlyphCount; |
109 SkAutoTUnref<const SkTextBlob> fFallbackTextBlob; | 109 sk_sp<SkTextBlob> fFallbackTextBlob; |
110 mutable SkGlyphCache* fDetachedGlyphCache; | 110 mutable SkGlyphCache* fDetachedGlyphCache; |
111 mutable uint32_t fLastDrawnGlyphsID; | 111 mutable uint32_t fLastDrawnGlyphsID; |
112 }; | 112 }; |
113 | 113 |
114 // Text blobs/caches. | 114 // Text blobs/caches. |
115 | 115 |
116 class TextBlob : public SkTLList<TextRun, 1> { | 116 class TextBlob : public SkTLList<TextRun, 1> { |
117 public: | 117 public: |
118 typedef SkTArray<uint32_t, true> Key; | 118 typedef SkTArray<uint32_t, true> Key; |
119 | 119 |
120 static const Key& GetKey(const TextBlob* blob) { return blob->key(); } | 120 static const Key& GetKey(const TextBlob* blob) { return blob->key(); } |
121 | 121 |
(...skipping 29 matching lines...) Expand all Loading... |
151 void purgeToFit(const TextBlob&); | 151 void purgeToFit(const TextBlob&); |
152 | 152 |
153 GrAtlasTextContext* fFallbackTextConte
xt; | 153 GrAtlasTextContext* fFallbackTextConte
xt; |
154 SkTHashMap<uint32_t, TextBlob*> fBlobIdCache; | 154 SkTHashMap<uint32_t, TextBlob*> fBlobIdCache; |
155 SkTHashTable<TextBlob*, const TextBlob::Key&, TextBlob> fBlobKeyCache; | 155 SkTHashTable<TextBlob*, const TextBlob::Key&, TextBlob> fBlobKeyCache; |
156 SkTInternalLList<TextBlob> fLRUList; | 156 SkTInternalLList<TextBlob> fLRUList; |
157 size_t fCacheSize; | 157 size_t fCacheSize; |
158 }; | 158 }; |
159 | 159 |
160 #endif | 160 #endif |
OLD | NEW |