347 :(
const flutter::DlRoundRect&)clipDlRRect matrix:(
const flutter::DlMatrix&)matrix {
348 if (clipDlRRect.IsEmpty()) {
350 }
else if (clipDlRRect.IsRect()) {
351 [
self clipRect:clipDlRRect.GetBounds() matrix:matrix];
354 CGPathRef pathRef =
nullptr;
357 if (clipDlRRect.GetRadii().AreAllCornersSame()) {
359 auto radii = clipDlRRect.GetRadii();
361 CGPathCreateWithRoundedRect(clipRect, radii.top_left.width, radii.top_left.height, nil);
363 CGMutablePathRef mutablePathRef = CGPathCreateMutable();
365 flutter::DlRect clipDlRect = clipDlRRect.GetBounds();
366 auto left = clipDlRect.GetLeft();
367 auto top = clipDlRect.GetTop();
368 auto right = clipDlRect.GetRight();
369 auto bottom = clipDlRect.GetBottom();
370 flutter::DlRoundingRadii radii = clipDlRRect.GetRadii();
371 auto& top_left = radii.top_left;
372 auto& top_right = radii.top_right;
373 auto& bottom_left = radii.bottom_left;
374 auto& bottom_right = radii.bottom_right;
381 CGPathMoveToPoint(mutablePathRef, nil,
382 left + top_left.width, top);
384 CGPathAddLineToPoint(mutablePathRef, nil,
385 right - top_right.width, top);
386 CGPathAddCurveToPoint(mutablePathRef, nil,
388 right, top + top_right.height,
389 right, top + top_right.height);
391 CGPathAddLineToPoint(mutablePathRef, nil,
392 right, bottom - bottom_right.height);
393 CGPathAddCurveToPoint(mutablePathRef, nil,
395 right - bottom_right.width, bottom,
396 right - bottom_right.width, bottom);
398 CGPathAddLineToPoint(mutablePathRef, nil,
399 left + bottom_left.width, bottom);
400 CGPathAddCurveToPoint(mutablePathRef, nil,
402 left, bottom - bottom_left.height,
403 left, bottom - bottom_left.height);
405 CGPathAddLineToPoint(mutablePathRef, nil,
406 left, top + top_left.height);
407 CGPathAddCurveToPoint(mutablePathRef, nil,
409 left + top_left.width, top,
410 left + top_left.width, top);
411 CGPathCloseSubpath(mutablePathRef);
412 pathRef = mutablePathRef;
415 CATransform3D matrixInPoints =
420 paths_.push_back([
self getTransformedPath:pathRef matrix:matrixInPoints]);