| 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 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 994 } | 994 } |
| 995 | 995 |
| 996 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(DashingCircleEffect); | 996 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(DashingCircleEffect); |
| 997 | 997 |
| 998 GrGeometryProcessor* DashingCircleEffect::TestCreate(SkRandom* random, | 998 GrGeometryProcessor* DashingCircleEffect::TestCreate(SkRandom* random, |
| 999 GrContext*, | 999 GrContext*, |
| 1000 const GrDrawTargetCaps& cap
s, | 1000 const GrDrawTargetCaps& cap
s, |
| 1001 GrTexture*[]) { | 1001 GrTexture*[]) { |
| 1002 DashAAMode aaMode = static_cast<DashAAMode>(random->nextULessThan(kDashAAMod
eCount)); | 1002 DashAAMode aaMode = static_cast<DashAAMode>(random->nextULessThan(kDashAAMod
eCount)); |
| 1003 return DashingCircleEffect::Create(GrRandomColor(random), | 1003 return DashingCircleEffect::Create(GrRandomColor(random), |
| 1004 aaMode, GrProcessorUnitTest::TestMatrix(ra
ndom)); | 1004 aaMode, GrTest::TestMatrix(random)); |
| 1005 } | 1005 } |
| 1006 | 1006 |
| 1007 ////////////////////////////////////////////////////////////////////////////// | 1007 ////////////////////////////////////////////////////////////////////////////// |
| 1008 | 1008 |
| 1009 class GLDashingLineEffect; | 1009 class GLDashingLineEffect; |
| 1010 | 1010 |
| 1011 struct DashingLineBatchTracker { | 1011 struct DashingLineBatchTracker { |
| 1012 GrGPInput fInputColorType; | 1012 GrGPInput fInputColorType; |
| 1013 GrColor fColor; | 1013 GrColor fColor; |
| 1014 bool fUsesLocalCoords; | 1014 bool fUsesLocalCoords; |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1253 } | 1253 } |
| 1254 | 1254 |
| 1255 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(DashingLineEffect); | 1255 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(DashingLineEffect); |
| 1256 | 1256 |
| 1257 GrGeometryProcessor* DashingLineEffect::TestCreate(SkRandom* random, | 1257 GrGeometryProcessor* DashingLineEffect::TestCreate(SkRandom* random, |
| 1258 GrContext*, | 1258 GrContext*, |
| 1259 const GrDrawTargetCaps& caps, | 1259 const GrDrawTargetCaps& caps, |
| 1260 GrTexture*[]) { | 1260 GrTexture*[]) { |
| 1261 DashAAMode aaMode = static_cast<DashAAMode>(random->nextULessThan(kDashAAMod
eCount)); | 1261 DashAAMode aaMode = static_cast<DashAAMode>(random->nextULessThan(kDashAAMod
eCount)); |
| 1262 return DashingLineEffect::Create(GrRandomColor(random), | 1262 return DashingLineEffect::Create(GrRandomColor(random), |
| 1263 aaMode, GrProcessorUnitTest::TestMatrix(ran
dom)); | 1263 aaMode, GrTest::TestMatrix(random)); |
| 1264 } | 1264 } |
| 1265 | 1265 |
| 1266 ////////////////////////////////////////////////////////////////////////////// | 1266 ////////////////////////////////////////////////////////////////////////////// |
| 1267 | 1267 |
| 1268 static GrGeometryProcessor* create_dash_gp(GrColor color, | 1268 static GrGeometryProcessor* create_dash_gp(GrColor color, |
| 1269 DashAAMode dashAAMode, | 1269 DashAAMode dashAAMode, |
| 1270 DashCap cap, | 1270 DashCap cap, |
| 1271 const SkMatrix& localMatrix) { | 1271 const SkMatrix& localMatrix) { |
| 1272 switch (cap) { | 1272 switch (cap) { |
| 1273 case kRound_DashCap: | 1273 case kRound_DashCap: |
| 1274 return DashingCircleEffect::Create(color, dashAAMode, localMatrix); | 1274 return DashingCircleEffect::Create(color, dashAAMode, localMatrix); |
| 1275 case kNonRound_DashCap: | 1275 case kNonRound_DashCap: |
| 1276 return DashingLineEffect::Create(color, dashAAMode, localMatrix); | 1276 return DashingLineEffect::Create(color, dashAAMode, localMatrix); |
| 1277 default: | 1277 default: |
| 1278 SkFAIL("Unexpected dashed cap."); | 1278 SkFAIL("Unexpected dashed cap."); |
| 1279 } | 1279 } |
| 1280 return NULL; | 1280 return NULL; |
| 1281 } | 1281 } |
| OLD | NEW |