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