Flutter Engine
The Flutter Engine
Functions
paint.cpp File Reference
#include "export.h"
#include "helpers.h"
#include "third_party/skia/include/core/SkColorFilter.h"
#include "third_party/skia/include/core/SkImageFilter.h"
#include "third_party/skia/include/core/SkMaskFilter.h"
#include "third_party/skia/include/core/SkPaint.h"
#include "third_party/skia/include/core/SkShader.h"

Go to the source code of this file.

Functions

SKWASM_EXPORT SkPaintpaint_create ()
 
SKWASM_EXPORT void paint_dispose (SkPaint *paint)
 
SKWASM_EXPORT void paint_setBlendMode (SkPaint *paint, SkBlendMode mode)
 
SKWASM_EXPORT void paint_setStyle (SkPaint *paint, SkPaint::Style style)
 
SKWASM_EXPORT SkPaint::Style paint_getStyle (SkPaint *paint)
 
SKWASM_EXPORT void paint_setStrokeWidth (SkPaint *paint, SkScalar width)
 
SKWASM_EXPORT SkScalar paint_getStrokeWidth (SkPaint *paint)
 
SKWASM_EXPORT void paint_setStrokeCap (SkPaint *paint, SkPaint::Cap cap)
 
SKWASM_EXPORT SkPaint::Cap paint_getStrokeCap (SkPaint *paint)
 
SKWASM_EXPORT void paint_setStrokeJoin (SkPaint *paint, SkPaint::Join join)
 
SKWASM_EXPORT SkPaint::Join paint_getStrokeJoin (SkPaint *paint)
 
SKWASM_EXPORT void paint_setAntiAlias (SkPaint *paint, bool antiAlias)
 
SKWASM_EXPORT bool paint_getAntiAlias (SkPaint *paint)
 
SKWASM_EXPORT void paint_setColorInt (SkPaint *paint, SkColor colorInt)
 
SKWASM_EXPORT SkColor paint_getColorInt (SkPaint *paint)
 
SKWASM_EXPORT void paint_setMiterLimit (SkPaint *paint, SkScalar miterLimit)
 
SKWASM_EXPORT SkScalar paint_getMiterLimit (SkPaint *paint)
 
SKWASM_EXPORT void paint_setShader (SkPaint *paint, SkShader *shader)
 
SKWASM_EXPORT void paint_setImageFilter (SkPaint *paint, SkImageFilter *filter)
 
SKWASM_EXPORT void paint_setColorFilter (SkPaint *paint, SkColorFilter *filter)
 
SKWASM_EXPORT void paint_setMaskFilter (SkPaint *paint, SkMaskFilter *filter)
 

Function Documentation

◆ paint_create()

SKWASM_EXPORT SkPaint * paint_create ( )

Definition at line 15 of file paint.cpp.

15 {
16 auto paint = new SkPaint();
17
18 // Antialias defaults to true in flutter.
19 paint->setAntiAlias(true);
20 return paint;
21}
const Paint & paint
Definition: color_source.cc:38

◆ paint_dispose()

SKWASM_EXPORT void paint_dispose ( SkPaint paint)

Definition at line 23 of file paint.cpp.

23 {
24 delete paint;
25}

◆ paint_getAntiAlias()

SKWASM_EXPORT bool paint_getAntiAlias ( SkPaint paint)

Definition at line 69 of file paint.cpp.

69 {
70 return paint->isAntiAlias();
71}

◆ paint_getColorInt()

SKWASM_EXPORT SkColor paint_getColorInt ( SkPaint paint)

Definition at line 77 of file paint.cpp.

77 {
78 return paint->getColor();
79}

◆ paint_getMiterLimit()

SKWASM_EXPORT SkScalar paint_getMiterLimit ( SkPaint paint)

Definition at line 85 of file paint.cpp.

85 {
86 return paint->getStrokeMiter();
87}

◆ paint_getStrokeCap()

SKWASM_EXPORT SkPaint::Cap paint_getStrokeCap ( SkPaint paint)

Definition at line 53 of file paint.cpp.

53 {
54 return paint->getStrokeCap();
55}

◆ paint_getStrokeJoin()

SKWASM_EXPORT SkPaint::Join paint_getStrokeJoin ( SkPaint paint)

Definition at line 61 of file paint.cpp.

61 {
62 return paint->getStrokeJoin();
63}

◆ paint_getStrokeWidth()

SKWASM_EXPORT SkScalar paint_getStrokeWidth ( SkPaint paint)

Definition at line 45 of file paint.cpp.

45 {
46 return paint->getStrokeWidth();
47}

◆ paint_getStyle()

SKWASM_EXPORT SkPaint::Style paint_getStyle ( SkPaint paint)

Definition at line 37 of file paint.cpp.

37 {
38 return paint->getStyle();
39}

◆ paint_setAntiAlias()

SKWASM_EXPORT void paint_setAntiAlias ( SkPaint paint,
bool  antiAlias 
)

Definition at line 65 of file paint.cpp.

65 {
66 paint->setAntiAlias(antiAlias);
67}

◆ paint_setBlendMode()

SKWASM_EXPORT void paint_setBlendMode ( SkPaint paint,
SkBlendMode  mode 
)

Definition at line 27 of file paint.cpp.

27 {
28 paint->setBlendMode(mode);
29}
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive mode
Definition: switches.h:228

◆ paint_setColorFilter()

SKWASM_EXPORT void paint_setColorFilter ( SkPaint paint,
SkColorFilter filter 
)

Definition at line 97 of file paint.cpp.

97 {
98 paint->setColorFilter(sk_ref_sp<SkColorFilter>(filter));
99}

◆ paint_setColorInt()

SKWASM_EXPORT void paint_setColorInt ( SkPaint paint,
SkColor  colorInt 
)

Definition at line 73 of file paint.cpp.

73 {
74 paint->setColor(colorInt);
75}

◆ paint_setImageFilter()

SKWASM_EXPORT void paint_setImageFilter ( SkPaint paint,
SkImageFilter filter 
)

Definition at line 93 of file paint.cpp.

93 {
94 paint->setImageFilter(sk_ref_sp<SkImageFilter>(filter));
95}

◆ paint_setMaskFilter()

SKWASM_EXPORT void paint_setMaskFilter ( SkPaint paint,
SkMaskFilter filter 
)

Definition at line 101 of file paint.cpp.

101 {
102 paint->setMaskFilter(sk_ref_sp<SkMaskFilter>(filter));
103}

◆ paint_setMiterLimit()

SKWASM_EXPORT void paint_setMiterLimit ( SkPaint paint,
SkScalar  miterLimit 
)

Definition at line 81 of file paint.cpp.

81 {
82 paint->setStrokeMiter(miterLimit);
83}

◆ paint_setShader()

SKWASM_EXPORT void paint_setShader ( SkPaint paint,
SkShader shader 
)

Definition at line 89 of file paint.cpp.

89 {
90 paint->setShader(sk_ref_sp<SkShader>(shader));
91}

◆ paint_setStrokeCap()

SKWASM_EXPORT void paint_setStrokeCap ( SkPaint paint,
SkPaint::Cap  cap 
)

Definition at line 49 of file paint.cpp.

49 {
50 paint->setStrokeCap(cap);
51}

◆ paint_setStrokeJoin()

SKWASM_EXPORT void paint_setStrokeJoin ( SkPaint paint,
SkPaint::Join  join 
)

Definition at line 57 of file paint.cpp.

57 {
58 paint->setStrokeJoin(join);
59}
static SkString join(const CommandLineFlags::StringArray &)
Definition: skpbench.cpp:741

◆ paint_setStrokeWidth()

SKWASM_EXPORT void paint_setStrokeWidth ( SkPaint paint,
SkScalar  width 
)

Definition at line 41 of file paint.cpp.

41 {
42 paint->setStrokeWidth(width);
43}
int32_t width

◆ paint_setStyle()

SKWASM_EXPORT void paint_setStyle ( SkPaint paint,
SkPaint::Style  style 
)

Definition at line 33 of file paint.cpp.

33 {
34 paint->setStyle(style);
35}