| 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 "GrRRectEffect.h" | 8 #include "GrRRectEffect.h" |
| 9 | 9 |
| 10 #include "gl/GrGLEffect.h" | 10 #include "gl/GrGLEffect.h" |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 const GrDrawTargetCaps& caps, | 448 const GrDrawTargetCaps& caps, |
| 449 GrTexture*[]) { | 449 GrTexture*[]) { |
| 450 SkScalar w = random->nextRangeScalar(20.f, 1000.f); | 450 SkScalar w = random->nextRangeScalar(20.f, 1000.f); |
| 451 SkScalar h = random->nextRangeScalar(20.f, 1000.f); | 451 SkScalar h = random->nextRangeScalar(20.f, 1000.f); |
| 452 SkScalar rx = random->nextRangeF(kRadiusMin, 9.f); | 452 SkScalar rx = random->nextRangeF(kRadiusMin, 9.f); |
| 453 SkScalar ry = random->nextRangeF(kRadiusMin, 9.f); | 453 SkScalar ry = random->nextRangeF(kRadiusMin, 9.f); |
| 454 SkRRect rrect; | 454 SkRRect rrect; |
| 455 rrect.setRectXY(SkRect::MakeWH(w, h), rx, ry); | 455 rrect.setRectXY(SkRect::MakeWH(w, h), rx, ry); |
| 456 GrEffectRef* effect; | 456 GrEffectRef* effect; |
| 457 do { | 457 do { |
| 458 GrEffectEdgeType et = (GrEffectEdgeType)random->nextULessThan(kGrEffectE
dgeTypeCnt); | 458 GrEffectEdgeType et = random->nextBool() ? kFillAA_GrEffectEdgeType : |
| 459 kInverseFillAA_GrEffectEdgeTy
pe; |
| 459 effect = EllipticalRRectEffect::Create(et, rrect); | 460 effect = EllipticalRRectEffect::Create(et, rrect); |
| 460 } while (NULL == effect); | 461 } while (NULL == effect); |
| 461 return effect; | 462 return effect; |
| 462 } | 463 } |
| 463 | 464 |
| 464 ////////////////////////////////////////////////////////////////////////////// | 465 ////////////////////////////////////////////////////////////////////////////// |
| 465 | 466 |
| 466 class GLEllipticalRRectEffect : public GrGLEffect { | 467 class GLEllipticalRRectEffect : public GrGLEffect { |
| 467 public: | 468 public: |
| 468 GLEllipticalRRectEffect(const GrBackendEffectFactory&, const GrDrawEffect&); | 469 GLEllipticalRRectEffect(const GrBackendEffectFactory&, const GrDrawEffect&); |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 case CircularRRectEffect::kAll_CornerFlags: | 629 case CircularRRectEffect::kAll_CornerFlags: |
| 629 break; | 630 break; |
| 630 default: | 631 default: |
| 631 return NULL; | 632 return NULL; |
| 632 } | 633 } |
| 633 } else { | 634 } else { |
| 634 return NULL; | 635 return NULL; |
| 635 } | 636 } |
| 636 return CircularRRectEffect::Create(edgeType, cornerFlags, rrect); | 637 return CircularRRectEffect::Create(edgeType, cornerFlags, rrect); |
| 637 } | 638 } |
| OLD | NEW |