OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
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 #include "SkAtomics.h" | 8 #include "SkAtomics.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkClipStack.h" | 10 #include "SkClipStack.h" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 fPath.set(path); | 129 fPath.set(path); |
130 fPath.get()->setIsVolatile(true); | 130 fPath.get()->setIsVolatile(true); |
131 fType = kPath_Type; | 131 fType = kPath_Type; |
132 this->initCommon(saveCount, op, doAA); | 132 this->initCommon(saveCount, op, doAA); |
133 } | 133 } |
134 | 134 |
135 void SkClipStack::Element::asPath(SkPath* path) const { | 135 void SkClipStack::Element::asPath(SkPath* path) const { |
136 switch (fType) { | 136 switch (fType) { |
137 case kEmpty_Type: | 137 case kEmpty_Type: |
138 path->reset(); | 138 path->reset(); |
139 path->setIsVolatile(true); | |
140 break; | 139 break; |
141 case kRect_Type: | 140 case kRect_Type: |
142 path->reset(); | 141 path->reset(); |
143 path->addRect(this->getRect()); | 142 path->addRect(this->getRect()); |
144 path->setIsVolatile(true); | |
145 break; | 143 break; |
146 case kRRect_Type: | 144 case kRRect_Type: |
147 path->reset(); | 145 path->reset(); |
148 path->addRRect(fRRect); | 146 path->addRRect(fRRect); |
149 path->setIsVolatile(true); | |
150 break; | 147 break; |
151 case kPath_Type: | 148 case kPath_Type: |
152 *path = *fPath.get(); | 149 *path = *fPath.get(); |
153 break; | 150 break; |
154 } | 151 } |
155 path->setIsVolatile(true); | 152 path->setIsVolatile(true); |
156 } | 153 } |
157 | 154 |
158 void SkClipStack::Element::setEmpty() { | 155 void SkClipStack::Element::setEmpty() { |
159 fType = kEmpty_Type; | 156 fType = kEmpty_Type; |
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
909 | 906 |
910 void SkClipStack::dump() const { | 907 void SkClipStack::dump() const { |
911 B2TIter iter(*this); | 908 B2TIter iter(*this); |
912 const Element* e; | 909 const Element* e; |
913 while ((e = iter.next())) { | 910 while ((e = iter.next())) { |
914 e->dump(); | 911 e->dump(); |
915 SkDebugf("\n"); | 912 SkDebugf("\n"); |
916 } | 913 } |
917 } | 914 } |
918 #endif | 915 #endif |
OLD | NEW |