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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 /** | 153 /** |
154 * Returns true if isOpaque would return true and the paint represents a sol
id constant color | 154 * Returns true if isOpaque would return true and the paint represents a sol
id constant color |
155 * draw. If the result is true, constantColor will be updated to contain the
constant color. | 155 * draw. If the result is true, constantColor will be updated to contain the
constant color. |
156 */ | 156 */ |
157 bool isOpaqueAndConstantColor(GrColor* constantColor) const; | 157 bool isOpaqueAndConstantColor(GrColor* constantColor) const; |
158 | 158 |
159 /** | 159 /** |
160 * DO NOT USE THESE | 160 * DO NOT USE THESE |
161 * TODO Remove remaining use cases and delete these | 161 * TODO Remove remaining use cases and delete these |
162 */ | 162 */ |
163 void localCoordChange(const SkMatrix& oldToNew) { | |
164 for (int i = 0; i < fColorStages.count(); ++i) { | |
165 fColorStages[i].localCoordChange(oldToNew); | |
166 } | |
167 for (int i = 0; i < fCoverageStages.count(); ++i) { | |
168 fCoverageStages[i].localCoordChange(oldToNew); | |
169 } | |
170 } | |
171 | |
172 bool localCoordChangeInverse(const SkMatrix& newToOld) { | 163 bool localCoordChangeInverse(const SkMatrix& newToOld) { |
173 SkMatrix oldToNew; | 164 SkMatrix oldToNew; |
174 bool computed = false; | 165 bool computed = false; |
175 for (int i = 0; i < fColorStages.count(); ++i) { | 166 for (int i = 0; i < fColorStages.count(); ++i) { |
176 if (!computed && !newToOld.invert(&oldToNew)) { | 167 if (!computed && !newToOld.invert(&oldToNew)) { |
177 return false; | 168 return false; |
178 } else { | 169 } else { |
179 computed = true; | 170 computed = true; |
180 } | 171 } |
181 fColorStages[i].localCoordChange(oldToNew); | 172 fColorStages[i].localCoordChange(oldToNew); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 } | 206 } |
216 | 207 |
217 void resetColor() { | 208 void resetColor() { |
218 fColor = GrColorPackRGBA(0xff, 0xff, 0xff, 0xff); | 209 fColor = GrColorPackRGBA(0xff, 0xff, 0xff, 0xff); |
219 } | 210 } |
220 | 211 |
221 void resetStages(); | 212 void resetStages(); |
222 }; | 213 }; |
223 | 214 |
224 #endif | 215 #endif |
OLD | NEW |