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