Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "GrBezierEffect.h" | 8 #include "GrBezierEffect.h" |
| 9 | 9 |
| 10 #include "gl/GrGLProcessor.h" | 10 #include "gl/GrGLProcessor.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 193 GrConicEffect::GrConicEffect(GrColor color, const SkMatrix& viewMatrix, uint8_t coverage, | 193 GrConicEffect::GrConicEffect(GrColor color, const SkMatrix& viewMatrix, uint8_t coverage, |
| 194 GrPrimitiveEdgeType edgeType, const SkMatrix& local Matrix, | 194 GrPrimitiveEdgeType edgeType, const SkMatrix& local Matrix, |
| 195 bool usesLocalCoords) | 195 bool usesLocalCoords) |
| 196 : fColor(color) | 196 : fColor(color) |
| 197 , fViewMatrix(viewMatrix) | 197 , fViewMatrix(viewMatrix) |
| 198 , fLocalMatrix(viewMatrix) | 198 , fLocalMatrix(viewMatrix) |
| 199 , fUsesLocalCoords(usesLocalCoords) | 199 , fUsesLocalCoords(usesLocalCoords) |
| 200 , fCoverageScale(coverage) | 200 , fCoverageScale(coverage) |
| 201 , fEdgeType(edgeType) { | 201 , fEdgeType(edgeType) { |
| 202 this->initClassID<GrConicEffect>(); | 202 this->initClassID<GrConicEffect>(); |
| 203 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex AttribType)); | 203 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex AttribType, kHigh_GrSLPrecision)); |
|
joshualitt
2015/05/20 20:36:11
newline
Stephen White
2015/05/20 20:47:43
Done.
| |
| 204 fInConicCoeffs = &this->addVertexAttrib(Attribute("inConicCoeffs", | 204 fInConicCoeffs = &this->addVertexAttrib(Attribute("inConicCoeffs", |
| 205 kVec4f_GrVertexAttribType) ); | 205 kVec4f_GrVertexAttribType) ); |
| 206 } | 206 } |
| 207 | 207 |
| 208 ////////////////////////////////////////////////////////////////////////////// | 208 ////////////////////////////////////////////////////////////////////////////// |
| 209 | 209 |
| 210 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrConicEffect); | 210 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrConicEffect); |
| 211 | 211 |
| 212 GrGeometryProcessor* GrConicEffect::TestCreate(SkRandom* random, | 212 GrGeometryProcessor* GrConicEffect::TestCreate(SkRandom* random, |
| 213 GrContext*, | 213 GrContext*, |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 394 GrQuadEffect::GrQuadEffect(GrColor color, const SkMatrix& viewMatrix, uint8_t co verage, | 394 GrQuadEffect::GrQuadEffect(GrColor color, const SkMatrix& viewMatrix, uint8_t co verage, |
| 395 GrPrimitiveEdgeType edgeType, const SkMatrix& localMa trix, | 395 GrPrimitiveEdgeType edgeType, const SkMatrix& localMa trix, |
| 396 bool usesLocalCoords) | 396 bool usesLocalCoords) |
| 397 : fColor(color) | 397 : fColor(color) |
| 398 , fViewMatrix(viewMatrix) | 398 , fViewMatrix(viewMatrix) |
| 399 , fLocalMatrix(localMatrix) | 399 , fLocalMatrix(localMatrix) |
| 400 , fUsesLocalCoords(usesLocalCoords) | 400 , fUsesLocalCoords(usesLocalCoords) |
| 401 , fCoverageScale(coverage) | 401 , fCoverageScale(coverage) |
| 402 , fEdgeType(edgeType) { | 402 , fEdgeType(edgeType) { |
| 403 this->initClassID<GrQuadEffect>(); | 403 this->initClassID<GrQuadEffect>(); |
| 404 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex AttribType)); | 404 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex AttribType, kHigh_GrSLPrecision)); |
|
joshualitt
2015/05/20 20:36:10
newline
Stephen White
2015/05/20 20:47:43
Done.
| |
| 405 fInHairQuadEdge = &this->addVertexAttrib(Attribute("inHairQuadEdge", | 405 fInHairQuadEdge = &this->addVertexAttrib(Attribute("inHairQuadEdge", |
| 406 kVec4f_GrVertexAttribTyp e)); | 406 kVec4f_GrVertexAttribTyp e)); |
| 407 } | 407 } |
| 408 | 408 |
| 409 ////////////////////////////////////////////////////////////////////////////// | 409 ////////////////////////////////////////////////////////////////////////////// |
| 410 | 410 |
| 411 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrQuadEffect); | 411 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrQuadEffect); |
| 412 | 412 |
| 413 GrGeometryProcessor* GrQuadEffect::TestCreate(SkRandom* random, | 413 GrGeometryProcessor* GrQuadEffect::TestCreate(SkRandom* random, |
| 414 GrContext*, | 414 GrContext*, |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 607 const GrGLSLCaps&) const { | 607 const GrGLSLCaps&) const { |
| 608 return SkNEW_ARGS(GrGLCubicEffect, (*this, bt)); | 608 return SkNEW_ARGS(GrGLCubicEffect, (*this, bt)); |
| 609 } | 609 } |
| 610 | 610 |
| 611 GrCubicEffect::GrCubicEffect(GrColor color, const SkMatrix& viewMatrix, | 611 GrCubicEffect::GrCubicEffect(GrColor color, const SkMatrix& viewMatrix, |
| 612 GrPrimitiveEdgeType edgeType) | 612 GrPrimitiveEdgeType edgeType) |
| 613 : fColor(color) | 613 : fColor(color) |
| 614 , fViewMatrix(viewMatrix) | 614 , fViewMatrix(viewMatrix) |
| 615 , fEdgeType(edgeType) { | 615 , fEdgeType(edgeType) { |
| 616 this->initClassID<GrCubicEffect>(); | 616 this->initClassID<GrCubicEffect>(); |
| 617 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex AttribType)); | 617 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex AttribType, kHigh_GrSLPrecision)); |
|
joshualitt
2015/05/20 20:36:10
newline
Stephen White
2015/05/20 20:47:43
Done.
| |
| 618 fInCubicCoeffs = &this->addVertexAttrib(Attribute("inCubicCoeffs", | 618 fInCubicCoeffs = &this->addVertexAttrib(Attribute("inCubicCoeffs", |
| 619 kVec4f_GrVertexAttribTyp e)); | 619 kVec4f_GrVertexAttribTyp e)); |
| 620 } | 620 } |
| 621 | 621 |
| 622 ////////////////////////////////////////////////////////////////////////////// | 622 ////////////////////////////////////////////////////////////////////////////// |
| 623 | 623 |
| 624 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrCubicEffect); | 624 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrCubicEffect); |
| 625 | 625 |
| 626 GrGeometryProcessor* GrCubicEffect::TestCreate(SkRandom* random, | 626 GrGeometryProcessor* GrCubicEffect::TestCreate(SkRandom* random, |
| 627 GrContext*, | 627 GrContext*, |
| 628 const GrCaps& caps, | 628 const GrCaps& caps, |
| 629 GrTexture*[]) { | 629 GrTexture*[]) { |
| 630 GrGeometryProcessor* gp; | 630 GrGeometryProcessor* gp; |
| 631 do { | 631 do { |
| 632 GrPrimitiveEdgeType edgeType = static_cast<GrPrimitiveEdgeType>( | 632 GrPrimitiveEdgeType edgeType = static_cast<GrPrimitiveEdgeType>( |
| 633 random->nextULessThan(kGrPro cessorEdgeTypeCnt)); | 633 random->nextULessThan(kGrPro cessorEdgeTypeCnt)); |
| 634 gp = GrCubicEffect::Create(GrRandomColor(random), | 634 gp = GrCubicEffect::Create(GrRandomColor(random), |
| 635 GrTest::TestMatrix(random), edgeType, caps); | 635 GrTest::TestMatrix(random), edgeType, caps); |
| 636 } while (NULL == gp); | 636 } while (NULL == gp); |
| 637 return gp; | 637 return gp; |
| 638 } | 638 } |
| 639 | 639 |
| OLD | NEW |