| 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 "GrBatch.h" | 10 #include "GrBatch.h" |
| (...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 954 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex
AttribType)); | 954 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex
AttribType)); |
| 955 fInDashParams = &this->addVertexAttrib(Attribute("inDashParams", kVec3f_GrVe
rtexAttribType)); | 955 fInDashParams = &this->addVertexAttrib(Attribute("inDashParams", kVec3f_GrVe
rtexAttribType)); |
| 956 fInCircleParams = &this->addVertexAttrib(Attribute("inCircleParams", | 956 fInCircleParams = &this->addVertexAttrib(Attribute("inCircleParams", |
| 957 kVec2f_GrVertexAttribType
)); | 957 kVec2f_GrVertexAttribType
)); |
| 958 } | 958 } |
| 959 | 959 |
| 960 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(DashingCircleEffect); | 960 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(DashingCircleEffect); |
| 961 | 961 |
| 962 GrGeometryProcessor* DashingCircleEffect::TestCreate(SkRandom* random, | 962 GrGeometryProcessor* DashingCircleEffect::TestCreate(SkRandom* random, |
| 963 GrContext*, | 963 GrContext*, |
| 964 const GrDrawTargetCaps& cap
s, | 964 const GrCaps& caps, |
| 965 GrTexture*[]) { | 965 GrTexture*[]) { |
| 966 DashAAMode aaMode = static_cast<DashAAMode>(random->nextULessThan(kDashAAMod
eCount)); | 966 DashAAMode aaMode = static_cast<DashAAMode>(random->nextULessThan(kDashAAMod
eCount)); |
| 967 return DashingCircleEffect::Create(GrRandomColor(random), | 967 return DashingCircleEffect::Create(GrRandomColor(random), |
| 968 aaMode, GrTest::TestMatrix(random), | 968 aaMode, GrTest::TestMatrix(random), |
| 969 random->nextBool()); | 969 random->nextBool()); |
| 970 } | 970 } |
| 971 | 971 |
| 972 ////////////////////////////////////////////////////////////////////////////// | 972 ////////////////////////////////////////////////////////////////////////////// |
| 973 | 973 |
| 974 class GLDashingLineEffect; | 974 class GLDashingLineEffect; |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1192 this->initClassID<DashingLineEffect>(); | 1192 this->initClassID<DashingLineEffect>(); |
| 1193 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex
AttribType)); | 1193 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex
AttribType)); |
| 1194 fInDashParams = &this->addVertexAttrib(Attribute("inDashParams", kVec3f_GrVe
rtexAttribType)); | 1194 fInDashParams = &this->addVertexAttrib(Attribute("inDashParams", kVec3f_GrVe
rtexAttribType)); |
| 1195 fInRectParams = &this->addVertexAttrib(Attribute("inRect", kVec4f_GrVertexAt
tribType)); | 1195 fInRectParams = &this->addVertexAttrib(Attribute("inRect", kVec4f_GrVertexAt
tribType)); |
| 1196 } | 1196 } |
| 1197 | 1197 |
| 1198 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(DashingLineEffect); | 1198 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(DashingLineEffect); |
| 1199 | 1199 |
| 1200 GrGeometryProcessor* DashingLineEffect::TestCreate(SkRandom* random, | 1200 GrGeometryProcessor* DashingLineEffect::TestCreate(SkRandom* random, |
| 1201 GrContext*, | 1201 GrContext*, |
| 1202 const GrDrawTargetCaps& caps, | 1202 const GrCaps& caps, |
| 1203 GrTexture*[]) { | 1203 GrTexture*[]) { |
| 1204 DashAAMode aaMode = static_cast<DashAAMode>(random->nextULessThan(kDashAAMod
eCount)); | 1204 DashAAMode aaMode = static_cast<DashAAMode>(random->nextULessThan(kDashAAMod
eCount)); |
| 1205 return DashingLineEffect::Create(GrRandomColor(random), | 1205 return DashingLineEffect::Create(GrRandomColor(random), |
| 1206 aaMode, GrTest::TestMatrix(random), random-
>nextBool()); | 1206 aaMode, GrTest::TestMatrix(random), random-
>nextBool()); |
| 1207 } | 1207 } |
| 1208 | 1208 |
| 1209 ////////////////////////////////////////////////////////////////////////////// | 1209 ////////////////////////////////////////////////////////////////////////////// |
| 1210 | 1210 |
| 1211 static GrGeometryProcessor* create_dash_gp(GrColor color, | 1211 static GrGeometryProcessor* create_dash_gp(GrColor color, |
| 1212 DashAAMode dashAAMode, | 1212 DashAAMode dashAAMode, |
| (...skipping 84 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 |