@@ -115,6 +115,8 @@ TBrushData = record
115
115
procedure DoFillEllipse (const ARect: TRectF; const AOpacity: Single; const ABrush: TBrush); override;
116
116
procedure DoFillPath (const APath: TPathData; const AOpacity: Single; const ABrush: TBrush); override;
117
117
procedure DoFillRect (const ARect: TRectF; const AOpacity: Single; const ABrush: TBrush); override;
118
+ procedure DoFillRoundRect (const ARect: TRectF; const XRadius, YRadius: Single; const ACorners: TCorners;
119
+ const AOpacity: Single; const ABrush: TBrush; const ACornerType: TCornerType); override;
118
120
{ $IF CompilerVersion >= 30}
119
121
procedure DoSetMatrix (const AMatrix: TMatrix); override;
120
122
{ $ENDIF}
@@ -2096,6 +2098,41 @@ procedure TSkCanvasCustom.DoFillRect(const ARect: TRectF;
2096
2098
end ;
2097
2099
end ;
2098
2100
2101
+ procedure TSkCanvasCustom.DoFillRoundRect (const ARect: TRectF; const XRadius, YRadius: Single; const ACorners: TCorners;
2102
+ const AOpacity: Single; const ABrush: TBrush; const ACornerType: TCornerType);
2103
+ var
2104
+ LBrushData: TBrushData;
2105
+ LPaint: TSkPaint;
2106
+ LRoundRectRadii: TSkRoundRectRadii;
2107
+ begin
2108
+ if ACornerType <> TCornerType.Round then
2109
+ inherited
2110
+ else
2111
+ begin
2112
+ LPaint := BeginPaintWithBrush(ABrush, ARect, AOpacity, LBrushData);
2113
+ if LPaint <> nil then
2114
+ try
2115
+ if ACorners = AllCorners then
2116
+ Canvas.DrawRoundRect(ARect, XRadius, YRadius, LPaint)
2117
+ else
2118
+ begin
2119
+ FillChar(LRoundRectRadii, SizeOf(LRoundRectRadii), 0 );
2120
+ if TCorner.TopLeft in ACorners then
2121
+ LRoundRectRadii[TSkRoundRectCorner.UpperLeft] := PointF(XRadius, YRadius);
2122
+ if TCorner.TopRight in ACorners then
2123
+ LRoundRectRadii[TSkRoundRectCorner.UpperRight] := PointF(XRadius, YRadius);
2124
+ if TCorner.BottomLeft in ACorners then
2125
+ LRoundRectRadii[TSkRoundRectCorner.LowerLeft] := PointF(XRadius, YRadius);
2126
+ if TCorner.BottomRight in ACorners then
2127
+ LRoundRectRadii[TSkRoundRectCorner.LowerRight] := PointF(XRadius, YRadius);
2128
+ Canvas.DrawRoundRect(TSkRoundRect.Create(ARect, LRoundRectRadii), LPaint);
2129
+ end ;
2130
+ finally
2131
+ EndPaint(LBrushData);
2132
+ end ;
2133
+ end ;
2134
+ end ;
2135
+
2099
2136
class procedure TSkCanvasCustom.DoFinalizeBitmap (var ABitmapHandle: THandle);
2100
2137
begin
2101
2138
end ;
0 commit comments