Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
include
effects
SkTrimPathEffect.h
Go to the documentation of this file.
1
/*
2
* Copyright 2018 Google Inc.
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
#ifndef SkTrimPathEffect_DEFINED
9
#define SkTrimPathEffect_DEFINED
10
11
#include "
include/core/SkRefCnt.h
"
12
#include "
include/core/SkScalar.h
"
13
#include "
include/core/SkTypes.h
"
14
15
class
SkPathEffect
;
16
17
class
SK_API
SkTrimPathEffect
{
18
public
:
19
enum class
Mode
{
20
kNormal
,
// return the subset path [start,stop]
21
kInverted,
// return the complement/subset paths [0,start] + [stop,1]
22
};
23
24
/**
25
* Take start and stop "t" values (values between 0...1), and return a path that is that
26
* subset of the original path.
27
*
28
* e.g.
29
* Make(0.5, 1.0) --> return the 2nd half of the path
30
* Make(0.33333, 0.66667) --> return the middle third of the path
31
*
32
* The trim values apply to the entire path, so if it contains several contours, all of them
33
* are including in the calculation.
34
*
35
* startT and stopT must be 0..1 inclusive. If they are outside of that interval, they will
36
* be pinned to the nearest legal value. If either is NaN, null will be returned.
37
*
38
* Note: for Mode::kNormal, this will return one (logical) segment (even if it is spread
39
* across multiple contours). For Mode::kInverted, this will return 2 logical
40
* segments: stopT..1 and 0...startT, in this order.
41
*/
42
static
sk_sp<SkPathEffect>
Make
(
SkScalar
startT,
SkScalar
stopT,
Mode
= Mode::kNormal);
43
};
44
45
#endif
Mode
Mode
Definition
ColorSpaceBench.cpp:18
SK_API
#define SK_API
Definition
SkAPI.h:35
Make
static std::unique_ptr< SkEncoder > Make(SkWStream *dst, const SkPixmap *src, const SkYUVAPixmaps *srcYUVA, const SkColorSpace *srcYUVAColorSpace, const SkJpegEncoder::Options &options)
Definition
SkJpegEncoderImpl.cpp:259
SkRefCnt.h
SkScalar.h
SkTypes.h
SkPathEffect
Definition
SkPathEffect.h:35
SkTrimPathEffect
Definition
SkTrimPathEffect.h:17
SkTrimPathEffect::Mode
Mode
Definition
SkTrimPathEffect.h:19
sk_sp
Definition
SkRefCnt.h:220
kNormal
@ kNormal
Default priority level.
Definition
embedder.h:260
SkScalar
float SkScalar
Definition
extension.cpp:12
Generated on Fri Apr 26 2024 06:16:11 for Flutter Engine by
1.9.8