OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
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 #include "SkBoundaryPatch.h" | 8 #include "SkBoundaryPatch.h" |
9 | 9 |
10 SkBoundaryPatch::SkBoundaryPatch() : fBoundary(NULL) {} | 10 SkBoundaryPatch::SkBoundaryPatch() : fBoundary(nullptr) {} |
11 | 11 |
12 SkBoundaryPatch::~SkBoundaryPatch() { | 12 SkBoundaryPatch::~SkBoundaryPatch() { |
13 SkSafeUnref(fBoundary); | 13 SkSafeUnref(fBoundary); |
14 } | 14 } |
15 | 15 |
16 SkBoundary* SkBoundaryPatch::setBoundary(SkBoundary* b) { | 16 SkBoundary* SkBoundaryPatch::setBoundary(SkBoundary* b) { |
17 SkRefCnt_SafeAssign(fBoundary, b); | 17 SkRefCnt_SafeAssign(fBoundary, b); |
18 return b; | 18 return b; |
19 } | 19 } |
20 | 20 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 return SkPointInterp(fPts[e], fPts[(e + 1) & 3], t); | 67 return SkPointInterp(fPts[e], fPts[(e + 1) & 3], t); |
68 } | 68 } |
69 | 69 |
70 SkPoint SkCubicBoundary::eval(Edge e, SkScalar t) { | 70 SkPoint SkCubicBoundary::eval(Edge e, SkScalar t) { |
71 SkASSERT((unsigned)e < 4); | 71 SkASSERT((unsigned)e < 4); |
72 | 72 |
73 // ensure our 4th cubic wraps to the start of the first | 73 // ensure our 4th cubic wraps to the start of the first |
74 fPts[12] = fPts[0]; | 74 fPts[12] = fPts[0]; |
75 | 75 |
76 SkPoint loc; | 76 SkPoint loc; |
77 SkEvalCubicAt(&fPts[e * 3], t, &loc, NULL, NULL); | 77 SkEvalCubicAt(&fPts[e * 3], t, &loc, nullptr, nullptr); |
78 return loc; | 78 return loc; |
79 } | 79 } |
OLD | NEW |