Home | History | Annotate | Download | only in core
      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 "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 class SkStrokerPriv {
     22 public:
     23     typedef void (*CapProc)(SkPath* path,
     24                             const SkPoint& pivot,
     25                             const SkVector& normal,
     26                             const SkPoint& stop,
     27                             SkPath* otherPath);
     28 
     29     typedef void (*JoinProc)(SkPath* outer, SkPath* inner,
     30                              const SkVector& beforeUnitNormal,
     31                              const SkPoint& pivot,
     32                              const SkVector& afterUnitNormal,
     33                              SkScalar radius, SkScalar invMiterLimit,
     34                              bool prevIsLine, bool currIsLine);
     35 
     36     static CapProc  CapFactory(SkPaint::Cap);
     37     static JoinProc JoinFactory(SkPaint::Join);
     38 };
     39 
     40 #endif
     41