| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 break; | 105 break; |
| 106 case kEmpty_Type: | 106 case kEmpty_Type: |
| 107 // Should this set to an empty, inverse filled path? | 107 // Should this set to an empty, inverse filled path? |
| 108 break; | 108 break; |
| 109 } | 109 } |
| 110 } | 110 } |
| 111 | 111 |
| 112 void SkClipStack::Element::initPath(int saveCount, const SkPath& path, SkRegion:
:Op op, | 112 void SkClipStack::Element::initPath(int saveCount, const SkPath& path, SkRegion:
:Op op, |
| 113 bool doAA) { | 113 bool doAA) { |
| 114 if (!path.isInverseFillType()) { | 114 if (!path.isInverseFillType()) { |
| 115 if (SkPath::kNone_PathAsRect != path.asRect()) { | 115 SkRect r; |
| 116 this->initRect(saveCount, path.getBounds(), op, doAA); | 116 if (path.isRect(&r)) { |
| 117 this->initRect(saveCount, r, op, doAA); |
| 117 return; | 118 return; |
| 118 } | 119 } |
| 119 SkRect ovalRect; | 120 SkRect ovalRect; |
| 120 if (path.isOval(&ovalRect)) { | 121 if (path.isOval(&ovalRect)) { |
| 121 SkRRect rrect; | 122 SkRRect rrect; |
| 122 rrect.setOval(ovalRect); | 123 rrect.setOval(ovalRect); |
| 123 this->initRRect(saveCount, rrect, op, doAA); | 124 this->initRRect(saveCount, rrect, op, doAA); |
| 124 return; | 125 return; |
| 125 } | 126 } |
| 126 } | 127 } |
| (...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 900 | 901 |
| 901 void SkClipStack::dump() const { | 902 void SkClipStack::dump() const { |
| 902 B2TIter iter(*this); | 903 B2TIter iter(*this); |
| 903 const Element* e; | 904 const Element* e; |
| 904 while ((e = iter.next())) { | 905 while ((e = iter.next())) { |
| 905 e->dump(); | 906 e->dump(); |
| 906 SkDebugf("\n"); | 907 SkDebugf("\n"); |
| 907 } | 908 } |
| 908 } | 909 } |
| 909 #endif | 910 #endif |
| OLD | NEW |