| Flutter Impeller |

shadow_vertices_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_SHADOW_VERTICES_CONTENTS_H_
6 #define FLUTTER_IMPELLER_ENTITY_CONTENTS_SHADOW_VERTICES_CONTENTS_H_
7
8 #include <memory>
9
10 #include "impeller/entity/contents/contents.h"
11 #include "impeller/entity/contents/solid_rrect_blur_contents.h"
12 #include "impeller/entity/entity.h"
13 #include "impeller/entity/geometry/shadow_path_geometry.h"
14 #include "impeller/geometry/color.h"
15
16 namespace impeller {
17
18 /// A vertices contents for (optional) per-color vertices + texture and any
19 /// blend mode.
20 class ShadowVerticesContents final : public SolidBlurContents {
21 public:
22 static std::shared_ptr<ShadowVerticesContents> Make(
23 const std::shared_ptr<ShadowVertices>& geometry);
24
25 // |SolidBlurContents|
26 void SetColor(Color color) override;
27
28 // |Contents|
29 std::optional<Rect> GetCoverage(const Entity& entity) const override;
30
31 // |Contents|
32 bool Render(const ContentContext& renderer,
33 const Entity& entity,
34 RenderPass& pass) const override;
35
36 explicit ShadowVerticesContents(
37 const std::shared_ptr<ShadowVertices>& geometry);
38
39 ~ShadowVerticesContents() override;
40
41 private:
42 const std::shared_ptr<ShadowVertices> geometry_;
43 Color shadow_color_;
44
45 ShadowVerticesContents(const ShadowVerticesContents&) = delete;
46
47 ShadowVerticesContents& operator=(const ShadowVerticesContents&) = delete;
48 };
49
50 } // namespace impeller
51
52 #endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_SHADOW_VERTICES_CONTENTS_H_
impeller::ContentContext
Definition: content_context.h:122
impeller::Entity
Definition: entity.h:26
impeller::RenderPass
Render passes encode render commands directed as one specific render target into an underlying comman...
Definition: render_pass.h:30
impeller::ShadowVerticesContents
Definition: shadow_vertices_contents.h:20
impeller::ShadowVerticesContents::ShadowVerticesContents
ShadowVerticesContents(const std::shared_ptr< ShadowVertices > &geometry)
Definition: shadow_vertices_contents.cc:26
impeller::ShadowVerticesContents::Render
bool Render(const ContentContext &renderer, const Entity &entity, RenderPass &pass) const override
Definition: shadow_vertices_contents.cc:46
impeller::ShadowVerticesContents::~ShadowVerticesContents
~ShadowVerticesContents() override
Definition: shadow_vertices_contents.cc:30
impeller::ShadowVerticesContents::Make
static std::shared_ptr< ShadowVerticesContents > Make(const std::shared_ptr< ShadowVertices > &geometry)
Definition: shadow_vertices_contents.cc:32
impeller::ShadowVerticesContents::GetCoverage
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.
Definition: shadow_vertices_contents.cc:37
impeller::ShadowVerticesContents::SetColor
void SetColor(Color color) override
Definition: shadow_vertices_contents.cc:42
impeller::SolidBlurContents
A base class for any accelerated single color blur Contents that lets the |Canvas::AttemptDrawBlur| c...
Definition: solid_rrect_like_blur_contents.h:23
color.h
contents.h
entity.h
impeller
Definition: allocation.cc:12
shadow_path_geometry.h
solid_rrect_blur_contents.h
impeller::Color
Definition: color.h:124