| OLD | NEW |
| 1 | |
| 2 /* | 1 /* |
| 3 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
| 4 * | 3 * |
| 5 * 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 |
| 6 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 7 */ | 6 */ |
| 8 | 7 |
| 9 #include "SkTwoPointConicalGradient_gpu.h" | 8 #include "SkTwoPointConicalGradient_gpu.h" |
| 10 | 9 |
| 11 #include "SkTwoPointConicalGradient.h" | 10 #include "SkTwoPointConicalGradient.h" |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 void GLEdge2PtConicalEffect::onSetData(const GrGLSLProgramDataManager& pdman, | 285 void GLEdge2PtConicalEffect::onSetData(const GrGLSLProgramDataManager& pdman, |
| 287 const GrProcessor& processor) { | 286 const GrProcessor& processor) { |
| 288 INHERITED::onSetData(pdman, processor); | 287 INHERITED::onSetData(pdman, processor); |
| 289 const Edge2PtConicalEffect& data = processor.cast<Edge2PtConicalEffect>(); | 288 const Edge2PtConicalEffect& data = processor.cast<Edge2PtConicalEffect>(); |
| 290 SkScalar radius0 = data.radius(); | 289 SkScalar radius0 = data.radius(); |
| 291 SkScalar diffRadius = data.diffRadius(); | 290 SkScalar diffRadius = data.diffRadius(); |
| 292 | 291 |
| 293 if (fCachedRadius != radius0 || | 292 if (fCachedRadius != radius0 || |
| 294 fCachedDiffRadius != diffRadius) { | 293 fCachedDiffRadius != diffRadius) { |
| 295 | 294 |
| 296 pdman.set3f(fParamUni, SkScalarToFloat(radius0), | 295 pdman.set3f(fParamUni, SkScalarToFloat(radius0), |
| 297 SkScalarToFloat(SkScalarMul(radius0, radius0)), SkScalarToFl
oat(diffRadius)); | 296 SkScalarToFloat(SkScalarMul(radius0, radius0)), SkScalarToFl
oat(diffRadius)); |
| 298 fCachedRadius = radius0; | 297 fCachedRadius = radius0; |
| 299 fCachedDiffRadius = diffRadius; | 298 fCachedDiffRadius = diffRadius; |
| 300 } | 299 } |
| 301 } | 300 } |
| 302 | 301 |
| 303 void GLEdge2PtConicalEffect::GenKey(const GrProcessor& processor, | 302 void GLEdge2PtConicalEffect::GenKey(const GrProcessor& processor, |
| 304 const GrGLSLCaps&, GrProcessorKeyBuilder* b)
{ | 303 const GrGLSLCaps&, GrProcessorKeyBuilder* b)
{ |
| 305 b->add32(GenBaseGradientKey(processor)); | 304 b->add32(GenBaseGradientKey(processor)); |
| 306 } | 305 } |
| (...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1323 return CircleInside2PtConicalEffect::Create(ctx, shader, matrix, tm, inf
o); | 1322 return CircleInside2PtConicalEffect::Create(ctx, shader, matrix, tm, inf
o); |
| 1324 } else if (type == kEdge_ConicalType) { | 1323 } else if (type == kEdge_ConicalType) { |
| 1325 set_matrix_edge_conical(shader, &matrix); | 1324 set_matrix_edge_conical(shader, &matrix); |
| 1326 return Edge2PtConicalEffect::Create(ctx, shader, matrix, tm); | 1325 return Edge2PtConicalEffect::Create(ctx, shader, matrix, tm); |
| 1327 } else { | 1326 } else { |
| 1328 return CircleOutside2PtConicalEffect::Create(ctx, shader, matrix, tm, in
fo); | 1327 return CircleOutside2PtConicalEffect::Create(ctx, shader, matrix, tm, in
fo); |
| 1329 } | 1328 } |
| 1330 } | 1329 } |
| 1331 | 1330 |
| 1332 #endif | 1331 #endif |
| OLD | NEW |