342 if (clipDlRRect.IsEmpty()) {
343 return;
344 }
else if (clipDlRRect.
IsRect()) {
345 [self clipRect:clipDlRRect.GetBounds() matrix:matrix];
346 return;
347 } else {
348 CGPathRef pathRef = nullptr;
350
353 auto radii = clipDlRRect.
GetRadii();
354 pathRef =
355 CGPathCreateWithRoundedRect(clipRect, radii.top_left.width, radii.top_left.height, nil);
356 } else {
357 CGMutablePathRef mutablePathRef = CGPathCreateMutable();
358
361 auto top = clipDlRect.
GetTop();
369
370
371
372
373
374
375 CGPathMoveToPoint(mutablePathRef, nil,
376 left + top_left.width, top);
377
378 CGPathAddLineToPoint(mutablePathRef, nil,
379 right - top_right.width, top);
380 CGPathAddCurveToPoint(mutablePathRef, nil,
381 right, top,
382 right, top + top_right.height,
383 right, top + top_right.height);
384
385 CGPathAddLineToPoint(mutablePathRef, nil,
386 right, bottom - bottom_right.height);
387 CGPathAddCurveToPoint(mutablePathRef, nil,
388 right, bottom,
389 right - bottom_right.width, bottom,
390 right - bottom_right.width, bottom);
391
392 CGPathAddLineToPoint(mutablePathRef, nil,
393 left + bottom_left.width, bottom);
394 CGPathAddCurveToPoint(mutablePathRef, nil,
395 left, bottom,
396 left, bottom - bottom_left.height,
397 left, bottom - bottom_left.height);
398
399 CGPathAddLineToPoint(mutablePathRef, nil,
400 left, top + top_left.height);
401 CGPathAddCurveToPoint(mutablePathRef, nil,
402 left, top,
403 left + top_left.width, top,
404 left + top_left.width, top);
405 CGPathCloseSubpath(mutablePathRef);
406 pathRef = mutablePathRef;
407 }
408
409 CATransform3D matrixInPoints =
411
412
413
414 paths_.push_back([self getTransformedPath:pathRef matrix:matrixInPoints]);
415 }
416}
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