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 #pragma once
6 
7 #include <functional>
8 #include <memory>
9 
10 #include "flutter/fml/macros.h"
12 
13 namespace impeller {
14 
15 class AnonymousContents final : public Contents {
16  public:
17  static std::shared_ptr<Contents> Make(RenderProc render_proc,
18  CoverageProc coverage_proc);
19 
20  // |Contents|
21  ~AnonymousContents() override;
22 
23  // |Contents|
24  bool Render(const ContentContext& renderer,
25  const Entity& entity,
26  RenderPass& pass) const override;
27 
28  // |Contents|
29  std::optional<Rect> GetCoverage(const Entity& entity) const override;
30 
31  private:
32  RenderProc render_proc_;
33  CoverageProc coverage_proc_;
34 
35  AnonymousContents(RenderProc render_proc, CoverageProc coverage_proc);
36 
37  FML_DISALLOW_COPY_AND_ASSIGN(AnonymousContents);
38 };
39 
40 } // namespace impeller
contents.h
impeller::AnonymousContents::GetCoverage
std::optional< Rect > GetCoverage(const Entity &entity) const override
Get the screen space bounding rectangle that this contents affects.
Definition: anonymous_contents.cc:30
impeller::Entity
Definition: entity.h:21
impeller::AnonymousContents
Definition: anonymous_contents.h:15
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:27
impeller::Contents::RenderProc
std::function< bool(const ContentContext &renderer, const Entity &entity, RenderPass &pass)> RenderProc
Definition: contents.h:48
impeller::Contents::CoverageProc
std::function< std::optional< Rect >(const Entity &entity)> CoverageProc
Definition: contents.h:49
impeller::Contents
Definition: contents.h:33
impeller
Definition: aiks_context.cc:10
impeller::ContentContext
Definition: content_context.h:344
impeller::AnonymousContents::Make
static std::shared_ptr< Contents > Make(RenderProc render_proc, CoverageProc coverage_proc)
Definition: anonymous_contents.cc:11