Lines Matching defs:rect
386 void SkPath::addRect(const SkRect& rect, Direction dir) {
387 this->addRect(rect.fLeft, rect.fTop, rect.fRight, rect.fBottom, dir);
411 void SkPath::addRoundRect(const SkRect& rect, SkScalar rx, SkScalar ry,
413 SkScalar w = rect.width();
415 SkScalar h = rect.height();
426 this->addOval(rect, dir);
430 SkAutoPathBoundsUpdate apbu(this, rect);
442 this->moveTo(rect.fRight - rx, rect.fTop);
445 this->lineTo(rect.fLeft + rx, rect.fTop); // top
447 this->cubicTo(rect.fLeft + rx - sx, rect.fTop,
448 rect.fLeft, rect.fTop + ry - sy,
449 rect.fLeft, rect.fTop + ry); // top-left
451 this->lineTo(rect.fLeft, rect.fBottom - ry); // left
453 this->cubicTo(rect.fLeft, rect.fBottom - ry + sy,
454 rect.fLeft + rx - sx, rect.fBottom,
455 rect.fLeft + rx, rect.fBottom); // bot-left
457 this->lineTo(rect.fRight - rx, rect.fBottom); // bottom
459 this->cubicTo(rect.fRight - rx + sx, rect.fBottom,
460 rect.fRight, rect.fBottom - ry + sy,
461 rect.fRight, rect.fBottom - ry); // bot-right
463 this->lineTo(rect.fRight, rect.fTop + ry);
465 this->cubicTo(rect.fRight, rect.fTop + ry - sy,
466 rect.fRight - rx + sx, rect.fTop,
467 rect.fRight - rx, rect.fTop); // top-right
469 this->cubicTo(rect.fRight - rx + sx, rect.fTop,
470 rect.fRight, rect.fTop + ry - sy,
471 rect.fRight, rect.fTop + ry); // top-right
473 this->lineTo(rect.fRight, rect.fBottom - ry);
475 this->cubicTo(rect.fRight, rect.fBottom - ry + sy,
476 rect.fRight - rx + sx, rect.fBottom,
477 rect.fRight - rx, rect.fBottom); // bot-right
479 this->lineTo(rect.fLeft + rx, rect.fBottom); // bottom
481 this->cubicTo(rect.fLeft + rx - sx, rect.fBottom,
482 rect.fLeft, rect.fBottom - ry + sy,
483 rect.fLeft, rect.fBottom - ry); // bot-left
485 this->lineTo(rect.fLeft, rect.fTop + ry); // left
487 this->cubicTo(rect.fLeft, rect.fTop + ry - sy,
488 rect.fLeft + rx - sx, rect.fTop,
489 rect.fLeft + rx, rect.fTop); // top-left
491 this->lineTo(rect.fRight - rx, rect.fTop); // top
497 static void add_corner_arc(SkPath* path, const SkRect& rect,
500 rx = SkMinScalar(SkScalarHalf(rect.width()), rx);
501 ry = SkMinScalar(SkScalarHalf(rect.height()), ry);
508 r.offset(rect.fRight - r.fRight, rect.fBottom - r.fBottom);
511 r.offset(rect.fLeft - r.fLeft, rect.fBottom - r.fBottom);
513 case 180: r.offset(rect.fLeft - r.fLeft, rect.fTop - r.fTop); break;
514 case 270: r.offset(rect.fRight - r.fRight, rect.fTop - r.fTop); break;
528 void SkPath::addRoundRect(const SkRect& rect, const SkScalar rad[],
531 if (rect.isEmpty()) {
535 SkAutoPathBoundsUpdate apbu(this, rect);
538 add_corner_arc(this, rect, rad[0], rad[1], 180, dir, true);
539 add_corner_arc(this, rect, rad[2], rad[3], 270, dir, false);
540 add_corner_arc(this, rect, rad[4], rad[5], 0, dir, false);
541 add_corner_arc(this, rect, rad[6], rad[7], 90, dir, false);
543 add_corner_arc(this, rect, rad[0], rad[1], 180, dir, true);
544 add_corner_arc(this, rect, rad[6], rad[7], 90, dir, false);
545 add_corner_arc(this, rect, rad[4], rad[5], 0, dir, false);
546 add_corner_arc(this, rect, rad[2], rad[3], 270, dir, false);
619 SkRect rect;
620 rect.set(x - r, y - r, x + r, y + r);
621 this->addOval(rect, dir);