| Flutter Impeller |

inline_pass_context.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_INLINE_PASS_CONTEXT_H_
6 #define FLUTTER_IMPELLER_ENTITY_INLINE_PASS_CONTEXT_H_
7
8 #include <cstdint>
9
10 #include "impeller/entity/entity_pass_target.h"
11 #include "impeller/renderer/context.h"
12 #include "impeller/renderer/render_pass.h"
13 #include "impeller/renderer/render_target.h"
14
15 namespace impeller {
16
17 class InlinePassContext {
18 public:
19 struct RenderPassResult {
20 std::shared_ptr<RenderPass> pass;
21 std::shared_ptr<Texture> backdrop_texture;
22 };
23
24 InlinePassContext(
25 std::shared_ptr<Context> context,
26 EntityPassTarget& pass_target,
27 uint32_t pass_texture_reads,
28 uint32_t entity_count,
29 std::optional<RenderPassResult> collapsed_parent_pass = std::nullopt);
30
31 ~InlinePassContext();
32
33 bool IsValid() const;
34
35 bool IsActive() const;
36
37 std::shared_ptr<Texture> GetTexture();
38
39 bool EndPass();
40
41 EntityPassTarget& GetPassTarget() const;
42
43 uint32_t GetPassCount() const;
44
45 RenderPassResult GetRenderPass(uint32_t pass_depth);
46
47 private:
48 std::shared_ptr<Context> context_;
49 EntityPassTarget& pass_target_;
50 std::shared_ptr<CommandBuffer> command_buffer_;
51 std::shared_ptr<RenderPass> pass_;
52 uint32_t pass_count_ = 0;
53 uint32_t entity_count_ = 0;
54
55 // Whether this context is collapsed into a parent entity pass.
56 bool is_collapsed_ = false;
57
58 InlinePassContext(const InlinePassContext&) = delete;
59
60 InlinePassContext& operator=(const InlinePassContext&) = delete;
61 };
62
63 } // namespace impeller
64
65 #endif // FLUTTER_IMPELLER_ENTITY_INLINE_PASS_CONTEXT_H_
impeller::EntityPassTarget
Definition: entity_pass_target.h:15
impeller::InlinePassContext::RenderPassResult
Definition: inline_pass_context.h:19
impeller::InlinePassContext::RenderPassResult::backdrop_texture
std::shared_ptr< Texture > backdrop_texture
Definition: inline_pass_context.h:21
impeller::InlinePassContext::GetPassCount
uint32_t GetPassCount() const
Definition: inline_pass_context.cc:175
render_pass.h
impeller::InlinePassContext::IsActive
bool IsActive() const
Definition: inline_pass_context.cc:42
impeller::InlinePassContext::GetRenderPass
RenderPassResult GetRenderPass(uint32_t pass_depth)
Definition: inline_pass_context.cc:77
impeller::InlinePassContext
Definition: inline_pass_context.h:17
impeller::InlinePassContext::GetTexture
std::shared_ptr< Texture > GetTexture()
Definition: inline_pass_context.cc:46
impeller::InlinePassContext::EndPass
bool EndPass()
Definition: inline_pass_context.cc:53
entity_pass_target.h
impeller::InlinePassContext::IsValid
bool IsValid() const
Definition: inline_pass_context.cc:38
impeller::InlinePassContext::InlinePassContext
InlinePassContext(std::shared_ptr< Context > context, EntityPassTarget &pass_target, uint32_t pass_texture_reads, uint32_t entity_count, std::optional< RenderPassResult > collapsed_parent_pass=std::nullopt)
Definition: inline_pass_context.cc:17
impeller::InlinePassContext::GetPassTarget
EntityPassTarget & GetPassTarget() const
Definition: inline_pass_context.cc:73
context.h
impeller::InlinePassContext::~InlinePassContext
~InlinePassContext()
Definition: inline_pass_context.cc:32
render_target.h
impeller::InlinePassContext::RenderPassResult::pass
std::shared_ptr< RenderPass > pass
Definition: inline_pass_context.h:20
impeller
Definition: aiks_context.cc:10