| 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 "GrBatchFlushState.h" | 10 #include "GrBatchFlushState.h" |
| (...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 953 , fAAMode(aaMode) { | 953 , fAAMode(aaMode) { |
| 954 this->initClassID<DashingCircleEffect>(); | 954 this->initClassID<DashingCircleEffect>(); |
| 955 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex
AttribType)); | 955 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex
AttribType)); |
| 956 fInDashParams = &this->addVertexAttrib(Attribute("inDashParams", kVec3f_GrVe
rtexAttribType)); | 956 fInDashParams = &this->addVertexAttrib(Attribute("inDashParams", kVec3f_GrVe
rtexAttribType)); |
| 957 fInCircleParams = &this->addVertexAttrib(Attribute("inCircleParams", | 957 fInCircleParams = &this->addVertexAttrib(Attribute("inCircleParams", |
| 958 kVec2f_GrVertexAttribType
)); | 958 kVec2f_GrVertexAttribType
)); |
| 959 } | 959 } |
| 960 | 960 |
| 961 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(DashingCircleEffect); | 961 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(DashingCircleEffect); |
| 962 | 962 |
| 963 const GrGeometryProcessor* DashingCircleEffect::TestCreate(GrProcessorTestData*
d) { | 963 GrGeometryProcessor* DashingCircleEffect::TestCreate(GrProcessorTestData* d) { |
| 964 DashAAMode aaMode = static_cast<DashAAMode>(d->fRandom->nextULessThan(kDashA
AModeCount)); | 964 DashAAMode aaMode = static_cast<DashAAMode>(d->fRandom->nextULessThan(kDashA
AModeCount)); |
| 965 return DashingCircleEffect::Create(GrRandomColor(d->fRandom), | 965 return DashingCircleEffect::Create(GrRandomColor(d->fRandom), |
| 966 aaMode, GrTest::TestMatrix(d->fRandom), | 966 aaMode, GrTest::TestMatrix(d->fRandom), |
| 967 d->fRandom->nextBool()); | 967 d->fRandom->nextBool()); |
| 968 } | 968 } |
| 969 | 969 |
| 970 ////////////////////////////////////////////////////////////////////////////// | 970 ////////////////////////////////////////////////////////////////////////////// |
| 971 | 971 |
| 972 class GLDashingLineEffect; | 972 class GLDashingLineEffect; |
| 973 | 973 |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1188 , fUsesLocalCoords(usesLocalCoords) | 1188 , fUsesLocalCoords(usesLocalCoords) |
| 1189 , fAAMode(aaMode) { | 1189 , fAAMode(aaMode) { |
| 1190 this->initClassID<DashingLineEffect>(); | 1190 this->initClassID<DashingLineEffect>(); |
| 1191 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex
AttribType)); | 1191 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex
AttribType)); |
| 1192 fInDashParams = &this->addVertexAttrib(Attribute("inDashParams", kVec3f_GrVe
rtexAttribType)); | 1192 fInDashParams = &this->addVertexAttrib(Attribute("inDashParams", kVec3f_GrVe
rtexAttribType)); |
| 1193 fInRectParams = &this->addVertexAttrib(Attribute("inRect", kVec4f_GrVertexAt
tribType)); | 1193 fInRectParams = &this->addVertexAttrib(Attribute("inRect", kVec4f_GrVertexAt
tribType)); |
| 1194 } | 1194 } |
| 1195 | 1195 |
| 1196 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(DashingLineEffect); | 1196 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(DashingLineEffect); |
| 1197 | 1197 |
| 1198 const GrGeometryProcessor* DashingLineEffect::TestCreate(GrProcessorTestData* d)
{ | 1198 GrGeometryProcessor* DashingLineEffect::TestCreate(GrProcessorTestData* d) { |
| 1199 DashAAMode aaMode = static_cast<DashAAMode>(d->fRandom->nextULessThan(kDashA
AModeCount)); | 1199 DashAAMode aaMode = static_cast<DashAAMode>(d->fRandom->nextULessThan(kDashA
AModeCount)); |
| 1200 return DashingLineEffect::Create(GrRandomColor(d->fRandom), | 1200 return DashingLineEffect::Create(GrRandomColor(d->fRandom), |
| 1201 aaMode, GrTest::TestMatrix(d->fRandom), | 1201 aaMode, GrTest::TestMatrix(d->fRandom), |
| 1202 d->fRandom->nextBool()); | 1202 d->fRandom->nextBool()); |
| 1203 } | 1203 } |
| 1204 | 1204 |
| 1205 ////////////////////////////////////////////////////////////////////////////// | 1205 ////////////////////////////////////////////////////////////////////////////// |
| 1206 | 1206 |
| 1207 static GrGeometryProcessor* create_dash_gp(GrColor color, | 1207 static GrGeometryProcessor* create_dash_gp(GrColor color, |
| 1208 DashAAMode dashAAMode, | 1208 DashAAMode dashAAMode, |
| (...skipping 88 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 |