Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
solid_color_contents.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_IMPELLER_ENTITY_CONTENTS_SOLID_COLOR_CONTENTS_H_
6#define FLUTTER_IMPELLER_ENTITY_CONTENTS_SOLID_COLOR_CONTENTS_H_
7
8#include <memory>
9
14
15namespace impeller {
16
17class Path;
18class HostBuffer;
19struct VertexBuffer;
20
22 public:
24
26
27 static std::unique_ptr<SolidColorContents> Make(const Path& path,
28 Color color);
29
30 void SetColor(Color color);
31
32 Color GetColor() const;
33
34 // |ColorSourceContents|
35 bool IsSolidColor() const override;
36
37 // |Contents|
38 bool IsOpaque() const override;
39
40 // |Contents|
41 std::optional<Rect> GetCoverage(const Entity& entity) const override;
42
43 // |Contents|
44 bool Render(const ContentContext& renderer,
45 const Entity& entity,
46 RenderPass& pass) const override;
47
48 std::optional<Color> AsBackgroundColor(const Entity& entity,
49 ISize target_size) const override;
50
51 // |Contents|
52 [[nodiscard]] bool ApplyColorFilter(
53 const ColorFilterProc& color_filter_proc) override;
54
55 private:
56 Color color_;
57
59
60 SolidColorContents& operator=(const SolidColorContents&) = delete;
61};
62
63} // namespace impeller
64
65#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_SOLID_COLOR_CONTENTS_H_
SkColor4f color
std::function< Color(Color)> ColorFilterProc
Definition contents.h:38
Paths are lightweight objects that describe a collection of linear, quadratic, or cubic segments....
Definition path.h:51
Render passes encode render commands directed as one specific render target into an underlying comman...
Definition render_pass.h:33
bool IsOpaque() const override
Whether this Contents only emits opaque source colors from the fragment stage. This value does not ac...
bool ApplyColorFilter(const ColorFilterProc &color_filter_proc) override
If possible, applies a color filter to this contents inputs on the CPU.
bool Render(const ContentContext &renderer, const Entity &entity, RenderPass &pass) const override
static std::unique_ptr< SolidColorContents > Make(const Path &path, Color color)
std::optional< Color > AsBackgroundColor(const Entity &entity, ISize target_size) const override
Returns a color if this Contents will flood the given target_size with a color. This output color is ...
std::optional< Rect > GetCoverage(const Entity &entity) const override
Get the area of the render pass that will be affected when this contents is rendered.
CanvasPath Path
Definition dart_ui.cc:58