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 "GrOvalRenderer.h" | 8 #include "GrOvalRenderer.h" |
9 | 9 |
10 #include "GrEffect.h" | 10 #include "GrEffect.h" |
11 #include "gl/GrGLEffect.h" | 11 #include "gl/GrGLEffect.h" |
12 #include "gl/GrGLSL.h" | 12 #include "gl/GrGLSL.h" |
13 #include "gl/GrGLVertexEffect.h" | 13 #include "gl/GrGLVertexEffect.h" |
14 #include "GrTBackendEffectFactory.h" | 14 #include "GrTBackendEffectFactory.h" |
15 | 15 |
16 #include "GrDrawState.h" | 16 #include "GrDrawState.h" |
17 #include "GrDrawTarget.h" | 17 #include "GrDrawTarget.h" |
18 #include "GrGpu.h" | 18 #include "GrGpu.h" |
19 | 19 |
20 #include "SkRRect.h" | 20 #include "SkRRect.h" |
21 #include "SkStrokeRec.h" | 21 #include "SkStrokeRec.h" |
22 | 22 |
23 #include "effects/GrVertexEffect.h" | 23 #include "effects/GrVertexEffect.h" |
24 | 24 |
25 SK_DEFINE_INST_COUNT(GrOvalRenderer) | |
26 | |
27 namespace { | 25 namespace { |
28 | 26 |
29 struct CircleVertex { | 27 struct CircleVertex { |
30 GrPoint fPos; | 28 GrPoint fPos; |
31 GrPoint fOffset; | 29 GrPoint fOffset; |
32 SkScalar fOuterRadius; | 30 SkScalar fOuterRadius; |
33 SkScalar fInnerRadius; | 31 SkScalar fInnerRadius; |
34 }; | 32 }; |
35 | 33 |
36 struct EllipseVertex { | 34 struct EllipseVertex { |
(...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1140 } | 1138 } |
1141 | 1139 |
1142 // drop out the middle quad if we're stroked | 1140 // drop out the middle quad if we're stroked |
1143 int indexCnt = isStroked ? GR_ARRAY_COUNT(gRRectIndices)-6 : GR_ARRAY_CO
UNT(gRRectIndices); | 1141 int indexCnt = isStroked ? GR_ARRAY_COUNT(gRRectIndices)-6 : GR_ARRAY_CO
UNT(gRRectIndices); |
1144 target->setIndexSourceToBuffer(indexBuffer); | 1142 target->setIndexSourceToBuffer(indexBuffer); |
1145 target->drawIndexed(kTriangles_GrPrimitiveType, 0, 0, 16, indexCnt, &bou
nds); | 1143 target->drawIndexed(kTriangles_GrPrimitiveType, 0, 0, 16, indexCnt, &bou
nds); |
1146 } | 1144 } |
1147 | 1145 |
1148 return true; | 1146 return true; |
1149 } | 1147 } |
OLD | NEW |