337 if (clipDlRRect.IsEmpty()) {
338 return;
339 }
else if (clipDlRRect.
IsRect()) {
340 [self clipRect:clipDlRRect.GetBounds() matrix:matrix];
341 return;
342 } else {
343 CGPathRef pathRef = nullptr;
345
348 auto radii = clipDlRRect.
GetRadii();
349 pathRef =
350 CGPathCreateWithRoundedRect(clipRect, radii.top_left.width, radii.top_left.height, nil);
351 } else {
352 CGMutablePathRef mutablePathRef = CGPathCreateMutable();
353
356 auto top = clipDlRect.
GetTop();
364
365
366
367
368
369
370 CGPathMoveToPoint(mutablePathRef, nil,
371 left + top_left.width, top);
372
373 CGPathAddLineToPoint(mutablePathRef, nil,
374 right - top_right.width, top);
375 CGPathAddCurveToPoint(mutablePathRef, nil,
376 right, top,
377 right, top + top_right.height,
378 right, top + top_right.height);
379
380 CGPathAddLineToPoint(mutablePathRef, nil,
381 right, bottom - bottom_right.height);
382 CGPathAddCurveToPoint(mutablePathRef, nil,
383 right, bottom,
384 right - bottom_right.width, bottom,
385 right - bottom_right.width, bottom);
386
387 CGPathAddLineToPoint(mutablePathRef, nil,
388 left + bottom_left.width, bottom);
389 CGPathAddCurveToPoint(mutablePathRef, nil,
390 left, bottom,
391 left, bottom - bottom_left.height,
392 left, bottom - bottom_left.height);
393
394 CGPathAddLineToPoint(mutablePathRef, nil,
395 left, top + top_left.height);
396 CGPathAddCurveToPoint(mutablePathRef, nil,
397 left, top,
398 left + top_left.width, top,
399 left + top_left.width, top);
400 CGPathCloseSubpath(mutablePathRef);
401 pathRef = mutablePathRef;
402 }
403
404 CATransform3D matrixInPoints =
406
407
408
409 paths_.push_back([self getTransformedPath:pathRef matrix:matrixInPoints]);
410 }
411}
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