aboutsummaryrefslogtreecommitdiffhomepage
path: root/docs/SkRRect_Reference.bmh
blob: d6caebe166b3268c1d98409967f0af7377413d97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
#Topic RRect
#Alias Round_Rect ##
#Alias RRect_Reference ##

#Class SkRRect

#Private
Path forward:
   core work
      add contains(SkRect&)  - for clip stack
      add contains(SkRRect&) - for clip stack
      add heart rect computation (max rect inside RR)
      add 9patch rect computation
      add growToInclude(SkPath&)
   analysis
      use growToInclude to fit skp round rects & generate stats (RRs vs. real paths)
      check on # of rectorus's the RRs could handle
   rendering work
      update SkPath.addRRect() to only use quads
      add GM and bench
   further out
      detect and triangulate RRectorii rather than falling back to SW in Ganesh
##

The SkRRect class represents a rounded rect with a potentially different
radii for each corner. It does not have a constructor so must be
initialized with one of the initialization functions (e.g., setEmpty,
setRectRadii, etc.)

This class allows implementing CSS properties that describe rounded corners.
A rectangle may have up to eight radii, one for each axis on each of its four
corners.

If either corner's radii are zero, the corner is square.
Negative radii are treated as zero.
If corner curves overlap, they are proportionally reduced to fit.

#Subtopic Overview
#Populate
##

#Subtopic Constructor
#Populate
##

#Subtopic Operator
#Populate
##

#Subtopic Member_Function
#Populate
##

# ------------------------------------------------------------------------------

#Method SkRRect() = default
#In Constructor
#Line # incomplete ##

Default initialized to a rrect at the origin with zero width and height.

#Return incomplete ##

#Example
// incomplete
##

#SeeAlso incomplete

#Method ##

# ------------------------------------------------------------------------------

#Method SkRRect(const SkRRect& rrect) = default
#In Constructor
#Line # incomplete ##

#Param rrect  incomplete ##

#Return incomplete ##

#Example
// incomplete
##

#SeeAlso incomplete

#Method ##

# ------------------------------------------------------------------------------

#Method SkRRect& operator=(const SkRRect& rrect) = default
#In Operator
#Line # incomplete ##

#Param rrect  incomplete ##

#Return incomplete ##

#Example
// incomplete
##

#SeeAlso incomplete

#Method ##

# ------------------------------------------------------------------------------

#Enum Type
#Line # incomplete ##

#Code
    enum Type {
        kEmpty_Type,
        kRect_Type,
        kOval_Type,
        kSimple_Type,
        kNinePatch_Type,
        kComplex_Type,
        kLastType = kComplex_Type,
    };
##

Enum to capture the various possible subtypes of Round_Rect. Accessed
by type(). The subtypes become progressively less restrictive.

#Const kEmpty_Type
#Line # incomplete ##
Round_Rect has zero width or height. All radii are zero.
##
#Const kRect_Type
#Line # incomplete ##
Round_Rect has width and height. All radii are zero.
##
#Const kOval_Type
#Line # incomplete ##
Round_Rect has width and height. All four x-radii are equal,
and at least half the width. All four y-radii are equal,
and at least half the height.
##
#Const kSimple_Type
#Line # incomplete ##
Round_Rect has width and height. All four x-radii are equal and
greater than zero, and all four y-radii are equal and greater than
zero. Either x-radii are less than half the width, or y-radii is
less than half the height, or both.
##
#Const kNinePatch_Type
#Line # incomplete ##
Round_Rect has width and height. Left x-radii are equal, top
y-radii are equal, right x-radii are equal, and bottom y-radii
are equal. The radii do not descript a rect, oval, or simple type.

The centers of the corner ellipses form an axis-aligned rectangle
that divides the Round_Rect into nine rectangular patches; an
interior rectangle, four edges, and four corners.
##
#Const kComplex_Type
#Line # incomplete ##
both radii are non-zero.
##
#Const kLastType = kComplex_Type
#Line # incomplete ##
##

#Example
// incomplete
##

#SeeAlso incomplete

#Enum ##

# ------------------------------------------------------------------------------

#Method Type getType() const
#In incomplete
#Line # incomplete ##

Returns the RR's sub type.

#Return incomplete ##

#Example
// incomplete
##

#SeeAlso incomplete

#Method ##

# ------------------------------------------------------------------------------

#Method Type type() const
#In incomplete
#Line # incomplete ##

#Return incomplete ##

#Example
// incomplete
##

#SeeAlso incomplete

#Method ##

# ------------------------------------------------------------------------------

#Method inline bool isEmpty() const
#In Property
#Line # returns true if width or height are zero ##
Returns true if rect().fLeft is equal to rect().fRight, or if rect().fTop is equal
to rect().fBottom.

#Return true if width() or height() are zero ##

#Example
#Height 100
    SkPaint paint;
    paint.setAntiAlias(true);
    paint.setTextAlign(SkPaint::kCenter_Align);
    paint.setTextSize(16);
    SkRRect rrect = SkRRect::MakeRectXY({30, 10, 100, 60}, 10, 5);
    canvas->drawRRect(rrect, paint);
    canvas->drawString(rrect.isEmpty() ? "empty" : "not empty", 64, 90, paint);
    rrect.inset(40, 0);
    canvas->translate(128, 0);
    canvas->drawRRect(rrect, paint);
    canvas->drawString(rrect.isEmpty() ? "empty" : "not empty", 64, 90, paint);
##

#SeeAlso SkRect::isEmpty height width

#Method ##

# ------------------------------------------------------------------------------

#Method inline bool isRect() const
#In Property
#Line # returns true if not empty, and one radius at each corner is zero ##
Returns true if not empty, and if either x or y radius at each corner is zero.

#Return true if not empty, and one radius at each corner is zero ##

#Example
#Height 100
    SkPaint paint;
    paint.setAntiAlias(true);
    paint.setTextAlign(SkPaint::kCenter_Align);
    paint.setTextSize(16);
    SkRRect rrect = SkRRect::MakeRect({30, 10, 100, 60});
    canvas->drawRRect(rrect, paint);
    canvas->drawString(rrect.isRect() ? "rect" : "not rect", 64, 90, paint);
    SkVector radii[] = {{10, 10}, {0, 0}, {0, 0}, {0, 0}};
    rrect.setRectRadii(rrect.getBounds(), radii);
    canvas->translate(128, 0);
    canvas->drawRRect(rrect, paint);
    canvas->drawString(rrect.isRect() ? "rect" : "not rect", 64, 90, paint);
##

#SeeAlso isEmpty radii

#Method ##

# ------------------------------------------------------------------------------

#Method inline bool isOval() const
#In Property
#Line # returns true if not empty, axes radii are equal, radii fill bounds ##
Returns true if not empty, if all x-axis radii are equal, if all y-axis radii
are equal, x-axis radii are at least half the width, and y-axis radii are at
least half the height.

#Return true if has identical geometry to Oval ##

#Example
#Height 100
#Description
The first radii are scaled down proportionately until both x-axis and y-axis fit
within the bounds. After scaling, x-axis radius is smaller than half the width;
left round rect is not an oval. The second radii are equal to half the
dimensions; right round rect is an oval.
##
    SkPaint paint;
    paint.setAntiAlias(true);
    paint.setTextAlign(SkPaint::kCenter_Align);
    paint.setTextSize(16);
    SkRRect rrect = SkRRect::MakeRectXY({30, 10, 100, 60}, 40, 30);
    canvas->drawRRect(rrect, paint);
    canvas->drawString(rrect.isOval() ? "oval" : "not oval", 64, 90, paint);
    rrect.setRectXY(rrect.getBounds(), 35, 25);
    canvas->translate(128, 0);
    canvas->drawRRect(rrect, paint);
    canvas->drawString(rrect.isOval() ? "oval" : "not oval", 64, 90, paint);
##

#SeeAlso isEmpty isSimple SkCanvas::drawOval

#Method ##

# ------------------------------------------------------------------------------

#Method inline bool isSimple() const
#In Property
#Line # returns true if not empty, rect or oval; and axes radii are equal ##
Returns true if not empty, if all x-axis radii are equal but not zero,
if all y-axis radii are equal but not zero; and x-axis radius is less than half
width(), or y-axis radius is less than half height().

#Return true if not empty, rect or oval; and axes radii are equal ##

#Bug 8107
#Example
#Height 100
    SkPaint paint;
    paint.setAntiAlias(true);
    paint.setTextAlign(SkPaint::kCenter_Align);
    paint.setTextSize(16);
    SkVector radii[] = {{40, 30}, {40, 30}, {40, 30}, {40, 30}};
    SkRRect rrect;
    rrect.setRectRadii({30, 10, 100, 60}, radii);
    canvas->drawRRect(rrect, paint);
    canvas->drawString(rrect.isSimple() ? "simple" : "not simple", 64, 90, paint);
    radii[0].fX = 35;
    rrect.setRectRadii(rrect.getBounds(), radii);
    canvas->translate(128, 0);
    canvas->drawRRect(rrect, paint);
    canvas->drawString(rrect.isSimple() ? "simple" : "not simple", 64, 90, paint);
##

#SeeAlso isEmpty isRect isOval isNinePatch

#Method ##

# ------------------------------------------------------------------------------

#Method inline bool isNinePatch() const
#In Property
#Line # returns true if not empty, rect, oval or simple; and radii are axis-aligned ##
Returns true if isEmpty, isRect, isOval, and isSimple return false; and if
left x-axis radii are equal, right x-axis radii are equal, top y-axis radii are
equal, and bottom y-axis radii are equal.

#Return true if not empty, rect, oval or simple; and radii are axis-aligned ##

#Bug 8107
#Example
#Height 100
    SkPaint paint;
    paint.setAntiAlias(true);
    paint.setTextAlign(SkPaint::kCenter_Align);
    paint.setTextSize(16);
    SkVector radii[] = {{20, 30}, {40, 30}, {40, 30}, {20, 30}};
    SkRRect rrect;
    rrect.setRectRadii({30, 10, 100, 60}, radii);
    canvas->drawRRect(rrect, paint);
    canvas->drawString(rrect.isNinePatch() ? "9 patch" : "not 9 patch", 64, 90, paint);
    radii[0].fX = 35;
    rrect.setRectRadii(rrect.getBounds(), radii);
    canvas->translate(128, 0);
    canvas->drawRRect(rrect, paint);
    canvas->drawString(rrect.isNinePatch() ? "9 patch" : "not 9 patch", 64, 90, paint);
##

#SeeAlso isEmpty isRect isOval isSimple isComplex

#Method ##

# ------------------------------------------------------------------------------

#Method inline bool isComplex() const
#In Property
#Line # returns true if not empty, rect, oval, simple, or nine-patch ##

Returns true if isEmpty, isRect, isOval, isSimple, and isNinePatch return false.
If true: width and height are greater than zero, at least one corner radii are
both greater than zero; left x-axis radii are not equal, or right x-axis radii
are not equal, or top y-axis radii are not equal, or bottom y-axis radii are not
equal.

#Return true if not empty, rect, oval, simple, or nine-patch ##

#Example
    SkPaint paint;
    paint.setAntiAlias(true);
    paint.setTextAlign(SkPaint::kCenter_Align);
    paint.setTextSize(16);
    SkVector radii[] = {{25, 30}, {40, 30}, {40, 30}, {20, 30}};
    SkRRect rrect;
    rrect.setRectRadii({30, 10, 100, 60}, radii);
    canvas->drawRRect(rrect, paint);
    canvas->drawString(rrect.isComplex() ? "complex" : "not complex", 64, 90, paint);
    radii[0].fX = 20;
    rrect.setRectRadii(rrect.getBounds(), radii);
    canvas->translate(128, 0);
    canvas->drawRRect(rrect, paint);
    canvas->drawString(rrect.isComplex() ? "complex" : "not complex", 64, 90, paint);
##

#SeeAlso isEmpty isRect isOval isSimple isNinePatch

#Method ##

# ------------------------------------------------------------------------------

#Method SkScalar width() const
#In Property
#Line # returns span in x ##
Returns span on the x-axis. This does not check if result fits in 32-bit float;
result may be infinity.

#Return bounds().fRight minus bounds().fLeft ##

#Example
#Description
SkRRect::MakeRect sorts its input, so width() is always zero or larger.
##
    SkRRect unsorted = SkRRect::MakeRect({ 15, 25, 10, 5 });
    SkDebugf("unsorted width: %g\n", unsorted.width());
    SkRRect large = SkRRect::MakeRect({ -FLT_MAX, 1, FLT_MAX, 2 });
    SkDebugf("large width: %.0f\n", large.width());
#StdOut
unsorted width: 5
large width: inf
##
##

#SeeAlso SkRect::width height getBounds

#Method ##

# ------------------------------------------------------------------------------

#Method SkScalar height() const
#In Property
#Line # returns span in y ##
Returns span on the y-axis. This does not check if result fits in 32-bit float;
result may be infinity.

#Return bounds().fBottom minus bounds().fTop ##

#Example
#Description
SkRRect::MakeRect sorts its input, so height() is always zero or larger.
##
    SkRRect unsorted = SkRRect::MakeRect({ 15, 25, 10, 20 });
    SkDebugf("unsorted height: %g\n", unsorted.height());
    SkRRect large = SkRRect::MakeRect({ 1, -FLT_MAX, 2, FLT_MAX });
    SkDebugf("large height: %.0f\n", large.height());
#StdOut
unsorted height: 5
large height: inf
##
##

#SeeAlso SkRect.height width getBounds

#Method ##

# ------------------------------------------------------------------------------

#Method SkVector getSimpleRadii() const
#In Property
#Line # returns corner radii for simple types ##

Returns top-left corner x-radii. If type() returns kEmpty_Type, kRect_Type, 
kOval_Type, or kSimple_Type, returns a value representative of all corner radii.
If type() returns kNinePatch_Type or kComplex_Type, at least one of the
remaining three corners has a different value.

#Return corner radii for simple types ##

#Example
    auto drawDetails = [=](const SkRRect& rrect) {
        SkPaint paint;
        paint.setAntiAlias(true);
        paint.setTextAlign(SkPaint::kCenter_Align);
        paint.setTextSize(12);
        canvas->drawRRect(rrect, paint);
        SkVector corner = rrect.getSimpleRadii();
        std::string label = "corner: " + std::to_string(corner.fX).substr(0, 3) + ", " +
                        std::to_string(corner.fY).substr(0, 3);
        canvas->drawString(label.c_str(), 64, 90, paint);
        canvas->translate(128, 0);
    };
    SkRRect rrect = SkRRect::MakeRect({30, 10, 100, 60});
    drawDetails(rrect);
    rrect.setRectXY(rrect.getBounds(), 5, 8);
    drawDetails(rrect);
##

#SeeAlso radii getBounds getType isSimple

#Method ##

# ------------------------------------------------------------------------------

#Method void setEmpty()
#In Set
#Line # zeroes width, height, and corner radii ##

Sets bounds to zero width and height at (0, 0), the origin. Sets
corner radii to zero and sets type to kEmpty_Type.

#Example
#Description
Nothing blue is drawn because rrect is set to empty.
##
    SkPaint paint;
    SkRRect rrect = SkRRect::MakeRect({30, 10, 100, 60});
    canvas->drawRRect(rrect, paint);
    rrect.setEmpty();
    paint.setColor(SK_ColorBLUE);
    canvas->drawRRect(rrect, paint);
##

#SeeAlso MakeEmpty setRect

#Method ##

# ------------------------------------------------------------------------------

#Method void setRect(const SkRect& rect)
#In Set
#Line # sets rect bounds with zeroed corners ##

Sets bounds to sorted rect, and sets corner radii to zero.
If set bounds has width and height, and sets type to kRect_Type;
otherwise, sets type to kEmpty_Type.

#Param rect  bounds to set ##

#Example
    SkPaint paint;
    SkRRect rrect = SkRRect::MakeRect({30, 10, 100, 60});
    canvas->drawRRect(rrect, paint);
    rrect.setRect({60, 30, 120, 80});
    paint.setColor(SK_ColorBLUE);
    canvas->drawRRect(rrect, paint);
##

#SeeAlso MakeRect setRectXY

#Method ##

# ------------------------------------------------------------------------------

#Method static SkRRect MakeEmpty()
#In Constructor
#Line # incomplete ##

Makes an empty rrect at the origin with zero width and height.

#Return incomplete ##

#Example
// incomplete
##

#SeeAlso incomplete

#Method ##

# ------------------------------------------------------------------------------

#Method static SkRRect MakeRect(const SkRect& r)
#In Constructor
#Line # incomplete ##

#Param r  incomplete ##

#Return incomplete ##

#Example
// incomplete
##

#SeeAlso incomplete

#Method ##

# ------------------------------------------------------------------------------

#Method static SkRRect MakeOval(const SkRect& oval)
#In incomplete
#Line # incomplete ##

#Param oval  incomplete ##

#Return incomplete ##

#Example
// incomplete
##

#SeeAlso incomplete

#Method ##

# ------------------------------------------------------------------------------

#Method static SkRRect MakeRectXY(const SkRect& rect, SkScalar xRad, SkScalar yRad)
#In incomplete
#Line # incomplete ##

#Param rect  incomplete ##
#Param xRad  incomplete ##
#Param yRad  incomplete ##

#Return incomplete ##

#Example
// incomplete
##

#SeeAlso incomplete

#Method ##

# ------------------------------------------------------------------------------

#Method void setOval(const SkRect& oval)
#In incomplete
#Line # incomplete ##

Sets Round_Rect to match the supplied oval. All x-radii will equal half the
width and all y-radii will equal half the height.

#Param oval  incomplete ##

#Example
// incomplete
##

#SeeAlso incomplete

#Method ##

# ------------------------------------------------------------------------------

#Method void setRectXY(const SkRect& rect, SkScalar xRad, SkScalar yRad)
#In incomplete
#Line # incomplete ##

Initializes Round_Rect with the same radii for all four corners.

#Param rect  incomplete ##
#Param xRad  incomplete ##
#Param yRad  incomplete ##

#Example
// incomplete
##

#SeeAlso incomplete

#Method ##

# ------------------------------------------------------------------------------

#Method void setNinePatch(const SkRect& rect, SkScalar leftRad, SkScalar topRad,
                      SkScalar rightRad, SkScalar bottomRad)
#In incomplete
#Line # incomplete ##

Initializes Round_Rect with one radius per-side.

#Param rect  incomplete ##
#Param leftRad  incomplete ##
#Param topRad  incomplete ##
#Param rightRad  incomplete ##
#Param bottomRad  incomplete ##

#Example
// incomplete
##

#SeeAlso incomplete

#Method ##

# ------------------------------------------------------------------------------

#Method void setRectRadii(const SkRect& rect, const SkVector radii[4])
#In incomplete
#Line # incomplete ##

Initializes Round_Rect with potentially different radii for all four corners.

#Param rect  incomplete ##
#Param radii  incomplete ##

#Example
// incomplete
##

#SeeAlso incomplete

#Method ##

# ------------------------------------------------------------------------------

#Enum Corner
#Line # incomplete ##

#Code
    enum Corner {
        kUpperLeft_Corner,
        kUpperRight_Corner,
        kLowerRight_Corner,
        kLowerLeft_Corner,
    };
##

The radii are stored: top-left, top-right, bottom-right, bottom-left.

#Const kUpperLeft_Corner
#Line # incomplete ##
##
#Const kUpperRight_Corner
#Line # incomplete ##
##
#Const kLowerRight_Corner
#Line # incomplete ##
##
#Const kLowerLeft_Corner
#Line # incomplete ##
##

#Example
// incomplete
##

#SeeAlso incomplete

#Enum ##

# ------------------------------------------------------------------------------

#Method const SkRect& rect() const
#In incomplete
#Line # incomplete ##

#Return incomplete ##

#Example
// incomplete
##

#SeeAlso incomplete

#Method ##

# ------------------------------------------------------------------------------

#Method SkVector radii(Corner corner) const
#In incomplete
#Line # incomplete ##

#Param corner  incomplete ##

#Return incomplete ##

#Example
// incomplete
##

#SeeAlso incomplete

#Method ##

# ------------------------------------------------------------------------------

#Method const SkRect& getBounds() const
#In incomplete
#Line # incomplete ##

#Return incomplete ##

#Example
// incomplete
##

#SeeAlso incomplete

#Method ##

# ------------------------------------------------------------------------------

#Method bool operator==(const SkRRect& a, const SkRRect& b)
#In Operator
#Line # incomplete ##

#Param a  incomplete ##
#Param b  incomplete ##

#Return incomplete ##

#Example
// incomplete
##

#SeeAlso incomplete

#Method ##

# ------------------------------------------------------------------------------

#Method bool operator!=(const SkRRect& a, const SkRRect& b)
#In Operator
#Line # incomplete ##

#Param a  incomplete ##
#Param b  incomplete ##

#Return incomplete ##

#Example
// incomplete
##

#SeeAlso incomplete

#Method ##

# ------------------------------------------------------------------------------

#Method void inset(SkScalar dx, SkScalar dy, SkRRect* dst) const
#In incomplete
#Line # incomplete ##

Calls inset on the bounds, and adjust the radii to reflect what happens.
If the corner is sharp (no curvature), leave it alone,
otherwise we grow/shrink the radii by the amount of the inset. If a
given radius becomes negative, it is pinned to 0.
If the inset amount is larger than the width/height then the rrect collapses to
a degenerate line or point.
If the inset is sufficiently negative to cause the bounds to become infinite then
the result is a default initialized rrect.
It is valid for dst == this.

#Param dx  incomplete ##
#Param dy  incomplete ##
#Param dst  incomplete ##

#Example
// incomplete
##

#SeeAlso incomplete

#Method ##

# ------------------------------------------------------------------------------

#Method void inset(SkScalar dx, SkScalar dy)
#In incomplete
#Line # incomplete ##

#Param dx  incomplete ##
#Param dy  incomplete ##

#Example
// incomplete
##

#SeeAlso incomplete

#Method ##

# ------------------------------------------------------------------------------

#Method void outset(SkScalar dx, SkScalar dy, SkRRect* dst) const
#In incomplete
#Line # incomplete ##

Call outset on the bounds, and adjust the radii to reflect what happens
in stroking. If the corner is sharp (no curvature), leave it alone,
otherwise we grow/shrink the radii by the amount of the inset. If a
given radius becomes negative, it is pinned to 0.
It is valid for dst == this.

#Param dx  incomplete ##
#Param dy  incomplete ##
#Param dst  incomplete ##

#Example
// incomplete
##

#SeeAlso incomplete

#Method ##

# ------------------------------------------------------------------------------

#Method void outset(SkScalar dx, SkScalar dy)
#In incomplete
#Line # incomplete ##

#Param dx  incomplete ##
#Param dy  incomplete ##

#Example
// incomplete
##

#SeeAlso incomplete

#Method ##

# ------------------------------------------------------------------------------

#Method void offset(SkScalar dx, SkScalar dy)
#In incomplete
#Line # incomplete ##

Translate the rrect by (dx, dy).

#Param dx  incomplete ##
#Param dy  incomplete ##

#Example
// incomplete
##

#SeeAlso incomplete

#Method ##

# ------------------------------------------------------------------------------

#Method SkRRect SK_WARN_UNUSED_RESULT makeOffset(SkScalar dx, SkScalar dy) const
#In incomplete
#Line # incomplete ##

#Param dx  incomplete ##
#Param dy  incomplete ##

#Return incomplete ##

#Example
// incomplete
##

#SeeAlso incomplete

#Method ##

# ------------------------------------------------------------------------------

#Method bool contains(const SkRect& rect) const
#In incomplete
#Line # incomplete ##

Returns true if 'rect' is wholy inside the RR, and both
are not empty.

#Param rect  incomplete ##

#Return incomplete ##

#Example
// incomplete
##

#SeeAlso incomplete

#Method ##

# ------------------------------------------------------------------------------

#Method bool isValid() const
#In incomplete
#Line # incomplete ##

#Return incomplete ##

#Example
// incomplete
##

#SeeAlso incomplete

#Method ##

# ------------------------------------------------------------------------------

#Const kSizeInMemory 48
#Line # incomplete ##

#Example
// incomplete
##

#Const ##

# ------------------------------------------------------------------------------

#Method size_t writeToMemory(void* buffer) const
#In incomplete
#Line # incomplete ##

Write the rrect into the specified buffer. This is guaranteed to always
write kSizeInMemory bytes, and that value is guaranteed to always be
a multiple of 4. Return kSizeInMemory.

#Param buffer  incomplete ##

#Return incomplete ##

#Example
// incomplete
##

#SeeAlso incomplete

#Method ##

# ------------------------------------------------------------------------------

#Method size_t readFromMemory(const void* buffer, size_t length)
#In incomplete
#Line # incomplete ##

Reads the rrect from the specified buffer.
If the specified buffer is large enough, this will read kSizeInMemory bytes,
and that value is guaranteed to always be a multiple of 4.

#Param buffer  memory to read from
##
#Param length  amount of memory available in the buffer
##

#Return  number of bytes read (must be a multiple of 4) or
        0 if there was not enough memory available
##

#Example
// incomplete
##

#SeeAlso incomplete

#Method ##

# ------------------------------------------------------------------------------

#Method bool transform(const SkMatrix& matrix, SkRRect* dst) const
#In incomplete
#Line # incomplete ##

Transform by the specified matrix, and put the result in dst.

#Param matrix  SkMatrix specifying the transform. Must only contain
        scale and/or translate, or this call will fail.
##
#Param dst  SkRRect to store the result. It is an error to use this,
        which would make this function no longer const.
##

#Return  true on success, false on failure.
##

#Example
// incomplete
##

#SeeAlso incomplete

#Method ##

# ------------------------------------------------------------------------------

#Method void dump(bool asHex) const
#In incomplete
#Line # incomplete ##

#Param asHex  incomplete ##

#Example
// incomplete
##

#SeeAlso incomplete

#Method ##

# ------------------------------------------------------------------------------

#Method void dump() const
#In incomplete
#Line # incomplete ##

#Example
// incomplete
##

#SeeAlso incomplete

#Method ##

# ------------------------------------------------------------------------------

#Method void dumpHex() const
#In incomplete
#Line # incomplete ##

#Example
// incomplete
##

#SeeAlso incomplete

#Method ##

#Class SkRRect ##

#Topic RRect ##