Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: src/effects/Sk2DPathEffect.cpp

Issue 2340133004: Make Sk2DPathEffect thread safe. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698