| Flutter Impeller |

paint.cc
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 "impeller/toolkit/interop/paint.h"
6
7 namespace impeller::interop {
8
9 Paint::Paint() = default;
10
11 Paint::~Paint() = default;
12
13 const flutter::DlPaint& Paint::GetPaint() const {
14 return paint_;
15 }
16
17 void Paint::SetColor(flutter::DlColor color) {
18 paint_.setColor(color);
19 }
20
21 void Paint::SetBlendMode(BlendMode mode) {
22 paint_.setBlendMode(ToDisplayListType(mode));
23 }
24
25 void Paint::SetDrawStyle(flutter::DlDrawStyle style) {
26 paint_.setDrawStyle(style);
27 }
28
29 void Paint::SetStrokeCap(flutter::DlStrokeCap stroke_cap) {
30 paint_.setStrokeCap(stroke_cap);
31 }
32
33 void Paint::SetStrokeJoin(flutter::DlStrokeJoin stroke_join) {
34 paint_.setStrokeJoin(stroke_join);
35 }
36
37 void Paint::SetStrokeWidth(Scalar width) {
38 paint_.setStrokeWidth(width);
39 }
40
41 void Paint::SetStrokeMiter(Scalar miter) {
42 paint_.setStrokeMiter(miter);
43 }
44
45 void Paint::SetColorFilter(const ColorFilter& filter) {
46 paint_.setColorFilter(filter.GetColorFilter());
47 }
48
49 void Paint::SetColorSource(const ColorSource& source) {
50 paint_.setColorSource(source.GetColorSource());
51 }
52
53 void Paint::SetImageFilter(const ImageFilter& filter) {
54 paint_.setImageFilter(filter.GetImageFilter());
55 }
56
57 void Paint::SetMaskFilter(const MaskFilter& filter) {
58 paint_.setMaskFilter(filter.GetMaskFilter());
59 }
60
61 } // namespace impeller::interop
impeller::interop::ColorFilter
Definition: color_filter.h:17
impeller::interop::ColorFilter::GetColorFilter
const std::shared_ptr< const flutter::DlColorFilter > & GetColorFilter() const
Definition: color_filter.cc:32
impeller::interop::ColorSource
Definition: color_source.h:24
impeller::interop::ColorSource::GetColorSource
const std::shared_ptr< flutter::DlColorSource > & GetColorSource() const
Definition: color_source.cc:155
impeller::interop::ImageFilter
Definition: image_filter.h:18
impeller::interop::ImageFilter::GetImageFilter
const std::shared_ptr< flutter::DlImageFilter > & GetImageFilter() const
Definition: image_filter.cc:96
impeller::interop::MaskFilter
Definition: mask_filter.h:16
impeller::interop::MaskFilter::GetMaskFilter
const std::shared_ptr< flutter::DlMaskFilter > & GetMaskFilter() const
Definition: mask_filter.cc:23
impeller::interop::Paint::SetDrawStyle
void SetDrawStyle(flutter::DlDrawStyle style)
Definition: paint.cc:25
impeller::interop::Paint::SetColorSource
void SetColorSource(const ColorSource &source)
Definition: paint.cc:49
impeller::interop::Paint::SetStrokeWidth
void SetStrokeWidth(Scalar width)
Definition: paint.cc:37
impeller::interop::Paint::SetStrokeJoin
void SetStrokeJoin(flutter::DlStrokeJoin stroke_join)
Definition: paint.cc:33
impeller::interop::Paint::SetImageFilter
void SetImageFilter(const ImageFilter &filter)
Definition: paint.cc:53
impeller::interop::Paint::SetStrokeMiter
void SetStrokeMiter(Scalar miter)
Definition: paint.cc:41
impeller::interop::Paint::SetStrokeCap
void SetStrokeCap(flutter::DlStrokeCap stroke_cap)
Definition: paint.cc:29
impeller::interop::Paint::SetBlendMode
void SetBlendMode(BlendMode mode)
Definition: paint.cc:21
impeller::interop::Paint::SetMaskFilter
void SetMaskFilter(const MaskFilter &filter)
Definition: paint.cc:57
impeller::interop::Paint::Paint
Paint()
impeller::interop::Paint::SetColor
void SetColor(flutter::DlColor color)
Definition: paint.cc:17
impeller::interop::Paint::~Paint
~Paint() override
impeller::interop::Paint::SetColorFilter
void SetColorFilter(const ColorFilter &filter)
Definition: paint.cc:45
impeller::interop::Paint::GetPaint
const flutter::DlPaint & GetPaint() const
Definition: paint.cc:13
impeller::interop
Definition: context_gles.cc:12
impeller::interop::ToDisplayListType
constexpr flutter::DlColor ToDisplayListType(Color color)
Definition: formats.h:89
impeller::Scalar
float Scalar
Definition: scalar.h:19
impeller::BlendMode
BlendMode
Definition: color.h:58
paint.h