| Flutter Impeller |

anonymous_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_ANONYMOUS_CONTENTS_H_
6 #define FLUTTER_IMPELLER_ENTITY_CONTENTS_ANONYMOUS_CONTENTS_H_
7
8 #include <memory>
9
10 #include "impeller/entity/contents/contents.h"
11
12 namespace impeller {
13
14 class AnonymousContents final : public Contents {
15 public:
16 static std::shared_ptr<Contents> Make(RenderProc render_proc,
17 CoverageProc coverage_proc);
18
19 // |Contents|
20 ~AnonymousContents() override;
21
22 // |Contents|
23 bool Render(const ContentContext& renderer,
24 const Entity& entity,
25 RenderPass& pass) const override;
26
27 // |Contents|
28 std::optional<Rect> GetCoverage(const Entity& entity) const override;
29
30 private:
31 RenderProc render_proc_;
32 CoverageProc coverage_proc_;
33
34 AnonymousContents(RenderProc render_proc, CoverageProc coverage_proc);
35
36 AnonymousContents(const AnonymousContents&) = delete;
37
38 AnonymousContents& operator=(const AnonymousContents&) = delete;
39 };
40
41 } // namespace impeller
42
43 #endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_ANONYMOUS_CONTENTS_H_
impeller::AnonymousContents
Definition: anonymous_contents.h:14
impeller::AnonymousContents::Make
static std::shared_ptr< Contents > Make(RenderProc render_proc, CoverageProc coverage_proc)
Definition: anonymous_contents.cc:11
impeller::AnonymousContents::~AnonymousContents
~AnonymousContents() override
impeller::AnonymousContents::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: anonymous_contents.cc:30
impeller::AnonymousContents::Render
bool Render(const ContentContext &renderer, const Entity &entity, RenderPass &pass) const override
Definition: anonymous_contents.cc:24
impeller::ContentContext
Definition: content_context.h:371
impeller::Contents
Definition: contents.h:31
impeller::Contents::CoverageProc
std::function< std::optional< Rect >(const Entity &entity)> CoverageProc
Definition: contents.h:40
impeller::Contents::RenderProc
std::function< bool(const ContentContext &renderer, const Entity &entity, RenderPass &pass)> RenderProc
Definition: contents.h:39
impeller::Entity
Definition: entity.h:20
impeller::RenderPass
Render passes encode render commands directed as one specific render target into an underlying comman...
Definition: render_pass.h:30
contents.h
impeller
Definition: allocation.cc:12