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.readsColor()) { | 277 if (init.fColorIgnored) { |
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; |
279 } | 281 } |
280 init.getOverrideColorIfSet(&fGeoData[0].fColor); | |
281 | 282 |
282 // setup batch properties | 283 // setup batch properties |
283 fBatch.fColorIgnored = !init.readsColor(); | 284 fBatch.fColorIgnored = init.fColorIgnored; |
284 fBatch.fColor = fGeoData[0].fColor; | 285 fBatch.fColor = fGeoData[0].fColor; |
285 fBatch.fUsesLocalCoords = init.readsLocalCoords(); | 286 fBatch.fUsesLocalCoords = init.fUsesLocalCoords; |
286 fBatch.fCoverageIgnored = !init.readsCoverage(); | 287 fBatch.fCoverageIgnored = init.fCoverageIgnored; |
287 } | 288 } |
288 | 289 |
289 struct DashDraw { | 290 struct DashDraw { |
290 SkScalar fStartOffset; | 291 SkScalar fStartOffset; |
291 SkScalar fStrokeWidth; | 292 SkScalar fStrokeWidth; |
292 SkScalar fLineLength; | 293 SkScalar fLineLength; |
293 SkScalar fHalfDevStroke; | 294 SkScalar fHalfDevStroke; |
294 SkScalar fDevBloatX; | 295 SkScalar fDevBloatX; |
295 SkScalar fDevBloatY; | 296 SkScalar fDevBloatY; |
296 bool fLineDone; | 297 bool fLineDone; |
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1295 info.fIntervals = intervals; | 1296 info.fIntervals = intervals; |
1296 info.fCount = 2; | 1297 info.fCount = 2; |
1297 info.fPhase = phase; | 1298 info.fPhase = phase; |
1298 SkDEBUGCODE(bool success = ) strokeInfo.setDashInfo(info); | 1299 SkDEBUGCODE(bool success = ) strokeInfo.setDashInfo(info); |
1299 SkASSERT(success); | 1300 SkASSERT(success); |
1300 | 1301 |
1301 return create_batch(color, viewMatrix, pts, useAA, strokeInfo, msaaRT); | 1302 return create_batch(color, viewMatrix, pts, useAA, strokeInfo, msaaRT); |
1302 } | 1303 } |
1303 | 1304 |
1304 #endif | 1305 #endif |
OLD | NEW |