345 :(
const flutter::DlRoundRect&)clipDlRRect matrix:(
const flutter::DlMatrix&)matrix {
346 if (clipDlRRect.IsEmpty()) {
348 }
else if (clipDlRRect.IsRect()) {
349 [
self clipRect:clipDlRRect.GetBounds() matrix:matrix];
352 CGPathRef pathRef =
nullptr;
355 if (clipDlRRect.GetRadii().AreAllCornersSame()) {
357 auto radii = clipDlRRect.GetRadii();
359 CGPathCreateWithRoundedRect(clipRect, radii.top_left.width, radii.top_left.height, nil);
361 CGMutablePathRef mutablePathRef = CGPathCreateMutable();
363 flutter::DlRect clipDlRect = clipDlRRect.GetBounds();
364 auto left = clipDlRect.GetLeft();
365 auto top = clipDlRect.GetTop();
366 auto right = clipDlRect.GetRight();
367 auto bottom = clipDlRect.GetBottom();
368 flutter::DlRoundingRadii radii = clipDlRRect.GetRadii();
369 auto& top_left = radii.top_left;
370 auto& top_right = radii.top_right;
371 auto& bottom_left = radii.bottom_left;
372 auto& bottom_right = radii.bottom_right;
379 CGPathMoveToPoint(mutablePathRef, nil,
380 left + top_left.width, top);
382 CGPathAddLineToPoint(mutablePathRef, nil,
383 right - top_right.width, top);
384 CGPathAddCurveToPoint(mutablePathRef, nil,
386 right, top + top_right.height,
387 right, top + top_right.height);
389 CGPathAddLineToPoint(mutablePathRef, nil,
390 right, bottom - bottom_right.height);
391 CGPathAddCurveToPoint(mutablePathRef, nil,
393 right - bottom_right.width, bottom,
394 right - bottom_right.width, bottom);
396 CGPathAddLineToPoint(mutablePathRef, nil,
397 left + bottom_left.width, bottom);
398 CGPathAddCurveToPoint(mutablePathRef, nil,
400 left, bottom - bottom_left.height,
401 left, bottom - bottom_left.height);
403 CGPathAddLineToPoint(mutablePathRef, nil,
404 left, top + top_left.height);
405 CGPathAddCurveToPoint(mutablePathRef, nil,
407 left + top_left.width, top,
408 left + top_left.width, top);
409 CGPathCloseSubpath(mutablePathRef);
410 pathRef = mutablePathRef;
413 CATransform3D matrixInPoints =
418 paths_.push_back([
self getTransformedPath:pathRef matrix:matrixInPoints]);