OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #ifndef GrPaint_DEFINED | 10 #ifndef GrPaint_DEFINED |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 this->resetColor(); | 140 this->resetColor(); |
141 this->resetStages(); | 141 this->resetStages(); |
142 } | 142 } |
143 | 143 |
144 /** | 144 /** |
145 * Returns true if isOpaque would return true and the paint represents a sol
id constant color | 145 * Returns true if isOpaque would return true and the paint represents a sol
id constant color |
146 * draw. If the result is true, constantColor will be updated to contain the
constant color. | 146 * draw. If the result is true, constantColor will be updated to contain the
constant color. |
147 */ | 147 */ |
148 bool isOpaqueAndConstantColor(GrColor* constantColor) const; | 148 bool isOpaqueAndConstantColor(GrColor* constantColor) const; |
149 | 149 |
150 /** | |
151 * DO NOT USE THESE | |
152 * TODO Remove remaining use cases and delete these | |
153 */ | |
154 bool localCoordChangeInverse(const SkMatrix& newToOld) { | |
155 SkMatrix oldToNew; | |
156 bool computed = false; | |
157 for (int i = 0; i < fColorStages.count(); ++i) { | |
158 if (!computed && !newToOld.invert(&oldToNew)) { | |
159 return false; | |
160 } else { | |
161 computed = true; | |
162 } | |
163 fColorStages[i].localCoordChange(oldToNew); | |
164 } | |
165 for (int i = 0; i < fCoverageStages.count(); ++i) { | |
166 if (!computed && !newToOld.invert(&oldToNew)) { | |
167 return false; | |
168 } else { | |
169 computed = true; | |
170 } | |
171 fCoverageStages[i].localCoordChange(oldToNew); | |
172 } | |
173 return true; | |
174 } | |
175 | |
176 private: | 150 private: |
177 friend class GrContext; // To access above two functions | 151 friend class GrContext; // To access above two functions |
178 friend class GrStencilAndCoverTextContext; // To access above two functions | 152 friend class GrStencilAndCoverTextContext; // To access above two functions |
179 | 153 |
180 SkAutoTUnref<const GrXPFactory> fXPFactory; | 154 SkAutoTUnref<const GrXPFactory> fXPFactory; |
181 SkSTArray<4, GrFragmentStage> fColorStages; | 155 SkSTArray<4, GrFragmentStage> fColorStages; |
182 SkSTArray<2, GrFragmentStage> fCoverageStages; | 156 SkSTArray<2, GrFragmentStage> fCoverageStages; |
183 | 157 |
184 bool fAntiAlias; | 158 bool fAntiAlias; |
185 bool fDither; | 159 bool fDither; |
186 | 160 |
187 GrColor fColor; | 161 GrColor fColor; |
188 | 162 |
189 void resetOptions() { | 163 void resetOptions() { |
190 fAntiAlias = false; | 164 fAntiAlias = false; |
191 fDither = false; | 165 fDither = false; |
192 } | 166 } |
193 | 167 |
194 void resetColor() { | 168 void resetColor() { |
195 fColor = GrColorPackRGBA(0xff, 0xff, 0xff, 0xff); | 169 fColor = GrColorPackRGBA(0xff, 0xff, 0xff, 0xff); |
196 } | 170 } |
197 | 171 |
198 void resetStages(); | 172 void resetStages(); |
199 }; | 173 }; |
200 | 174 |
201 #endif | 175 #endif |
OLD | NEW |