Flutter Engine
 
Loading...
Searching...
No Matches
dl_sweep_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_SWEEP_GRADIENT_COLOR_SOURCE_H_
6#define FLUTTER_DISPLAY_LIST_EFFECTS_COLOR_SOURCES_DL_SWEEP_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 start() const { return start_; }
29 DlScalar end() const { return end_; }
30
31 protected:
32 virtual const void* pod() const override { return this + 1; }
33
34 bool equals_(DlColorSource const& other) const override;
35
36 private:
37 template <typename Colors>
41 uint32_t stop_count,
42 Colors colors,
43 const float* stops,
45 const DlMatrix* matrix = nullptr)
47 center_(center),
48 start_(start),
49 end_(end) {
50 store_color_stops(this + 1, colors, stops);
51 }
52
53 explicit DlSweepGradientColorSource(const DlSweepGradientColorSource* source);
54
55 DlPoint center_;
56 DlScalar start_;
57 DlScalar end_;
58
59 friend class DlColorSource;
60 friend class DisplayListBuilder;
61
63};
64
65} // namespace flutter
66
67#endif // FLUTTER_DISPLAY_LIST_EFFECTS_COLOR_SOURCES_DL_SWEEP_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 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...
std::shared_ptr< DlColorSource > shared() const override
const DlSweepGradientColorSource * asSweepGradient() 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