| 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 #pragma once
6
7 #include "impeller/entity/entity_pass_target.h"
8 #include "impeller/renderer/context.h"
9 #include "impeller/renderer/render_pass.h"
10 #include "impeller/renderer/render_target.h"
11
12 namespace impeller {
13
14 class InlinePassContext {
15 public:
16 struct RenderPassResult {
17 std::shared_ptr<RenderPass> pass;
18 std::shared_ptr<Texture> backdrop_texture;
19 };
20
21 InlinePassContext(
22 std::shared_ptr<Context> context,
23 EntityPassTarget& pass_target,
24 uint32_t pass_texture_reads,
25 std::optional<RenderPassResult> collapsed_parent_pass = std::nullopt);
26 ~InlinePassContext();
27
28 bool IsValid() const;
29 bool IsActive() const;
30 std::shared_ptr<Texture> GetTexture();
31 bool EndPass();
32 EntityPassTarget& GetPassTarget() const;
33 uint32_t GetPassCount() const;
34
35 RenderPassResult GetRenderPass(uint32_t pass_depth);
36
37 private:
38 std::shared_ptr<Context> context_;
39 EntityPassTarget& pass_target_;
40 std::shared_ptr<CommandBuffer> command_buffer_;
41 std::shared_ptr<RenderPass> pass_;
42 uint32_t pass_count_ = 0;
43 uint32_t total_pass_reads_ = 0;
44 // Whether this context is collapsed into a parent entity pass.
45 bool is_collapsed_ = false;
46
47 FML_DISALLOW_COPY_AND_ASSIGN(InlinePassContext);
48 };
49
50 } // namespace impeller
impeller::EntityPassTarget
Definition: entity_pass_target.h:14
impeller::InlinePassContext::RenderPassResult
Definition: inline_pass_context.h:16
impeller::InlinePassContext::InlinePassContext
InlinePassContext(std::shared_ptr< Context > context, EntityPassTarget &pass_target, uint32_t pass_texture_reads, std::optional< RenderPassResult > collapsed_parent_pass=std::nullopt)
Definition: inline_pass_context.cc:17
impeller::InlinePassContext::RenderPassResult::backdrop_texture
std::shared_ptr< Texture > backdrop_texture
Definition: inline_pass_context.h:18
impeller::InlinePassContext::GetPassCount
uint32_t GetPassCount() const
Definition: inline_pass_context.cc:179
render_pass.h
impeller::InlinePassContext::IsActive
bool IsActive() const
Definition: inline_pass_context.cc:41
impeller::InlinePassContext::GetRenderPass
RenderPassResult GetRenderPass(uint32_t pass_depth)
Definition: inline_pass_context.cc:76
impeller::InlinePassContext
Definition: inline_pass_context.h:14
impeller::InlinePassContext::GetTexture
std::shared_ptr< Texture > GetTexture()
Definition: inline_pass_context.cc:45
impeller::InlinePassContext::EndPass
bool EndPass()
Definition: inline_pass_context.cc:52
entity_pass_target.h
impeller::InlinePassContext::IsValid
bool IsValid() const
Definition: inline_pass_context.cc:37
impeller::InlinePassContext::GetPassTarget
EntityPassTarget & GetPassTarget() const
Definition: inline_pass_context.cc:72
context.h
impeller::InlinePassContext::~InlinePassContext
~InlinePassContext()
Definition: inline_pass_context.cc:31
render_target.h
impeller::InlinePassContext::RenderPassResult::pass
std::shared_ptr< RenderPass > pass
Definition: inline_pass_context.h:17
impeller
Definition: aiks_context.cc:10