Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 #ifndef SkClipStack_DEFINED | 8 #ifndef SkClipStack_DEFINED |
| 9 #define SkClipStack_DEFINED | 9 #define SkClipStack_DEFINED |
| 10 | 10 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 91 SkASSERT(kRect_Type == fType && (fRRect.isRect() || fRRect.isEmpty() )); | 91 SkASSERT(kRect_Type == fType && (fRRect.isRect() || fRRect.isEmpty() )); |
| 92 return fRRect.getBounds(); | 92 return fRRect.getBounds(); |
| 93 } | 93 } |
| 94 | 94 |
| 95 //!< Call if getType() is not kEmpty to get the set operation used to co mbine this element. | 95 //!< Call if getType() is not kEmpty to get the set operation used to co mbine this element. |
| 96 SkRegion::Op getOp() const { return fOp; } | 96 SkRegion::Op getOp() const { return fOp; } |
| 97 | 97 |
| 98 //!< Call to get the element as a path, regardless of its type. | 98 //!< Call to get the element as a path, regardless of its type. |
| 99 void asPath(SkPath* path) const; | 99 void asPath(SkPath* path) const; |
| 100 | 100 |
| 101 //!< Call to get the element as a round rect. Returns nullptr if this is not satisfiable. | |
| 102 const SkRRect* asRRect() const { | |
|
bsalomon
2016/03/16 13:17:11
Maybe we should just loosen the restrictions on wh
Chris Dalton
2016/03/16 15:17:56
Right, I gave it the "as" name because they both h
| |
| 103 switch (fType) { | |
| 104 case kRect_Type: | |
| 105 SkASSERT(SkRRect::kRect_Type == fRRect.getType()); | |
| 106 // fallthrough | |
| 107 case kRRect_Type: | |
| 108 return &fRRect; | |
| 109 default: | |
| 110 return nullptr; | |
| 111 } | |
| 112 } | |
| 113 | |
| 101 /** If getType() is not kEmpty this indicates whether the clip shape sho uld be anti-aliased | 114 /** If getType() is not kEmpty this indicates whether the clip shape sho uld be anti-aliased |
| 102 when it is rasterized. */ | 115 when it is rasterized. */ |
| 103 bool isAA() const { return fDoAA; } | 116 bool isAA() const { return fDoAA; } |
| 104 | 117 |
| 105 //!< Inverts the fill of the clip shape. Note that a kEmpty element rema ins kEmpty. | 118 //!< Inverts the fill of the clip shape. Note that a kEmpty element rema ins kEmpty. |
| 106 void invertShapeFillType(); | 119 void invertShapeFillType(); |
| 107 | 120 |
| 108 //!< Sets the set operation represented by the element. | 121 //!< Sets the set operation represented by the element. |
| 109 void setOp(SkRegion::Op op) { fOp = op; } | 122 void setOp(SkRegion::Op op) { fOp = op; } |
| 110 | 123 |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 468 */ | 481 */ |
| 469 void restoreTo(int saveCount); | 482 void restoreTo(int saveCount); |
| 470 | 483 |
| 471 /** | 484 /** |
| 472 * Return the next unique generation ID. | 485 * Return the next unique generation ID. |
| 473 */ | 486 */ |
| 474 static int32_t GetNextGenID(); | 487 static int32_t GetNextGenID(); |
| 475 }; | 488 }; |
| 476 | 489 |
| 477 #endif | 490 #endif |
| OLD | NEW |