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, |
| 204 kHigh_GrSLPrecision)); |
204 fInConicCoeffs = &this->addVertexAttrib(Attribute("inConicCoeffs", | 205 fInConicCoeffs = &this->addVertexAttrib(Attribute("inConicCoeffs", |
205 kVec4f_GrVertexAttribType)
); | 206 kVec4f_GrVertexAttribType)
); |
206 } | 207 } |
207 | 208 |
208 ////////////////////////////////////////////////////////////////////////////// | 209 ////////////////////////////////////////////////////////////////////////////// |
209 | 210 |
210 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrConicEffect); | 211 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrConicEffect); |
211 | 212 |
212 GrGeometryProcessor* GrConicEffect::TestCreate(SkRandom* random, | 213 GrGeometryProcessor* GrConicEffect::TestCreate(SkRandom* random, |
213 GrContext*, | 214 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, | 395 GrQuadEffect::GrQuadEffect(GrColor color, const SkMatrix& viewMatrix, uint8_t co
verage, |
395 GrPrimitiveEdgeType edgeType, const SkMatrix& localMa
trix, | 396 GrPrimitiveEdgeType edgeType, const SkMatrix& localMa
trix, |
396 bool usesLocalCoords) | 397 bool usesLocalCoords) |
397 : fColor(color) | 398 : fColor(color) |
398 , fViewMatrix(viewMatrix) | 399 , fViewMatrix(viewMatrix) |
399 , fLocalMatrix(localMatrix) | 400 , fLocalMatrix(localMatrix) |
400 , fUsesLocalCoords(usesLocalCoords) | 401 , fUsesLocalCoords(usesLocalCoords) |
401 , fCoverageScale(coverage) | 402 , fCoverageScale(coverage) |
402 , fEdgeType(edgeType) { | 403 , fEdgeType(edgeType) { |
403 this->initClassID<GrQuadEffect>(); | 404 this->initClassID<GrQuadEffect>(); |
404 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex
AttribType)); | 405 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex
AttribType, |
| 406 kHigh_GrSLPrecision)); |
405 fInHairQuadEdge = &this->addVertexAttrib(Attribute("inHairQuadEdge", | 407 fInHairQuadEdge = &this->addVertexAttrib(Attribute("inHairQuadEdge", |
406 kVec4f_GrVertexAttribTyp
e)); | 408 kVec4f_GrVertexAttribTyp
e)); |
407 } | 409 } |
408 | 410 |
409 ////////////////////////////////////////////////////////////////////////////// | 411 ////////////////////////////////////////////////////////////////////////////// |
410 | 412 |
411 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrQuadEffect); | 413 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrQuadEffect); |
412 | 414 |
413 GrGeometryProcessor* GrQuadEffect::TestCreate(SkRandom* random, | 415 GrGeometryProcessor* GrQuadEffect::TestCreate(SkRandom* random, |
414 GrContext*, | 416 GrContext*, |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 const GrGLSLCaps&) const
{ | 609 const GrGLSLCaps&) const
{ |
608 return SkNEW_ARGS(GrGLCubicEffect, (*this, bt)); | 610 return SkNEW_ARGS(GrGLCubicEffect, (*this, bt)); |
609 } | 611 } |
610 | 612 |
611 GrCubicEffect::GrCubicEffect(GrColor color, const SkMatrix& viewMatrix, | 613 GrCubicEffect::GrCubicEffect(GrColor color, const SkMatrix& viewMatrix, |
612 GrPrimitiveEdgeType edgeType) | 614 GrPrimitiveEdgeType edgeType) |
613 : fColor(color) | 615 : fColor(color) |
614 , fViewMatrix(viewMatrix) | 616 , fViewMatrix(viewMatrix) |
615 , fEdgeType(edgeType) { | 617 , fEdgeType(edgeType) { |
616 this->initClassID<GrCubicEffect>(); | 618 this->initClassID<GrCubicEffect>(); |
617 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex
AttribType)); | 619 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex
AttribType, |
| 620 kHigh_GrSLPrecision)); |
618 fInCubicCoeffs = &this->addVertexAttrib(Attribute("inCubicCoeffs", | 621 fInCubicCoeffs = &this->addVertexAttrib(Attribute("inCubicCoeffs", |
619 kVec4f_GrVertexAttribTyp
e)); | 622 kVec4f_GrVertexAttribTyp
e)); |
620 } | 623 } |
621 | 624 |
622 ////////////////////////////////////////////////////////////////////////////// | 625 ////////////////////////////////////////////////////////////////////////////// |
623 | 626 |
624 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrCubicEffect); | 627 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrCubicEffect); |
625 | 628 |
626 GrGeometryProcessor* GrCubicEffect::TestCreate(SkRandom* random, | 629 GrGeometryProcessor* GrCubicEffect::TestCreate(SkRandom* random, |
627 GrContext*, | 630 GrContext*, |
628 const GrCaps& caps, | 631 const GrCaps& caps, |
629 GrTexture*[]) { | 632 GrTexture*[]) { |
630 GrGeometryProcessor* gp; | 633 GrGeometryProcessor* gp; |
631 do { | 634 do { |
632 GrPrimitiveEdgeType edgeType = static_cast<GrPrimitiveEdgeType>( | 635 GrPrimitiveEdgeType edgeType = static_cast<GrPrimitiveEdgeType>( |
633 random->nextULessThan(kGrPro
cessorEdgeTypeCnt)); | 636 random->nextULessThan(kGrPro
cessorEdgeTypeCnt)); |
634 gp = GrCubicEffect::Create(GrRandomColor(random), | 637 gp = GrCubicEffect::Create(GrRandomColor(random), |
635 GrTest::TestMatrix(random), edgeType, caps); | 638 GrTest::TestMatrix(random), edgeType, caps); |
636 } while (NULL == gp); | 639 } while (NULL == gp); |
637 return gp; | 640 return gp; |
638 } | 641 } |
639 | 642 |
OLD | NEW |