316 :(
const SkRRect&)clipSkRRect matrix:(
const SkMatrix&)matrix {
317 CGPathRef pathRef =
nullptr;
318 switch (clipSkRRect.getType()) {
319 case SkRRect::kEmpty_Type: {
322 case SkRRect::kRect_Type: {
323 [
self clipRect:clipSkRRect.rect() matrix:matrix];
326 case SkRRect::kOval_Type:
327 case SkRRect::kSimple_Type: {
329 pathRef = CGPathCreateWithRoundedRect(clipRect, clipSkRRect.getSimpleRadii().x(),
330 clipSkRRect.getSimpleRadii().y(), nil);
333 case SkRRect::kNinePatch_Type:
334 case SkRRect::kComplex_Type: {
335 CGMutablePathRef mutablePathRef = CGPathCreateMutable();
337 SkRect clipSkRect = clipSkRRect.rect();
338 SkVector topLeftRadii = clipSkRRect.radii(SkRRect::kUpperLeft_Corner);
339 SkVector topRightRadii = clipSkRRect.radii(SkRRect::kUpperRight_Corner);
340 SkVector bottomRightRadii = clipSkRRect.radii(SkRRect::kLowerRight_Corner);
341 SkVector bottomLeftRadii = clipSkRRect.radii(SkRRect::kLowerLeft_Corner);
345 CGPathMoveToPoint(mutablePathRef, nil, clipSkRect.fLeft + topLeftRadii.x(), clipSkRect.fTop);
347 CGPathAddLineToPoint(mutablePathRef, nil, clipSkRect.fRight - topRightRadii.x(),
349 CGPathAddCurveToPoint(mutablePathRef, nil, clipSkRect.fRight, clipSkRect.fTop,
350 clipSkRect.fRight, clipSkRect.fTop + topRightRadii.y(),
351 clipSkRect.fRight, clipSkRect.fTop + topRightRadii.y());
353 CGPathAddLineToPoint(mutablePathRef, nil, clipSkRect.fRight,
354 clipSkRect.fBottom - bottomRightRadii.y());
355 CGPathAddCurveToPoint(mutablePathRef, nil, clipSkRect.fRight, clipSkRect.fBottom,
356 clipSkRect.fRight - bottomRightRadii.x(), clipSkRect.fBottom,
357 clipSkRect.fRight - bottomRightRadii.x(), clipSkRect.fBottom);
359 CGPathAddLineToPoint(mutablePathRef, nil, clipSkRect.fLeft + bottomLeftRadii.x(),
361 CGPathAddCurveToPoint(mutablePathRef, nil, clipSkRect.fLeft, clipSkRect.fBottom,
362 clipSkRect.fLeft, clipSkRect.fBottom - bottomLeftRadii.y(),
363 clipSkRect.fLeft, clipSkRect.fBottom - bottomLeftRadii.y());
365 CGPathAddLineToPoint(mutablePathRef, nil, clipSkRect.fLeft,
366 clipSkRect.fTop + topLeftRadii.y());
367 CGPathAddCurveToPoint(mutablePathRef, nil, clipSkRect.fLeft, clipSkRect.fTop,
368 clipSkRect.fLeft + topLeftRadii.x(), clipSkRect.fTop,
369 clipSkRect.fLeft + topLeftRadii.x(), clipSkRect.fTop);
370 CGPathCloseSubpath(mutablePathRef);
372 pathRef = mutablePathRef;
377 CATransform3D matrixInPoints =
382 paths_.push_back([
self getTransformedPath:pathRef matrix:matrixInPoints]);