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