Lines Matching refs:SkRRect
5 #Class SkRRect
8 class SkRRect {
10 SkRRect() = default;
11 SkRRect(const SkRRect& rrect) = default;
12 SkRRect& operator=(const SkRRect& rrect) = default;
37 static SkRRect MakeEmpty();
38 static SkRRect MakeRect(const SkRect& r);
39 static SkRRect MakeOval(const SkRect& oval);
40 static SkRRect MakeRectXY(const SkRect& rect, SkScalar xRad, SkScalar yRad);
57 friend bool operator==(const SkRRect& a, const SkRRect& b);
58 friend bool operator!=(const SkRRect& a, const SkRRect& b);
59 void inset(SkScalar dx, SkScalar dy, SkRRect* dst) const;
61 void outset(SkScalar dx, SkScalar dy, SkRRect* dst) const;
64 SkRRect makeOffset(SkScalar dx, SkScalar dy) const;
72 bool transform(const SkMatrix& matrix, SkRRect* dst) const;
79 SkRRect describes a rounded rectangle with a bounds and a pair of radii for each corner.
80 The bounds and radii can be set so that SkRRect describes: a rectangle with sharp corners;
83 SkRRect allows implementing CSS properties that describe rounded corners.
84 SkRRect may have up to eight different radii, one for each axis on each of its four
87 SkRRect may modify the provided parameters when initializing bounds and radii.
93 #Method SkRRect()
100 SkRRect rrect;
115 #Method SkRRect(const SkRRect& rrect)
122 SkRRect rrect = SkRRect::MakeRect({10, 10, 100, 50});
123 SkRRect rrect2(rrect);
132 #SeeAlso operator=(const SkRRect& rrect) MakeRect
138 #Method SkRRect& operator=(const SkRRect& rrect)
145 SkRRect rrect = SkRRect::MakeRect({40, 40, 100, 70});
146 SkRRect rrect2 = rrect;
155 #SeeAlso SkRRect(const SkRRect& rrect) MakeRect
232 SkRRect rrect;
268 SkRRect rrect = SkRRect::MakeRect({10, 10, 100, 50});
269 SkRRect rrect2(rrect);
275 str += SkRRect::kRect_Type == rrect2.getType() ? "=" : "!";
276 str += "= SkRRect::kRect_Type";
300 SkRRect rrect = SkRRect::MakeRect({10, 10, 100, 50});
301 SkRRect rrect2(rrect);
307 str += SkRRect::kEmpty_Type == rrect2.type() ? "=" : "!";
308 str += "= SkRRect::kEmpty_Type";
331 SkRRect rrect = SkRRect::MakeRectXY({30, 10, 100, 60}, 10, 5);
356 SkRRect rrect = SkRRect::MakeRect({30, 10, 100, 60});
388 SkRRect rrect = SkRRect::MakeRectXY({30, 10, 100, 60}, 40, 30);
414 SkRRect rrect;
442 SkRRect rrect;
470 SkRRect rrect;
494 SkRRect::MakeRect sorts its input, so width() is always zero or larger.
496 SkRRect unsorted = SkRRect::MakeRect({ 15, 25, 10, 5 });
498 SkRRect large = SkRRect::MakeRect({ -FLT_MAX, 1, FLT_MAX, 2 });
519 SkRRect::MakeRect sorts its input, so height() is always zero or larger.
521 SkRRect unsorted = SkRRect::MakeRect({ 15, 25, 10, 20 });
523 SkRRect large = SkRRect::MakeRect({ 1, -FLT_MAX, 2, FLT_MAX });
544 auto drawDetails = [=](const SkRRect& rrect) {
555 SkRRect rrect = SkRRect::MakeRect({30, 10, 100, 60});
578 SkRRect rrect = SkRRect::MakeRect({30, 10, 100, 60});
599 SkRRect rrect = SkRRect::MakeRect({30, 10, 100, 60});
612 #Method static SkRRect MakeEmpty()
619 SkRRect rrect = SkRRect::MakeEmpty();
620 SkRRect rrect2(rrect);
626 str += SkRRect::kEmpty_Type == rrect2.type() ? "=" : "!";
627 str += "= SkRRect::kEmpty_Type";
632 #SeeAlso SkRRect() SkRect::MakeEmpty
638 #Method static SkRRect MakeRect(const SkRect& r)
646 SkRRect rrect = SkRRect::MakeRect({30, 10, 100, 60});
659 #Method static SkRRect MakeOval(const SkRect& oval)
667 SkRRect rrect = SkRRect::MakeOval({30, 10, 100, 60});
681 #Method static SkRRect MakeRectXY(const SkRect& rect, SkScalar xRad, SkScalar yRad)
689 SkRRect rrect = SkRRect::MakeRectXY({30, 10, 100, 60}, 20, 20);
711 SkRRect rrect = SkRRect::MakeRectXY({30, 10, 100, 60}, 20, 20);
733 SkRRect rrect = SkRRect::MakeRectXY({30, 10, 100, 60}, 20, 20);
757 SkRRect rrect;
762 canvas->drawLine(r.fLeft, r.fTop + rrect.radii(SkRRect::kUpperLeft_Corner).fY,
763 r.fRight, r.fTop + rrect.radii(SkRRect::kUpperRight_Corner).fY, paint);
764 canvas->drawLine(r.fLeft, r.fBottom - rrect.radii(SkRRect::kLowerLeft_Corner).fY,
765 r.fRight, r.fBottom - rrect.radii(SkRRect::kLowerRight_Corner).fY, paint);
766 canvas->drawLine(r.fLeft + rrect.radii(SkRRect::kUpperLeft_Corner).fX, r.fTop,
767 r.fLeft + rrect.radii(SkRRect::kLowerLeft_Corner).fX, r.fBottom, paint);
768 canvas->drawLine(r.fRight - rrect.radii(SkRRect::kUpperRight_Corner).fX, r.fTop,
769 r.fRight - rrect.radii(SkRRect::kLowerRight_Corner).fX, r.fBottom, paint);
793 SkRRect rrect;
841 SkRRect rrect;
847 canvas->drawLine(r.fLeft, r.fTop + rrect.radii(SkRRect::kUpperLeft_Corner).fY,
848 r.fRight, r.fTop + rrect.radii(SkRRect::kUpperRight_Corner).fY, paint);
849 canvas->drawLine(r.fLeft, r.fBottom - rrect.radii(SkRRect::kLowerLeft_Corner).fY,
850 r.fRight, r.fBottom - rrect.radii(SkRRect::kLowerRight_Corner).fY, paint);
851 canvas->drawLine(r.fLeft + rrect.radii(SkRRect::kUpperLeft_Corner).fX, r.fTop,
852 r.fLeft + rrect.radii(SkRRect::kLowerLeft_Corner).fX, r.fBottom, paint);
853 canvas->drawLine(r.fRight - rrect.radii(SkRRect::kUpperRight_Corner).fX, r.fTop,
854 r.fRight - rrect.radii(SkRRect::kLowerRight_Corner).fX, r.fBottom, paint);
870 SkRRect rrect1 = SkRRect::MakeRectXY({left, 20, 60, 220}, 50, 200);
901 SkRRect rrect1 = SkRRect::MakeRectXY({10, 20, 60, 220}, radiusX, 200);
902 SkDebugf("left corner: (%g) %g\n", radiusX, rrect1.radii(SkRRect::kUpperLeft_Corner).fX);
927 SkRRect rrect = SkRRect::MakeRectXY({20, 20, 220, 100}, 15, 15);
930 rrect = SkRRect::MakeOval(rrect.getBounds());
940 #Method bool operator==(const SkRRect& a, const SkRRect& b)
946 SkRRect rrect1 = SkRRect::MakeRectXY({10, 20, 60, 220}, 50, 200);
947 SkRRect rrect2 = SkRRect::MakeRectXY(rrect1.rect(), 25, 100);
948 SkRRect rrect3 = SkRRect::MakeOval(rrect1.rect());
960 #SeeAlso operator!=(const SkRRect& a, const SkRRect& b)
966 #Method bool operator!=(const SkRRect& a, const SkRRect& b)
972 SkRRect rrect1 = SkRRect::MakeRectXY({10, 20, 60, 220}, 50, 100);
973 SkRRect rrect2 = SkRRect::MakeRectXY(rrect1.rect(), 50, 50);
974 SkRRect rrect3 = SkRRect::MakeOval(rrect1.rect());
986 #SeeAlso operator==(const SkRRect& a, const SkRRect& b)
992 #Method void inset(SkScalar dx, SkScalar dy, SkRRect* dst) const
1001 SkRRect rrect = SkRRect::MakeRectXY({100, 20, 140, 220}, 50, 100);
1023 SkRRect rrect = SkRRect::MakeRectXY({10, 20, 180, 220}, 50, 100);
1037 #Method void outset(SkScalar dx, SkScalar dy, SkRRect* dst) const
1046 SkRRect rrect = SkRRect::MakeRectXY({100, 20, 140, 220}, 50, 100);
1069 SkRRect rrect = SkRRect::MakeRectXY({100, 20, 140, 220}, 50, 100);
1091 SkRRect rrect = SkRRect::MakeRectXY({100, 20, 140, 220}, 50, 100);
1104 #Method SkRRect makeOffset(SkScalar dx, SkScalar dy) const
1113 SkRRect rrect = SkRRect::MakeRectXY({100, 20, 140, 220}, 50, 100);
1134 SkRRect rrect = SkRRect::MakeRect(test);
1135 SkRRect oval = SkRRect::MakeOval(test);
1162 SkRRect rrect = SkRRect::MakeRect({10, 10, 110, 80});
1163 SkRRect corrupt = rrect;
1184 Space required to write the contents of SkRRect into a buffer; always a multiple of four.
1197 SkRRect rrect = SkRRect::MakeRect({10, 10, 110, 80});
1198 char storage[SkRRect::kSizeInMemory];
1200 SkRRect copy;
1226 SkRRect rrect;
1228 char storage[SkRRect::kSizeInMemory];
1230 SkRRect copy;
1248 #Method bool transform(const SkMatrix& matrix, SkRRect* dst) const
1256 SkRRect rrect;
1258 SkRRect transformed;
1283 SkRRect rrect = SkRRect::MakeRect({6.f / 7, 2.f / 3, 6.f / 7, 2.f / 3});
1320 SkRRect rrect = SkRRect::MakeRect({6.f / 7, 2.f / 3, 6.f / 7, 2.f / 3});
1329 SkRRect copy;
1356 SkRRect rrect = SkRRect::MakeRect({6.f / 7, 2.f / 3, 6.f / 7, 2.f / 3});
1368 SkRRect copy;
1390 #Class SkRRect ##