OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkCanvas_DEFINED | 8 #ifndef SkCanvas_DEFINED |
9 #define SkCanvas_DEFINED | 9 #define SkCanvas_DEFINED |
10 | 10 |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 */ | 492 */ |
493 sk_sp<SkLights> getLights() const; | 493 sk_sp<SkLights> getLights() const; |
494 #endif | 494 #endif |
495 | 495 |
496 /** | 496 /** |
497 * Modify the current clip with the specified rectangle. | 497 * Modify the current clip with the specified rectangle. |
498 * @param rect The rect to combine with the current clip | 498 * @param rect The rect to combine with the current clip |
499 * @param op The region op to apply to the current clip | 499 * @param op The region op to apply to the current clip |
500 * @param doAntiAlias true if the clip should be antialiased | 500 * @param doAntiAlias true if the clip should be antialiased |
501 */ | 501 */ |
502 void clipRect(const SkRect& rect, ClipOp op = kIntersect_Op, bool doAntiAlia
s = false); | 502 void clipRect(const SkRect& rect, ClipOp, bool doAntiAlias); |
| 503 void clipRect(const SkRect& rect, ClipOp op) { |
| 504 this->clipRect(rect, op, false); |
| 505 } |
| 506 void clipRect(const SkRect& rect, bool doAntiAlias = false) { |
| 507 this->clipRect(rect, kIntersect_Op, doAntiAlias); |
| 508 } |
503 | 509 |
504 /** | 510 /** |
505 * Modify the current clip with the specified SkRRect. | 511 * Modify the current clip with the specified SkRRect. |
506 * @param rrect The rrect to combine with the current clip | 512 * @param rrect The rrect to combine with the current clip |
507 * @param op The region op to apply to the current clip | 513 * @param op The region op to apply to the current clip |
508 * @param doAntiAlias true if the clip should be antialiased | 514 * @param doAntiAlias true if the clip should be antialiased |
509 */ | 515 */ |
510 void clipRRect(const SkRRect& rrect, ClipOp op = kIntersect_Op, bool doAntiA
lias = false); | 516 void clipRRect(const SkRRect& rrect, ClipOp op, bool doAntiAlias); |
| 517 void clipRRect(const SkRRect& rrect, ClipOp op) { |
| 518 this->clipRRect(rrect, op, false); |
| 519 } |
| 520 void clipRRect(const SkRRect& rrect, bool doAntiAlias = false) { |
| 521 this->clipRRect(rrect, kIntersect_Op, doAntiAlias); |
| 522 } |
511 | 523 |
512 /** | 524 /** |
513 * Modify the current clip with the specified path. | 525 * Modify the current clip with the specified path. |
514 * @param path The path to combine with the current clip | 526 * @param path The path to combine with the current clip |
515 * @param op The region op to apply to the current clip | 527 * @param op The region op to apply to the current clip |
516 * @param doAntiAlias true if the clip should be antialiased | 528 * @param doAntiAlias true if the clip should be antialiased |
517 */ | 529 */ |
518 void clipPath(const SkPath& path, ClipOp op = kIntersect_Op, bool doAntiAlia
s = false); | 530 void clipPath(const SkPath& path, ClipOp op, bool doAntiAlias); |
| 531 void clipPath(const SkPath& path, ClipOp op) { |
| 532 this->clipPath(path, op, false); |
| 533 } |
| 534 void clipPath(const SkPath& path, bool doAntiAlias = false) { |
| 535 this->clipPath(path, kIntersect_Op, doAntiAlias); |
| 536 } |
519 | 537 |
520 /** EXPERIMENTAL -- only used for testing | 538 /** EXPERIMENTAL -- only used for testing |
521 Set to false to force clips to be hard, even if doAntiAlias=true is | 539 Set to false to force clips to be hard, even if doAntiAlias=true is |
522 passed to clipRect or clipPath. | 540 passed to clipRect or clipPath. |
523 */ | 541 */ |
524 void setAllowSoftClip(bool allow) { | 542 void setAllowSoftClip(bool allow) { |
525 fAllowSoftClip = allow; | 543 fAllowSoftClip = allow; |
526 } | 544 } |
527 | 545 |
528 /** EXPERIMENTAL -- only used for testing | 546 /** EXPERIMENTAL -- only used for testing |
(...skipping 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1737 | 1755 |
1738 class SkCanvasClipVisitor { | 1756 class SkCanvasClipVisitor { |
1739 public: | 1757 public: |
1740 virtual ~SkCanvasClipVisitor(); | 1758 virtual ~SkCanvasClipVisitor(); |
1741 virtual void clipRect(const SkRect&, SkCanvas::ClipOp, bool antialias) = 0; | 1759 virtual void clipRect(const SkRect&, SkCanvas::ClipOp, bool antialias) = 0; |
1742 virtual void clipRRect(const SkRRect&, SkCanvas::ClipOp, bool antialias) = 0
; | 1760 virtual void clipRRect(const SkRRect&, SkCanvas::ClipOp, bool antialias) = 0
; |
1743 virtual void clipPath(const SkPath&, SkCanvas::ClipOp, bool antialias) = 0; | 1761 virtual void clipPath(const SkPath&, SkCanvas::ClipOp, bool antialias) = 0; |
1744 }; | 1762 }; |
1745 | 1763 |
1746 #endif | 1764 #endif |
OLD | NEW |