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 #include "SkClipStack.h" | 8 #include "SkClipStack.h" |
9 #include "SkPath.h" | 9 #include "SkPath.h" |
10 #include "SkThread.h" | 10 #include "SkThread.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 case kRRect_Type: | 96 case kRRect_Type: |
97 path->reset(); | 97 path->reset(); |
98 path->addRRect(fRRect); | 98 path->addRRect(fRRect); |
99 break; | 99 break; |
100 case kPath_Type: | 100 case kPath_Type: |
101 *path = fPath; | 101 *path = fPath; |
102 break; | 102 break; |
103 } | 103 } |
104 } | 104 } |
105 | 105 |
| 106 void SkClipStack::Element::setEmpty() { |
| 107 fType = kEmpty_Type; |
| 108 fFiniteBound.setEmpty(); |
| 109 fFiniteBoundType = kNormal_BoundsType; |
| 110 fIsIntersectionOfRects = false; |
| 111 fRect.setEmpty(); |
| 112 fRRect.setEmpty(); |
| 113 fPath.reset(); |
| 114 fGenID = kEmptyGenID; |
| 115 SkDEBUGCODE(this->checkEmpty();) |
| 116 } |
| 117 |
106 void SkClipStack::Element::checkEmpty() const { | 118 void SkClipStack::Element::checkEmpty() const { |
107 SkASSERT(fFiniteBound.isEmpty()); | 119 SkASSERT(fFiniteBound.isEmpty()); |
108 SkASSERT(kNormal_BoundsType == fFiniteBoundType); | 120 SkASSERT(kNormal_BoundsType == fFiniteBoundType); |
109 SkASSERT(!fIsIntersectionOfRects); | 121 SkASSERT(!fIsIntersectionOfRects); |
110 SkASSERT(kEmptyGenID == fGenID); | 122 SkASSERT(kEmptyGenID == fGenID); |
111 SkASSERT(fPath.isEmpty()); | 123 SkASSERT(fPath.isEmpty()); |
112 } | 124 } |
113 | 125 |
114 bool SkClipStack::Element::canBeIntersectedInPlace(int saveCount, SkRegion::Op o
p) const { | 126 bool SkClipStack::Element::canBeIntersectedInPlace(int saveCount, SkRegion::Op o
p) const { |
115 if (kEmpty_Type == fType && | 127 if (kEmpty_Type == fType && |
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
780 return kWideOpenGenID; | 792 return kWideOpenGenID; |
781 } | 793 } |
782 | 794 |
783 const Element* back = static_cast<const Element*>(fDeque.back()); | 795 const Element* back = static_cast<const Element*>(fDeque.back()); |
784 if (kInsideOut_BoundsType == back->fFiniteBoundType && back->fFiniteBound.is
Empty()) { | 796 if (kInsideOut_BoundsType == back->fFiniteBoundType && back->fFiniteBound.is
Empty()) { |
785 return kWideOpenGenID; | 797 return kWideOpenGenID; |
786 } | 798 } |
787 | 799 |
788 return back->getGenID(); | 800 return back->getGenID(); |
789 } | 801 } |
OLD | NEW |