Flutter Engine
 
Loading...
Searching...
No Matches
dl_linear_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_LINEAR_GRADIENT_COLOR_SOURCE_H_
6#define FLUTTER_DISPLAY_LIST_EFFECTS_COLOR_SOURCES_DL_LINEAR_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 DlColorSourceType type() const override {
22 }
23 size_t size() const override { return sizeof(*this) + vector_sizes(); }
24
25 std::shared_ptr<DlColorSource> shared() const override;
26
27 const DlPoint& start_point() const { return start_point_; }
28 const DlPoint& end_point() const { return end_point_; }
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>
38 const DlPoint end_point,
39 uint32_t stop_count,
40 Colors colors,
41 const float* stops,
43 const DlMatrix* matrix = nullptr)
45 start_point_(start_point),
46 end_point_(end_point) {
47 store_color_stops(this + 1, colors, stops);
48 }
49
50 explicit DlLinearGradientColorSource(
51 const DlLinearGradientColorSource* source);
52
53 DlPoint start_point_;
54 DlPoint end_point_;
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_LINEAR_GRADIENT_COLOR_SOURCE_H_
void store_color_stops(void *pod, const DlColor *color_data, const float *stop_data)
virtual const void * pod() 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 DlLinearGradientColorSource * asLinearGradient() const override
std::shared_ptr< DlColorSource > shared() const override
bool equals_(DlColorSource const &other) const override
#define FML_DISALLOW_COPY_ASSIGN_AND_MOVE(TypeName)
Definition macros.h:31
impeller::Point DlPoint
A 4x4 matrix using column-major storage.
Definition matrix.h:37