Flutter Engine
 
Loading...
Searching...
No Matches
dl_radial_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_RADIAL_GRADIENT_COLOR_SOURCE_H_
6#define FLUTTER_DISPLAY_LIST_EFFECTS_COLOR_SOURCES_DL_RADIAL_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
22 DlColorSourceType type() const override {
24 }
25 size_t size() const override { return sizeof(*this) + vector_sizes(); }
26
27 DlPoint center() const { return center_; }
28 DlScalar radius() const { return radius_; }
29
30 protected:
31 virtual const void* pod() const override { return this + 1; }
32
33 bool equals_(DlColorSource const& other) const override;
34
35 private:
36 template <typename Colors>
39 uint32_t stop_count,
40 Colors colors,
41 const float* stops,
43 const DlMatrix* matrix = nullptr)
45 center_(center),
46 radius_(radius) {
47 store_color_stops(this + 1, colors, stops);
48 }
49
50 explicit DlRadialGradientColorSource(
51 const DlRadialGradientColorSource* source);
52
53 DlPoint center_;
54 DlScalar radius_;
55
56 friend class DlColorSource;
57 friend class DisplayListBuilder;
58
60};
61
62} // namespace flutter
63
64#endif // FLUTTER_DISPLAY_LIST_EFFECTS_COLOR_SOURCES_DL_RADIAL_GRADIENT_COLOR_SOURCE_H_
void store_color_stops(void *pod, const DlColor *color_data, const float *stop_data)
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...
virtual const void * pod() const override
const DlRadialGradientColorSource * asRadialGradient() const override
#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