| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #include "SkTwoPointConicalGradient_gpu.h" | 9 #include "SkTwoPointConicalGradient_gpu.h" |
| 10 | 10 |
| 11 #include "SkTwoPointConicalGradient.h" | 11 #include "SkTwoPointConicalGradient.h" |
| 12 | 12 |
| 13 #if SK_SUPPORT_GPU | 13 #if SK_SUPPORT_GPU |
| 14 #include "GrTBackendEffectFactory.h" | 14 #include "GrTBackendEffectFactory.h" |
| 15 #include "gl/GrGLShaderBuilder.h" |
| 15 // For brevity | 16 // For brevity |
| 16 typedef GrGLUniformManager::UniformHandle UniformHandle; | 17 typedef GrGLUniformManager::UniformHandle UniformHandle; |
| 17 | 18 |
| 18 static const SkScalar kErrorTol = 0.00001f; | 19 static const SkScalar kErrorTol = 0.00001f; |
| 19 static const SkScalar kEdgeErrorTol = 5.f * kErrorTol; | 20 static const SkScalar kEdgeErrorTol = 5.f * kErrorTol; |
| 20 | 21 |
| 21 /** | 22 /** |
| 22 * We have three general cases for 2pt conical gradients. First we always assume
that | 23 * We have three general cases for 2pt conical gradients. First we always assume
that |
| 23 * the start radius <= end radius. Our first case (kInside_) is when the start c
ircle | 24 * the start radius <= end radius. Our first case (kInside_) is when the start c
ircle |
| 24 * is completely enclosed by the end circle. The second case (kOutside_) is the
case | 25 * is completely enclosed by the end circle. The second case (kOutside_) is the
case |
| (...skipping 1291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1316 return CircleInside2PtConicalEffect::Create(ctx, shader, matrix, tm, inf
o); | 1317 return CircleInside2PtConicalEffect::Create(ctx, shader, matrix, tm, inf
o); |
| 1317 } else if (type == kEdge_ConicalType) { | 1318 } else if (type == kEdge_ConicalType) { |
| 1318 set_matrix_edge_conical(shader, &matrix); | 1319 set_matrix_edge_conical(shader, &matrix); |
| 1319 return Edge2PtConicalEffect::Create(ctx, shader, matrix, tm); | 1320 return Edge2PtConicalEffect::Create(ctx, shader, matrix, tm); |
| 1320 } else { | 1321 } else { |
| 1321 return CircleOutside2PtConicalEffect::Create(ctx, shader, matrix, tm, in
fo); | 1322 return CircleOutside2PtConicalEffect::Create(ctx, shader, matrix, tm, in
fo); |
| 1322 } | 1323 } |
| 1323 } | 1324 } |
| 1324 | 1325 |
| 1325 #endif | 1326 #endif |
| OLD | NEW |