Flutter Engine
The Flutter Engine
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
18 public:
20
22
23 static std::unique_ptr<SolidColorContents> Make(const Path& path,
24 Color color);
25
26 void SetColor(Color color);
27
28 Color GetColor() const;
29
30 // |ColorSourceContents|
31 bool IsSolidColor() const override;
32
33 // |Contents|
34 bool IsOpaque() const override;
35
36 // |Contents|
37 std::optional<Rect> GetCoverage(const Entity& entity) const override;
38
39 // |Contents|
40 bool Render(const ContentContext& renderer,
41 const Entity& entity,
42 RenderPass& pass) const override;
43
44 std::optional<Color> AsBackgroundColor(const Entity& entity,
45 ISize target_size) const override;
46
47 // |Contents|
48 [[nodiscard]] bool ApplyColorFilter(
49 const ColorFilterProc& color_filter_proc) override;
50
51 private:
52 Color color_;
53
55
56 SolidColorContents& operator=(const SolidColorContents&) = delete;
57};
58
59} // namespace impeller
60
61#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_SOLID_COLOR_CONTENTS_H_
std::function< Color(Color)> ColorFilterProc
Definition: contents.h:35
Paths are lightweight objects that describe a collection of linear, quadratic, or cubic segments....
Definition: path.h:52
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 IsSolidColor() const override
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.
DlColor color
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition: switches.h:57