715 {
719 }
720
723 }
724
728
729
732 }
735 CircularRRectEffect::kAll_CornerFlags,
rrect);
736 } else {
738 }
739 }
740
742
744 uint32_t cornerFlags = 0;
745
747 bool squashedRadii = false;
748 for (int c = 0; c < 4; ++c) {
750
751 if ((0 == radii[c].fX) != (0 == radii[c].fY)) {
753 }
754 if (0 == radii[c].fX) {
755
756 continue;
757 }
760 squashedRadii = true;
761 continue;
762 }
763 if (radii[c].fX != radii[c].fY) {
765 break;
766 }
767 if (!cornerFlags) {
768 circularRadius = radii[c].
fX;
769 cornerFlags = 1 << c;
770 } else {
771 if (radii[c].fX != circularRadius) {
773 break;
774 }
775 cornerFlags |= 1 << c;
776 }
777 }
778
779 switch (cornerFlags) {
780 case CircularRRectEffect::kAll_CornerFlags:
781
782
784 [[fallthrough]];
785 case CircularRRectEffect::kTopLeft_CornerFlag:
786 case CircularRRectEffect::kTopRight_CornerFlag:
787 case CircularRRectEffect::kBottomRight_CornerFlag:
788 case CircularRRectEffect::kBottomLeft_CornerFlag:
789 case CircularRRectEffect::kLeft_CornerFlags:
790 case CircularRRectEffect::kTop_CornerFlags:
791 case CircularRRectEffect::kRight_CornerFlags:
792 case CircularRRectEffect::kBottom_CornerFlags: {
794 if (squashedRadii) {
796 }
798 }
799 case CircularRRectEffect::kNone_CornerFlags: {
803 }
804 default: {
813 }
815 }
816 }
817 }
819}
static GrFPResult GrFPSuccess(std::unique_ptr< GrFragmentProcessor > fp)
static GrFPResult GrFPFailure(std::unique_ptr< GrFragmentProcessor > fp)
static const SkScalar kRadiusMin
static std::unique_ptr< GrFragmentProcessor > Rect(std::unique_ptr< GrFragmentProcessor >, GrClipEdgeType, SkRect)
static bool IsSimpleCircular(const SkRRect &rr)
static SkVector GetSimpleRadii(const SkRRect &rr)
SkVector radii(Corner corner) const
@ kUpperLeft_Corner
index of top-left corner radii
@ kLowerRight_Corner
index of bottom-right corner radii
const SkRect & getBounds() const
GrFPResult Make(std::unique_ptr< GrFragmentProcessor >, GrClipEdgeType, const SkRect &, const GrShaderCaps &)
SK_API sk_sp< SkDocument > Make(SkWStream *dst, const SkSerialProcs *=nullptr, std::function< void(const SkPicture *)> onEndPage=nullptr)
void set(float x, float y)