| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
| 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 | 8 |
| 9 | 9 |
| 10 #include "SkBuffer.h" | 10 #include "SkBuffer.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 this->init(path); | 90 this->init(path); |
| 91 } | 91 } |
| 92 | 92 |
| 93 SkAutoPathBoundsUpdate(SkPath* path, SkScalar left, SkScalar top, | 93 SkAutoPathBoundsUpdate(SkPath* path, SkScalar left, SkScalar top, |
| 94 SkScalar right, SkScalar bottom) { | 94 SkScalar right, SkScalar bottom) { |
| 95 fRect.set(left, top, right, bottom); | 95 fRect.set(left, top, right, bottom); |
| 96 this->init(path); | 96 this->init(path); |
| 97 } | 97 } |
| 98 | 98 |
| 99 ~SkAutoPathBoundsUpdate() { | 99 ~SkAutoPathBoundsUpdate() { |
| 100 fPath->setIsConvex(fDegenerate); | 100 fPath->setConvexity(fDegenerate ? SkPath::kConvex_Convexity |
| 101 : SkPath::kUnknown_Convexity); |
| 101 if (fEmpty || fHasValidBounds) { | 102 if (fEmpty || fHasValidBounds) { |
| 102 fPath->setBounds(fRect); | 103 fPath->setBounds(fRect); |
| 103 } | 104 } |
| 104 } | 105 } |
| 105 | 106 |
| 106 private: | 107 private: |
| 107 SkPath* fPath; | 108 SkPath* fPath; |
| 108 SkRect fRect; | 109 SkRect fRect; |
| 109 bool fHasValidBounds; | 110 bool fHasValidBounds; |
| 110 bool fDegenerate; | 111 bool fDegenerate; |
| (...skipping 2873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2984 switch (this->getFillType()) { | 2985 switch (this->getFillType()) { |
| 2985 case SkPath::kEvenOdd_FillType: | 2986 case SkPath::kEvenOdd_FillType: |
| 2986 case SkPath::kInverseEvenOdd_FillType: | 2987 case SkPath::kInverseEvenOdd_FillType: |
| 2987 w &= 1; | 2988 w &= 1; |
| 2988 break; | 2989 break; |
| 2989 default: | 2990 default: |
| 2990 break; | 2991 break; |
| 2991 } | 2992 } |
| 2992 return SkToBool(w); | 2993 return SkToBool(w); |
| 2993 } | 2994 } |
| OLD | NEW |