Flutter Engine
The Flutter Engine
paint.cpp
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "export.h"
6#include "helpers.h"
12
13using namespace Skwasm;
14
16 auto paint = new SkPaint();
17
18 // Antialias defaults to true in flutter.
19 paint->setAntiAlias(true);
20 return paint;
21}
22
24 delete paint;
25}
26
28 paint->setBlendMode(mode);
29}
30
31// No getter for blend mode, as it's non trivial. Cache on the dart side.
32
34 paint->setStyle(style);
35}
36
38 return paint->getStyle();
39}
40
42 paint->setStrokeWidth(width);
43}
44
46 return paint->getStrokeWidth();
47}
48
50 paint->setStrokeCap(cap);
51}
52
54 return paint->getStrokeCap();
55}
56
58 paint->setStrokeJoin(join);
59}
60
62 return paint->getStrokeJoin();
63}
64
66 paint->setAntiAlias(antiAlias);
67}
68
70 return paint->isAntiAlias();
71}
72
74 paint->setColor(colorInt);
75}
76
78 return paint->getColor();
79}
80
82 paint->setStrokeMiter(miterLimit);
83}
84
86 return paint->getStrokeMiter();
87}
88
90 paint->setShader(sk_ref_sp<SkShader>(shader));
91}
92
94 paint->setImageFilter(sk_ref_sp<SkImageFilter>(filter));
95}
96
98 paint->setColorFilter(sk_ref_sp<SkColorFilter>(filter));
99}
100
102 paint->setMaskFilter(sk_ref_sp<SkMaskFilter>(filter));
103}
SkBlendMode
Definition: SkBlendMode.h:38
uint32_t SkColor
Definition: SkColor.h:37
const Paint & paint
Definition: color_source.cc:38
float SkScalar
Definition: extension.cpp:12
Definition: helpers.h:12
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
SKWASM_EXPORT SkPaint::Join paint_getStrokeJoin(SkPaint *paint)
Definition: paint.cpp:61
SKWASM_EXPORT void paint_setStrokeCap(SkPaint *paint, SkPaint::Cap cap)
Definition: paint.cpp:49
SKWASM_EXPORT SkScalar paint_getMiterLimit(SkPaint *paint)
Definition: paint.cpp:85
SKWASM_EXPORT void paint_setImageFilter(SkPaint *paint, SkImageFilter *filter)
Definition: paint.cpp:93
SKWASM_EXPORT void paint_setMiterLimit(SkPaint *paint, SkScalar miterLimit)
Definition: paint.cpp:81
SKWASM_EXPORT void paint_setColorInt(SkPaint *paint, SkColor colorInt)
Definition: paint.cpp:73
SKWASM_EXPORT SkPaint::Style paint_getStyle(SkPaint *paint)
Definition: paint.cpp:37
SKWASM_EXPORT SkColor paint_getColorInt(SkPaint *paint)
Definition: paint.cpp:77
SKWASM_EXPORT void paint_setShader(SkPaint *paint, SkShader *shader)
Definition: paint.cpp:89
SKWASM_EXPORT SkScalar paint_getStrokeWidth(SkPaint *paint)
Definition: paint.cpp:45
SKWASM_EXPORT void paint_setAntiAlias(SkPaint *paint, bool antiAlias)
Definition: paint.cpp:65
SKWASM_EXPORT SkPaint::Cap paint_getStrokeCap(SkPaint *paint)
Definition: paint.cpp:53
SKWASM_EXPORT void paint_setBlendMode(SkPaint *paint, SkBlendMode mode)
Definition: paint.cpp:27
SKWASM_EXPORT void paint_dispose(SkPaint *paint)
Definition: paint.cpp:23
SKWASM_EXPORT void paint_setColorFilter(SkPaint *paint, SkColorFilter *filter)
Definition: paint.cpp:97
SKWASM_EXPORT SkPaint * paint_create()
Definition: paint.cpp:15
SKWASM_EXPORT void paint_setMaskFilter(SkPaint *paint, SkMaskFilter *filter)
Definition: paint.cpp:101
SKWASM_EXPORT bool paint_getAntiAlias(SkPaint *paint)
Definition: paint.cpp:69
SKWASM_EXPORT void paint_setStrokeWidth(SkPaint *paint, SkScalar width)
Definition: paint.cpp:41
SKWASM_EXPORT void paint_setStyle(SkPaint *paint, SkPaint::Style style)
Definition: paint.cpp:33
SKWASM_EXPORT void paint_setStrokeJoin(SkPaint *paint, SkPaint::Join join)
Definition: paint.cpp:57
int32_t width
static SkString join(const CommandLineFlags::StringArray &)
Definition: skpbench.cpp:741
#define SKWASM_EXPORT
Definition: export.h:10