| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 "SkRRectsGaussianEdgeShader.h" | 8 #include "SkRRectsGaussianEdgeShader.h" |
| 9 #include "SkReadBuffer.h" | 9 #include "SkReadBuffer.h" |
| 10 #include "SkWriteBuffer.h" | 10 #include "SkWriteBuffer.h" |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 | 402 |
| 403 SkShader::Context* SkRRectsGaussianEdgeShaderImpl::onCreateContext(const Context
Rec& rec, | 403 SkShader::Context* SkRRectsGaussianEdgeShaderImpl::onCreateContext(const Context
Rec& rec, |
| 404 void* storage
) const { | 404 void* storage
) const { |
| 405 return new (storage) GaussianEdgeShaderContext(*this, rec); | 405 return new (storage) GaussianEdgeShaderContext(*this, rec); |
| 406 } | 406 } |
| 407 | 407 |
| 408 /////////////////////////////////////////////////////////////////////////////// | 408 /////////////////////////////////////////////////////////////////////////////// |
| 409 | 409 |
| 410 sk_sp<SkShader> SkRRectsGaussianEdgeShader::Make(const SkRRect& first, | 410 sk_sp<SkShader> SkRRectsGaussianEdgeShader::Make(const SkRRect& first, |
| 411 const SkRRect& second, | 411 const SkRRect& second, |
| 412 SkScalar radius) { | 412 SkScalar radius, SkScalar unuse
d) { |
| 413 if ((!first.isRect() && !first.isCircle() && !first.isSimpleCircular()) ||
| 413 if ((!first.isRect() && !first.isCircle() && !first.isSimpleCircular()) ||
|
| 414 (!second.isRect() && !second.isCircle() && !second.isSimpleCircular()))
{ | 414 (!second.isRect() && !second.isCircle() && !second.isSimpleCircular()))
{ |
| 415 // we only deal with the shapes where the x & y radii are equal | 415 // we only deal with the shapes where the x & y radii are equal |
| 416 // and the same for all four corners | 416 // and the same for all four corners |
| 417 return nullptr; | 417 return nullptr; |
| 418 } | 418 } |
| 419 | 419 |
| 420 return sk_make_sp<SkRRectsGaussianEdgeShaderImpl>(first, second, radius); | 420 return sk_make_sp<SkRRectsGaussianEdgeShaderImpl>(first, second, radius); |
| 421 } | 421 } |
| 422 | 422 |
| 423 /////////////////////////////////////////////////////////////////////////////// | 423 /////////////////////////////////////////////////////////////////////////////// |
| 424 | 424 |
| 425 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkRRectsGaussianEdgeShader) | 425 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkRRectsGaussianEdgeShader) |
| 426 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkRRectsGaussianEdgeShaderImpl) | 426 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkRRectsGaussianEdgeShaderImpl) |
| 427 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 427 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
| 428 | 428 |
| 429 /////////////////////////////////////////////////////////////////////////////// | 429 /////////////////////////////////////////////////////////////////////////////// |
| OLD | NEW |