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 #ifndef SkBoundaryPatch_DEFINED | 8 #ifndef SkBoundaryPatch_DEFINED |
9 #define SkBoundaryPatch_DEFINED | 9 #define SkBoundaryPatch_DEFINED |
10 | 10 |
11 #include "SkPoint.h" | 11 #include "SkPoint.h" |
12 #include "SkRefCnt.h" | 12 #include "SkRefCnt.h" |
13 | 13 |
14 class SkBoundary : public SkRefCnt { | 14 class SkBoundary : public SkRefCnt { |
15 public: | 15 public: |
16 SK_DECLARE_INST_COUNT(SkBoundary) | 16 |
17 | 17 |
18 // These must be 0, 1, 2, 3 for efficiency in the subclass implementations | 18 // These must be 0, 1, 2, 3 for efficiency in the subclass implementations |
19 enum Edge { | 19 enum Edge { |
20 kTop = 0, | 20 kTop = 0, |
21 kRight = 1, | 21 kRight = 1, |
22 kBottom = 2, | 22 kBottom = 2, |
23 kLeft = 3 | 23 kLeft = 3 |
24 }; | 24 }; |
25 // Edge index goes clockwise around the boundary, beginning at the "top" | 25 // Edge index goes clockwise around the boundary, beginning at the "top" |
26 virtual SkPoint eval(Edge, SkScalar unitInterval) = 0; | 26 virtual SkPoint eval(Edge, SkScalar unitInterval) = 0; |
(...skipping 30 matching lines...) Expand all Loading... |
57 class SkCubicBoundary : public SkBoundary { | 57 class SkCubicBoundary : public SkBoundary { |
58 public: | 58 public: |
59 // the caller sets the first 12 entries. The 13th is used by the impl. | 59 // the caller sets the first 12 entries. The 13th is used by the impl. |
60 SkPoint fPts[13]; | 60 SkPoint fPts[13]; |
61 | 61 |
62 // override | 62 // override |
63 virtual SkPoint eval(Edge, SkScalar); | 63 virtual SkPoint eval(Edge, SkScalar); |
64 }; | 64 }; |
65 | 65 |
66 #endif | 66 #endif |
OLD | NEW |