348 if (clipDlRRect.IsEmpty()) {
349 return;
350 }
else if (clipDlRRect.
IsRect()) {
351 [self clipRect:clipDlRRect.GetBounds() matrix:matrix];
352 return;
353 } else {
354 CGPathRef pathRef = nullptr;
356
359 auto radii = clipDlRRect.
GetRadii();
360 pathRef =
361 CGPathCreateWithRoundedRect(clipRect, radii.top_left.width, radii.top_left.height, nil);
362 } else {
363 CGMutablePathRef mutablePathRef = CGPathCreateMutable();
364
367 auto top = clipDlRect.
GetTop();
375
376
377
378
379
380
381 CGPathMoveToPoint(mutablePathRef, nil,
382 left + top_left.width, top);
383
384 CGPathAddLineToPoint(mutablePathRef, nil,
385 right - top_right.width, top);
386 CGPathAddCurveToPoint(mutablePathRef, nil,
387 right, top,
388 right, top + top_right.height,
389 right, top + top_right.height);
390
391 CGPathAddLineToPoint(mutablePathRef, nil,
392 right, bottom - bottom_right.height);
393 CGPathAddCurveToPoint(mutablePathRef, nil,
394 right, bottom,
395 right - bottom_right.width, bottom,
396 right - bottom_right.width, bottom);
397
398 CGPathAddLineToPoint(mutablePathRef, nil,
399 left + bottom_left.width, bottom);
400 CGPathAddCurveToPoint(mutablePathRef, nil,
401 left, bottom,
402 left, bottom - bottom_left.height,
403 left, bottom - bottom_left.height);
404
405 CGPathAddLineToPoint(mutablePathRef, nil,
406 left, top + top_left.height);
407 CGPathAddCurveToPoint(mutablePathRef, nil,
408 left, top,
409 left + top_left.width, top,
410 left + top_left.width, top);
411 CGPathCloseSubpath(mutablePathRef);
412 pathRef = mutablePathRef;
413 }
414
415 CATransform3D matrixInPoints =
417
418
419
420 paths_.push_back([self getTransformedPath:pathRef matrix:matrixInPoints]);
421 }
422}
constexpr bool IsRect() const
constexpr const RoundingRadii & GetRadii() const
constexpr const Rect & GetBounds() const
constexpr bool AreAllCornersSame(Scalar tolerance=kEhCloseEnough) const
constexpr auto GetBottom() const
constexpr auto GetTop() const
constexpr auto GetLeft() const
constexpr auto GetRight() const