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 "GrBatch.h" | 10 #include "GrBatch.h" |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { | 267 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { |
268 // When this is called on a batch, there is only one geometry bundle | 268 // When this is called on a batch, there is only one geometry bundle |
269 out->setKnownFourComponents(fGeoData[0].fColor); | 269 out->setKnownFourComponents(fGeoData[0].fColor); |
270 } | 270 } |
271 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { | 271 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { |
272 out->setUnknownSingleComponent(); | 272 out->setUnknownSingleComponent(); |
273 } | 273 } |
274 | 274 |
275 void initBatchTracker(const GrPipelineInfo& init) override { | 275 void initBatchTracker(const GrPipelineInfo& init) override { |
276 // Handle any color overrides | 276 // Handle any color overrides |
277 if (init.fColorIgnored) { | 277 if (!init.readsColor()) { |
278 fGeoData[0].fColor = GrColor_ILLEGAL; | 278 fGeoData[0].fColor = GrColor_ILLEGAL; |
279 } else if (GrColor_ILLEGAL != init.fOverrideColor) { | |
280 fGeoData[0].fColor = init.fOverrideColor; | |
281 } | 279 } |
| 280 init.getOverrideColorIfSet(&fGeoData[0].fColor); |
282 | 281 |
283 // setup batch properties | 282 // setup batch properties |
284 fBatch.fColorIgnored = init.fColorIgnored; | 283 fBatch.fColorIgnored = !init.readsColor(); |
285 fBatch.fColor = fGeoData[0].fColor; | 284 fBatch.fColor = fGeoData[0].fColor; |
286 fBatch.fUsesLocalCoords = init.fUsesLocalCoords; | 285 fBatch.fUsesLocalCoords = init.readsLocalCoords(); |
287 fBatch.fCoverageIgnored = init.fCoverageIgnored; | 286 fBatch.fCoverageIgnored = !init.readsCoverage(); |
288 } | 287 } |
289 | 288 |
290 struct DashDraw { | 289 struct DashDraw { |
291 SkScalar fStartOffset; | 290 SkScalar fStartOffset; |
292 SkScalar fStrokeWidth; | 291 SkScalar fStrokeWidth; |
293 SkScalar fLineLength; | 292 SkScalar fLineLength; |
294 SkScalar fHalfDevStroke; | 293 SkScalar fHalfDevStroke; |
295 SkScalar fDevBloatX; | 294 SkScalar fDevBloatX; |
296 SkScalar fDevBloatY; | 295 SkScalar fDevBloatY; |
297 bool fLineDone; | 296 bool fLineDone; |
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1296 info.fIntervals = intervals; | 1295 info.fIntervals = intervals; |
1297 info.fCount = 2; | 1296 info.fCount = 2; |
1298 info.fPhase = phase; | 1297 info.fPhase = phase; |
1299 SkDEBUGCODE(bool success = ) strokeInfo.setDashInfo(info); | 1298 SkDEBUGCODE(bool success = ) strokeInfo.setDashInfo(info); |
1300 SkASSERT(success); | 1299 SkASSERT(success); |
1301 | 1300 |
1302 return create_batch(color, viewMatrix, pts, useAA, strokeInfo, msaaRT); | 1301 return create_batch(color, viewMatrix, pts, useAA, strokeInfo, msaaRT); |
1303 } | 1302 } |
1304 | 1303 |
1305 #endif | 1304 #endif |
OLD | NEW |