Flutter Engine
 
Loading...
Searching...
No Matches
dl_conical_gradient_color_source.h
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#ifndef FLUTTER_DISPLAY_LIST_EFFECTS_COLOR_SOURCES_DL_CONICAL_GRADIENT_COLOR_SOURCE_H_
6#define FLUTTER_DISPLAY_LIST_EFFECTS_COLOR_SOURCES_DL_CONICAL_GRADIENT_COLOR_SOURCE_H_
7
9
10namespace flutter {
11
13 public:
15 return this;
16 }
17
18 bool isUIThreadSafe() const override { return true; }
19
20 std::shared_ptr<DlColorSource> shared() const override;
21
25 size_t size() const override { return sizeof(*this) + vector_sizes(); }
26
27 DlPoint start_center() const { return start_center_; }
28 DlScalar start_radius() const { return start_radius_; }
29 DlPoint end_center() const { return end_center_; }
30 DlScalar end_radius() const { return end_radius_; }
31
32 protected:
33 virtual const void* pod() const override { return this + 1; }
34
35 bool equals_(DlColorSource const& other) const override;
36
37 private:
38 template <typename Colors>
43 uint32_t stop_count,
44 Colors colors,
45 const float* stops,
47 const DlMatrix* matrix = nullptr)
49 start_center_(start_center),
50 start_radius_(start_radius),
51 end_center_(end_center),
52 end_radius_(end_radius) {
53 store_color_stops(this + 1, colors, stops);
54 }
55
56 explicit DlConicalGradientColorSource(
57 const DlConicalGradientColorSource* source);
58
59 DlPoint start_center_;
60 DlScalar start_radius_;
61 DlPoint end_center_;
62 DlScalar end_radius_;
63
64 friend class DlColorSource;
65 friend class DisplayListBuilder;
66
68};
69
70} // namespace flutter
71
72#endif // FLUTTER_DISPLAY_LIST_EFFECTS_COLOR_SOURCES_DL_CONICAL_GRADIENT_COLOR_SOURCE_H_
std::shared_ptr< DlColorSource > shared() const override
bool equals_(DlColorSource const &other) const override
bool isUIThreadSafe() const override
If the underlying platform data held by this object is held in a way that it can be stored and potent...
const DlConicalGradientColorSource * asConicalGradient() const override
void store_color_stops(void *pod, const DlColor *color_data, const float *stop_data)
#define FML_DISALLOW_COPY_ASSIGN_AND_MOVE(TypeName)
Definition macros.h:31
impeller::Scalar DlScalar
impeller::Point DlPoint
A 4x4 matrix using column-major storage.
Definition matrix.h:37