| 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 "include/core/SkPaint.h" |
| 13 |
#include "include/core/SkPoint.h" |
| 14 |
#include "include/core/SkScalar.h" |
| 15 |
|
| 16 |
class SkPathBuilder; |
| 17 |
|
| 18 |
#define CWX(x, y) (-y) |
| 19 |
#define CWY(x, y) (x) |
| 20 |
#define CCWX(x, y) (y) |
| 21 |
#define CCWY(x, y) (-x) |
| 22 |
|
| 23 |
#define CUBIC_ARC_FACTOR ((SK_ScalarSqrt2 - SK_Scalar1) * 4 / 3) |
| 24 |
|
| 25 |
// this enables a global which is not thread-safe; doing so triggers a TSAN error in Chrome tests. |
| 26 |
#define QUAD_STROKE_APPROX_EXTENDED_DEBUGGING 0 // set to 1 to enable debugging in StrokerTest.cpp |
| 27 |
|
| 28 |
class SkStrokerPriv { |
| 29 |
public: |
| 30 |
typedef void (*CapProc)(SkPathBuilder* path, |
| 31 |
const SkPoint& pivot, |
| 32 |
const SkVector& normal, |
| 33 |
const SkPoint& stop, |
| 34 |
bool extendLastPt); |
| 35 |
|
| 36 |
typedef void (*JoinProc)(SkPathBuilder* outer, SkPathBuilder* inner, |
| 37 |
const SkVector& beforeUnitNormal, |
| 38 |
const SkPoint& pivot, |
| 39 |
const SkVector& afterUnitNormal, |
| 40 |
SkScalar radius, SkScalar invMiterLimit, |
| 41 |
bool prevIsLine, bool currIsLine); |
| 42 |
|
| 43 |
static CapProc CapFactory(SkPaint::Cap); |
| 44 |
static JoinProc JoinFactory(SkPaint::Join); |
| 45 |
}; |
| 46 |
|
| 47 |
#endif |