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 #include "GrDashingEffect.h" | 8 #include "GrDashingEffect.h" |
9 | 9 |
10 #include "GrBatchFlushState.h" | 10 #include "GrBatchFlushState.h" |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 GrColor fColor; | 262 GrColor fColor; |
263 }; | 263 }; |
264 | 264 |
265 static GrDrawBatch* Create(const Geometry& geometry, SkPaint::Cap cap, DashA
AMode aaMode, | 265 static GrDrawBatch* Create(const Geometry& geometry, SkPaint::Cap cap, DashA
AMode aaMode, |
266 bool fullDash) { | 266 bool fullDash) { |
267 return new DashBatch(geometry, cap, aaMode, fullDash); | 267 return new DashBatch(geometry, cap, aaMode, fullDash); |
268 } | 268 } |
269 | 269 |
270 const char* name() const override { return "DashBatch"; } | 270 const char* name() const override { return "DashBatch"; } |
271 | 271 |
272 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { | 272 void computeBatchToXPOverrides(GrInitInvariantOutput* color, GrInitInvariant
Output* coverage, |
| 273 bool* usePLSDstRead) const { |
273 // When this is called on a batch, there is only one geometry bundle | 274 // When this is called on a batch, there is only one geometry bundle |
274 out->setKnownFourComponents(fGeoData[0].fColor); | 275 color->setKnownFourComponents(fGeoData[0].fColor); |
275 } | 276 coverage->setUnknownSingleComponent(); |
276 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { | 277 *usePLSDstRead = false; |
277 out->setUnknownSingleComponent(); | |
278 } | 278 } |
279 | 279 |
280 SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; } | 280 SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; } |
281 | 281 |
282 private: | 282 private: |
283 DashBatch(const Geometry& geometry, SkPaint::Cap cap, DashAAMode aaMode, boo
l fullDash) | 283 DashBatch(const Geometry& geometry, SkPaint::Cap cap, DashAAMode aaMode, boo
l fullDash) |
284 : INHERITED(ClassID()) { | 284 : INHERITED(ClassID()) { |
285 fGeoData.push_back(geometry); | 285 fGeoData.push_back(geometry); |
286 | 286 |
287 fBatch.fAAMode = aaMode; | 287 fBatch.fAAMode = aaMode; |
(...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1296 info.fIntervals = intervals; | 1296 info.fIntervals = intervals; |
1297 info.fCount = 2; | 1297 info.fCount = 2; |
1298 info.fPhase = phase; | 1298 info.fPhase = phase; |
1299 SkDEBUGCODE(bool success = ) strokeInfo.setDashInfo(info); | 1299 SkDEBUGCODE(bool success = ) strokeInfo.setDashInfo(info); |
1300 SkASSERT(success); | 1300 SkASSERT(success); |
1301 | 1301 |
1302 return create_batch(color, viewMatrix, pts, useAA, strokeInfo, msaaRT); | 1302 return create_batch(color, viewMatrix, pts, useAA, strokeInfo, msaaRT); |
1303 } | 1303 } |
1304 | 1304 |
1305 #endif | 1305 #endif |
OLD | NEW |