Home | History | Annotate | Download | only in core

Lines Matching refs:rect

347 void SkPath::addRect(const SkRect& rect, Direction dir) {
348 this->addRect(rect.fLeft, rect.fTop, rect.fRight, rect.fBottom, dir);
372 void SkPath::addRoundRect(const SkRect& rect, SkScalar rx, SkScalar ry,
374 SkAutoPathBoundsUpdate apbu(this, rect);
376 SkScalar w = rect.width();
378 SkScalar h = rect.height();
389 this->addOval(rect, dir);
402 this->moveTo(rect.fRight - rx, rect.fTop);
405 this->lineTo(rect.fLeft + rx, rect.fTop); // top
407 this->cubicTo(rect.fLeft + rx - sx, rect.fTop,
408 rect.fLeft, rect.fTop + ry - sy,
409 rect.fLeft, rect.fTop + ry); // top-left
411 this->lineTo(rect.fLeft, rect.fBottom - ry); // left
413 this->cubicTo(rect.fLeft, rect.fBottom - ry + sy,
414 rect.fLeft + rx - sx, rect.fBottom,
415 rect.fLeft + rx, rect.fBottom); // bot-left
417 this->lineTo(rect.fRight - rx, rect.fBottom); // bottom
419 this->cubicTo(rect.fRight - rx + sx, rect.fBottom,
420 rect.fRight, rect.fBottom - ry + sy,
421 rect.fRight, rect.fBottom - ry); // bot-right
423 this->lineTo(rect.fRight, rect.fTop + ry);
425 this->cubicTo(rect.fRight, rect.fTop + ry - sy,
426 rect.fRight - rx + sx, rect.fTop,
427 rect.fRight - rx, rect.fTop); // top-right
429 this->cubicTo(rect.fRight - rx + sx, rect.fTop,
430 rect.fRight, rect.fTop + ry - sy,
431 rect.fRight, rect.fTop + ry); // top-right
433 this->lineTo(rect.fRight, rect.fBottom - ry);
435 this->cubicTo(rect.fRight, rect.fBottom - ry + sy,
436 rect.fRight - rx + sx, rect.fBottom,
437 rect.fRight - rx, rect.fBottom); // bot-right
439 this->lineTo(rect.fLeft + rx, rect.fBottom); // bottom
441 this->cubicTo(rect.fLeft + rx - sx, rect.fBottom,
442 rect.fLeft, rect.fBottom - ry + sy,
443 rect.fLeft, rect.fBottom - ry); // bot-left
445 this->lineTo(rect.fLeft, rect.fTop + ry); // left
447 this->cubicTo(rect.fLeft, rect.fTop + ry - sy,
448 rect.fLeft + rx - sx, rect.fTop,
449 rect.fLeft + rx, rect.fTop); // top-left
451 this->lineTo(rect.fRight - rx, rect.fTop); // top
457 static void add_corner_arc(SkPath* path, const SkRect& rect,
460 rx = SkMinScalar(SkScalarHalf(rect.width()), rx);
461 ry = SkMinScalar(SkScalarHalf(rect.height()), ry);
468 r.offset(rect.fRight - r.fRight, rect.fBottom - r.fBottom);
471 r.offset(rect.fLeft - r.fLeft, rect.fBottom - r.fBottom);
473 case 180: r.offset(rect.fLeft - r.fLeft, rect.fTop - r.fTop); break;
474 case 270: r.offset(rect.fRight - r.fRight, rect.fTop - r.fTop); break;
488 void SkPath::addRoundRect(const SkRect& rect, const SkScalar rad[],
490 SkAutoPathBoundsUpdate apbu(this, rect);
493 add_corner_arc(this, rect, rad[0], rad[1], 180, dir, true);
494 add_corner_arc(this, rect, rad[2], rad[3], 270, dir, false);
495 add_corner_arc(this, rect, rad[4], rad[5], 0, dir, false);
496 add_corner_arc(this, rect, rad[6], rad[7], 90, dir, false);
498 add_corner_arc(this, rect, rad[0], rad[1], 180, dir, true);
499 add_corner_arc(this, rect, rad[6], rad[7], 90, dir, false);
500 add_corner_arc(this, rect, rad[4], rad[5], 0, dir, false);
501 add_corner_arc(this, rect, rad[2], rad[3], 270, dir, false);
574 SkRect rect;
575 rect.set(x - r, y - r, x + r, y + r);
576 this->addOval(rect, dir);