OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 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 GrAtlasTextBatch_DEFINED | 8 #ifndef GrAtlasTextBatch_DEFINED |
9 #define GrAtlasTextBatch_DEFINED | 9 #define GrAtlasTextBatch_DEFINED |
10 | 10 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 this->setBounds(bounds); | 95 this->setBounds(bounds); |
96 } else { | 96 } else { |
97 this->setBounds(run.fVertexBounds); | 97 this->setBounds(run.fVertexBounds); |
98 } | 98 } |
99 } | 99 } |
100 | 100 |
101 const char* name() const override { return "TextBatch"; } | 101 const char* name() const override { return "TextBatch"; } |
102 | 102 |
103 SkString dumpInfo() const override; | 103 SkString dumpInfo() const override; |
104 | 104 |
105 void getInvariantOutputColor(GrInitInvariantOutput* out) const override; | |
106 | |
107 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override; | |
108 | |
109 static size_t GetVertexStride(GrMaskFormat maskFormat) { | 105 static size_t GetVertexStride(GrMaskFormat maskFormat) { |
110 switch (maskFormat) { | 106 switch (maskFormat) { |
111 case kA8_GrMaskFormat: | 107 case kA8_GrMaskFormat: |
112 return kGrayTextVASize; | 108 return kGrayTextVASize; |
113 case kARGB_GrMaskFormat: | 109 case kARGB_GrMaskFormat: |
114 return kColorTextVASize; | 110 return kColorTextVASize; |
115 default: | 111 default: |
116 return kLCDTextVASize; | 112 return kLCDTextVASize; |
117 } | 113 } |
118 } | 114 } |
119 | 115 |
120 static size_t GetVertexStrideDf(GrMaskFormat maskFormat, bool useLCDText) { | 116 static size_t GetVertexStrideDf(GrMaskFormat maskFormat, bool useLCDText) { |
121 SkASSERT(maskFormat == kA8_GrMaskFormat); | 117 SkASSERT(maskFormat == kA8_GrMaskFormat); |
122 if (useLCDText) { | 118 if (useLCDText) { |
123 return kLCDTextVASize; | 119 return kLCDTextVASize; |
124 } else { | 120 } else { |
125 return kGrayTextVASize; | 121 return kGrayTextVASize; |
126 } | 122 } |
127 } | 123 } |
128 | 124 |
| 125 protected: |
| 126 void computePipelineOptimizations(GrInitInvariantOutput* color, |
| 127 GrInitInvariantOutput* coverage, |
| 128 GrBatchToXPOverrides* overrides) const ove
rride; |
| 129 |
| 130 |
129 private: | 131 private: |
130 void initBatchTracker(const GrPipelineOptimizations& opt) override; | 132 void initBatchTracker(const GrXPOverridesForBatch& overrides) override; |
131 | 133 |
132 struct FlushInfo { | 134 struct FlushInfo { |
133 SkAutoTUnref<const GrVertexBuffer> fVertexBuffer; | 135 SkAutoTUnref<const GrVertexBuffer> fVertexBuffer; |
134 SkAutoTUnref<const GrIndexBuffer> fIndexBuffer; | 136 SkAutoTUnref<const GrIndexBuffer> fIndexBuffer; |
135 int fGlyphsToFlush; | 137 int fGlyphsToFlush; |
136 int fVertexOffset; | 138 int fVertexOffset; |
137 }; | 139 }; |
138 | 140 |
139 void onPrepareDraws(Target* target) override; | 141 void onPrepareDraws(Target* target) override; |
140 | 142 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 GrBatchFontCache* fFontCache; | 220 GrBatchFontCache* fFontCache; |
219 | 221 |
220 // Distance field properties | 222 // Distance field properties |
221 SkAutoTUnref<const DistanceAdjustTable> fDistanceAdjustTable; | 223 SkAutoTUnref<const DistanceAdjustTable> fDistanceAdjustTable; |
222 SkColor fFilteredColor; | 224 SkColor fFilteredColor; |
223 | 225 |
224 typedef GrVertexBatch INHERITED; | 226 typedef GrVertexBatch INHERITED; |
225 }; | 227 }; |
226 | 228 |
227 #endif | 229 #endif |
OLD | NEW |