SkStrokerPriv.h 1.3 KB

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