1 | /* |
2 | * Copyright 2006 The Android Open Source Project |
3 | * |
4 | * Use of this source code is governed by a BSD-style license that can be |
5 | * found in the LICENSE file. |
6 | */ |
7 | |
8 | |
9 | #ifndef SkStrokerPriv_DEFINED |
10 | #define SkStrokerPriv_DEFINED |
11 | |
12 | #include "src/core/SkStroke.h" |
13 | |
14 | #define CWX(x, y) (-y) |
15 | #define CWY(x, y) (x) |
16 | #define CCWX(x, y) (y) |
17 | #define CCWY(x, y) (-x) |
18 | |
19 | #define CUBIC_ARC_FACTOR ((SK_ScalarSqrt2 - SK_Scalar1) * 4 / 3) |
20 | |
21 | // this enables a global which is not thread-safe; doing so triggers a TSAN error in Chrome tests. |
22 | #define QUAD_STROKE_APPROX_EXTENDED_DEBUGGING 0 // set to 1 to enable debugging in StrokerTest.cpp |
23 | |
24 | class SkStrokerPriv { |
25 | public: |
26 | typedef void (*CapProc)(SkPath* path, |
27 | const SkPoint& pivot, |
28 | const SkVector& normal, |
29 | const SkPoint& stop, |
30 | SkPath* otherPath); |
31 | |
32 | typedef void (*JoinProc)(SkPath* outer, SkPath* inner, |
33 | const SkVector& beforeUnitNormal, |
34 | const SkPoint& pivot, |
35 | const SkVector& afterUnitNormal, |
36 | SkScalar radius, SkScalar invMiterLimit, |
37 | bool prevIsLine, bool currIsLine); |
38 | |
39 | static CapProc CapFactory(SkPaint::Cap); |
40 | static JoinProc JoinFactory(SkPaint::Join); |
41 | }; |
42 | |
43 | #endif |
44 | |