OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
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 | 8 |
9 #include "Sk2DPathEffect.h" | 9 #include "Sk2DPathEffect.h" |
10 #include "SkReadBuffer.h" | 10 #include "SkReadBuffer.h" |
11 #include "SkWriteBuffer.h" | 11 #include "SkWriteBuffer.h" |
12 #include "SkPath.h" | 12 #include "SkPath.h" |
13 #include "SkRegion.h" | 13 #include "SkRegion.h" |
14 #include "SkStrokeRec.h" | 14 #include "SkStrokeRec.h" |
15 | 15 |
16 Sk2DPathEffect::Sk2DPathEffect(const SkMatrix& mat) : fMatrix(mat) { | 16 Sk2DPathEffect::Sk2DPathEffect(const SkMatrix& mat) : fMatrix(mat) { |
17 fMatrixIsInvertible = mat.invert(&fInverse); | 17 // Calling invert will set the type mask on both matrices, making them threa
d safe. |
| 18 fMatrixIsInvertible = fMatrix.invert(&fInverse); |
18 } | 19 } |
19 | 20 |
20 bool Sk2DPathEffect::filterPath(SkPath* dst, const SkPath& src, | 21 bool Sk2DPathEffect::filterPath(SkPath* dst, const SkPath& src, |
21 SkStrokeRec*, const SkRect*) const { | 22 SkStrokeRec*, const SkRect*) const { |
22 if (!fMatrixIsInvertible) { | 23 if (!fMatrixIsInvertible) { |
23 return false; | 24 return false; |
24 } | 25 } |
25 | 26 |
26 SkPath tmp; | 27 SkPath tmp; |
27 SkIRect ir; | 28 SkIRect ir; |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 } | 154 } |
154 | 155 |
155 #ifndef SK_IGNORE_TO_STRING | 156 #ifndef SK_IGNORE_TO_STRING |
156 void SkPath2DPathEffect::toString(SkString* str) const { | 157 void SkPath2DPathEffect::toString(SkString* str) const { |
157 str->appendf("SkPath2DPathEffect: ("); | 158 str->appendf("SkPath2DPathEffect: ("); |
158 this->INHERITED::toString(str); | 159 this->INHERITED::toString(str); |
159 // TODO: print out path information | 160 // TODO: print out path information |
160 str->appendf(")"); | 161 str->appendf(")"); |
161 } | 162 } |
162 #endif | 163 #endif |
OLD | NEW |