| 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 "SkCanvas.h" | 8 #include "SkCanvas.h" |
| 9 #include "SkClipStack.h" | 9 #include "SkClipStack.h" |
| 10 #include "SkPath.h" | 10 #include "SkPath.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 } | 118 } |
| 119 SkRect ovalRect; | 119 SkRect ovalRect; |
| 120 if (path.isOval(&ovalRect)) { | 120 if (path.isOval(&ovalRect)) { |
| 121 SkRRect rrect; | 121 SkRRect rrect; |
| 122 rrect.setOval(ovalRect); | 122 rrect.setOval(ovalRect); |
| 123 this->initRRect(saveCount, rrect, op, doAA); | 123 this->initRRect(saveCount, rrect, op, doAA); |
| 124 return; | 124 return; |
| 125 } | 125 } |
| 126 } | 126 } |
| 127 fPath.set(path); | 127 fPath.set(path); |
| 128 fPath.get()->setIsVolatile(true); |
| 128 fType = kPath_Type; | 129 fType = kPath_Type; |
| 129 this->initCommon(saveCount, op, doAA); | 130 this->initCommon(saveCount, op, doAA); |
| 130 } | 131 } |
| 131 | 132 |
| 132 void SkClipStack::Element::asPath(SkPath* path) const { | 133 void SkClipStack::Element::asPath(SkPath* path) const { |
| 133 switch (fType) { | 134 switch (fType) { |
| 134 case kEmpty_Type: | 135 case kEmpty_Type: |
| 135 path->reset(); | 136 path->reset(); |
| 136 break; | 137 break; |
| 137 case kRect_Type: | 138 case kRect_Type: |
| 138 path->reset(); | 139 path->reset(); |
| 139 path->addRect(this->getRect()); | 140 path->addRect(this->getRect()); |
| 140 break; | 141 break; |
| 141 case kRRect_Type: | 142 case kRRect_Type: |
| 142 path->reset(); | 143 path->reset(); |
| 143 path->addRRect(fRRect); | 144 path->addRRect(fRRect); |
| 144 break; | 145 break; |
| 145 case kPath_Type: | 146 case kPath_Type: |
| 146 *path = *fPath.get(); | 147 *path = *fPath.get(); |
| 147 break; | 148 break; |
| 148 } | 149 } |
| 150 path->setIsVolatile(true); |
| 149 } | 151 } |
| 150 | 152 |
| 151 void SkClipStack::Element::setEmpty() { | 153 void SkClipStack::Element::setEmpty() { |
| 152 fType = kEmpty_Type; | 154 fType = kEmpty_Type; |
| 153 fFiniteBound.setEmpty(); | 155 fFiniteBound.setEmpty(); |
| 154 fFiniteBoundType = kNormal_BoundsType; | 156 fFiniteBoundType = kNormal_BoundsType; |
| 155 fIsIntersectionOfRects = false; | 157 fIsIntersectionOfRects = false; |
| 156 fRRect.setEmpty(); | 158 fRRect.setEmpty(); |
| 157 fPath.reset(); | 159 fPath.reset(); |
| 158 fGenID = kEmptyGenID; | 160 fGenID = kEmptyGenID; |
| (...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 898 | 900 |
| 899 void SkClipStack::dump() const { | 901 void SkClipStack::dump() const { |
| 900 B2TIter iter(*this); | 902 B2TIter iter(*this); |
| 901 const Element* e; | 903 const Element* e; |
| 902 while ((e = iter.next())) { | 904 while ((e = iter.next())) { |
| 903 e->dump(); | 905 e->dump(); |
| 904 SkDebugf("\n"); | 906 SkDebugf("\n"); |
| 905 } | 907 } |
| 906 } | 908 } |
| 907 #endif | 909 #endif |
| OLD | NEW |