| 1 |
/* |
| 2 |
* Copyright 2022 Google LLC |
| 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 SkPathUtils_DEFINED |
| 8 |
#define SkPathUtils_DEFINED |
| 9 |
|
| 10 |
#include "include/core/SkScalar.h" // IWYU pragma: keep |
| 11 |
#include "include/core/SkTypes.h" |
| 12 |
|
| 13 |
class SkMatrix; |
| 14 |
class SkPaint; |
| 15 |
class SkPath; |
| 16 |
class SkPathBuilder; |
| 17 |
struct SkRect; |
| 18 |
|
| 19 |
namespace skpathutils { |
| 20 |
|
| 21 |
/* Returns the filled equivalent of the stroked path. |
| 22 |
* |
| 23 |
* @param src SkPath read to create a filled version |
| 24 |
* @param paint uses settings for stroke cap, width, miter, join, and patheffect. |
| 25 |
* @param dst results are written to this builder. |
| 26 |
* @param cullRect optional limit passed to SkPathEffect |
| 27 |
* @param ctm matrix to take into acount for increased precision (if it scales up). |
| 28 |
* @return true if the result can be filled, or false if it is a hairline (to be stroked). |
| 29 |
*/ |
| 30 |
SK_API bool FillPathWithPaint(const SkPath& src, const SkPaint& paint, SkPathBuilder* dst, |
| 31 |
const SkRect* cullRect, const SkMatrix& ctm); |
| 32 |
|
| 33 |
SK_API bool FillPathWithPaint(const SkPath& src, const SkPaint& paint, SkPathBuilder* dst); |
| 34 |
|
| 35 |
SK_API SkPath FillPathWithPaint(const SkPath& src, const SkPaint& paint, bool* isFill = nullptr); |
| 36 |
|
| 37 |
} |
| 38 |
|
| 39 |
#endif |