Flutter Engine
The Flutter Engine
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
11
12namespace impeller {
13
14class AnonymousContents final : public Contents {
15 public:
16 static std::shared_ptr<Contents> Make(RenderProc render_proc,
17 CoverageProc coverage_proc);
18
19 // |Contents|
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_
static std::shared_ptr< Contents > Make(RenderProc render_proc, CoverageProc coverage_proc)
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.
bool Render(const ContentContext &renderer, const Entity &entity, RenderPass &pass) const override
std::function< std::optional< Rect >(const Entity &entity)> CoverageProc
Definition: contents.h:47
std::function< bool(const ContentContext &renderer, const Entity &entity, RenderPass &pass)> RenderProc
Definition: contents.h:46
Render passes encode render commands directed as one specific render target into an underlying comman...
Definition: render_pass.h:33