| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 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 #include "GrAAConvexPathRenderer.h" | 9 #include "GrAAConvexPathRenderer.h" |
| 10 | 10 |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 "clamp(0.5 - edgeAlpha / length(gF), 0.0, 1.0
);}"); | 568 "clamp(0.5 - edgeAlpha / length(gF), 0.0, 1.0
);}"); |
| 569 | 569 |
| 570 fsBuilder->codeAppendf("%s = vec4(edgeAlpha);", args.fOutputCoverage
); | 570 fsBuilder->codeAppendf("%s = vec4(edgeAlpha);", args.fOutputCoverage
); |
| 571 } | 571 } |
| 572 | 572 |
| 573 static inline void GenKey(const GrGeometryProcessor& gp, | 573 static inline void GenKey(const GrGeometryProcessor& gp, |
| 574 const GrBatchTracker& bt, | 574 const GrBatchTracker& bt, |
| 575 const GrGLCaps&, | 575 const GrGLCaps&, |
| 576 GrProcessorKeyBuilder* b) { | 576 GrProcessorKeyBuilder* b) { |
| 577 const BatchTracker& local = bt.cast<BatchTracker>(); | 577 const BatchTracker& local = bt.cast<BatchTracker>(); |
| 578 b->add32(local.fInputColorType); | 578 b->add32((local.fInputColorType << 16) | |
| 579 (local.fUsesLocalCoords && gp.localMatrix().hasPerspective(
) ? 0x1 : 0x0)); |
| 579 } | 580 } |
| 580 | 581 |
| 581 virtual void setData(const GrGLProgramDataManager& pdman, | 582 virtual void setData(const GrGLProgramDataManager& pdman, |
| 582 const GrPrimitiveProcessor& gp, | 583 const GrPrimitiveProcessor& gp, |
| 583 const GrBatchTracker& bt) SK_OVERRIDE { | 584 const GrBatchTracker& bt) SK_OVERRIDE { |
| 584 const BatchTracker& local = bt.cast<BatchTracker>(); | 585 const BatchTracker& local = bt.cast<BatchTracker>(); |
| 585 if (kUniform_GrGPInput == local.fInputColorType && local.fColor != f
Color) { | 586 if (kUniform_GrGPInput == local.fInputColorType && local.fColor != f
Color) { |
| 586 GrGLfloat c[4]; | 587 GrGLfloat c[4]; |
| 587 GrColorToRGBAFloat(local.fColor, c); | 588 GrColorToRGBAFloat(local.fColor, c); |
| 588 pdman.set4fv(fColorUniform, 1, c); | 589 pdman.set4fv(fColorUniform, 1, c); |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 758 vOffset, // start vertex | 759 vOffset, // start vertex |
| 759 0, // start index | 760 0, // start index |
| 760 draw.fVertexCnt, | 761 draw.fVertexCnt, |
| 761 draw.fIndexCnt, | 762 draw.fIndexCnt, |
| 762 &devBounds); | 763 &devBounds); |
| 763 vOffset += draw.fVertexCnt; | 764 vOffset += draw.fVertexCnt; |
| 764 } | 765 } |
| 765 | 766 |
| 766 return true; | 767 return true; |
| 767 } | 768 } |
| OLD | NEW |