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