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 "../GrAARectRenderer.h" | 10 #include "../GrAARectRenderer.h" |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 devIntervals[1], strokeWidth, capType, gp->getVert
exStride()); | 506 devIntervals[1], strokeWidth, capType, gp->getVert
exStride()); |
507 } else { | 507 } else { |
508 SkPoint* verts = reinterpret_cast<SkPoint*>(geo.vertices()); | 508 SkPoint* verts = reinterpret_cast<SkPoint*>(geo.vertices()); |
509 SkASSERT(gp->getVertexStride() == sizeof(SkPoint)); | 509 SkASSERT(gp->getVertexStride() == sizeof(SkPoint)); |
510 setup_dashed_rect_pos(endRect, curVIdx, combinedMatrix, verts); | 510 setup_dashed_rect_pos(endRect, curVIdx, combinedMatrix, verts); |
511 } | 511 } |
512 | 512 |
513 } | 513 } |
514 | 514 |
515 target->setIndexSourceToBuffer(gpu->getContext()->getQuadIndexBuffer()); | 515 target->setIndexSourceToBuffer(gpu->getContext()->getQuadIndexBuffer()); |
516 target->drawIndexedInstances(pipelineBuilder, gp, kTriangles_GrPrimitiveType
, | 516 target->drawIndexedInstances(pipelineBuilder, gp, kTriangles_GrPrimitiveType
, totalRectCnt, |
517 totalRectCnt, 4, 6); | 517 4, 6); |
518 target->resetIndexSource(); | 518 target->resetIndexSource(); |
519 return true; | 519 return true; |
520 } | 520 } |
521 | 521 |
522 ////////////////////////////////////////////////////////////////////////////// | 522 ////////////////////////////////////////////////////////////////////////////// |
523 | 523 |
524 class GLDashingCircleEffect; | 524 class GLDashingCircleEffect; |
525 | 525 |
526 struct DashingCircleBatchTracker { | 526 struct DashingCircleBatchTracker { |
527 GrGPInput fInputColorType; | 527 GrGPInput fInputColorType; |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1030 switch (cap) { | 1030 switch (cap) { |
1031 case kRound_DashCap: | 1031 case kRound_DashCap: |
1032 return DashingCircleEffect::Create(color, edgeType, localMatrix); | 1032 return DashingCircleEffect::Create(color, edgeType, localMatrix); |
1033 case kNonRound_DashCap: | 1033 case kNonRound_DashCap: |
1034 return DashingLineEffect::Create(color, edgeType, localMatrix); | 1034 return DashingLineEffect::Create(color, edgeType, localMatrix); |
1035 default: | 1035 default: |
1036 SkFAIL("Unexpected dashed cap."); | 1036 SkFAIL("Unexpected dashed cap."); |
1037 } | 1037 } |
1038 return NULL; | 1038 return NULL; |
1039 } | 1039 } |
OLD | NEW |