| Flutter Impeller |

entity_pass_target.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_ENTITY_PASS_TARGET_H_
6 #define FLUTTER_IMPELLER_ENTITY_ENTITY_PASS_TARGET_H_
7
8 #include "impeller/entity/contents/content_context.h"
9 #include "impeller/renderer/render_target.h"
10
11 namespace impeller {
12
13 class InlinePassContext;
14
15 class EntityPassTarget {
16 public:
17 explicit EntityPassTarget(const RenderTarget& render_target,
18 bool supports_read_from_resolve,
19 bool supports_implicit_msaa);
20
21 /// @brief Flips the backdrop and returns a readable texture that can be
22 /// bound/sampled to restore the previous pass.
23 ///
24 /// After this method is called, a new `RenderPass` that attaches the
25 /// result of `GetRenderTarget` is guaranteed to be able to read the
26 /// previous pass's backdrop texture (which is returned by this
27 /// method).
28 std::shared_ptr<Texture> Flip(const ContentContext& renderer);
29
30 RenderTarget& GetRenderTarget();
31
32 /// @brief Remove the cached secondary color texture.
33 void RemoveSecondary();
34
35 bool IsValid() const;
36
37 private:
38 RenderTarget target_;
39 std::shared_ptr<Texture> secondary_color_texture_;
40
41 bool supports_read_from_resolve_;
42 bool supports_implicit_msaa_;
43
44 friend InlinePassContext;
45
46 EntityPassTarget& operator=(const EntityPassTarget&) = delete;
47 };
48
49 } // namespace impeller
50
51 #endif // FLUTTER_IMPELLER_ENTITY_ENTITY_PASS_TARGET_H_
impeller::ContentContext
Definition: content_context.h:371
impeller::EntityPassTarget
Definition: entity_pass_target.h:15
impeller::EntityPassTarget::IsValid
bool IsValid() const
Definition: entity_pass_target.cc:75
impeller::EntityPassTarget::GetRenderTarget
RenderTarget & GetRenderTarget()
Definition: entity_pass_target.cc:71
impeller::EntityPassTarget::RemoveSecondary
void RemoveSecondary()
Remove the cached secondary color texture.
Definition: entity_pass_target.cc:79
impeller::EntityPassTarget::EntityPassTarget
EntityPassTarget(const RenderTarget &render_target, bool supports_read_from_resolve, bool supports_implicit_msaa)
Definition: entity_pass_target.cc:13
impeller::EntityPassTarget::Flip
std::shared_ptr< Texture > Flip(const ContentContext &renderer)
Flips the backdrop and returns a readable texture that can be bound/sampled to restore the previous p...
Definition: entity_pass_target.cc:20
impeller::InlinePassContext
Definition: inline_pass_context.h:17
impeller::RenderTarget
Definition: render_target.h:38
content_context.h
impeller
Definition: allocation.cc:12
render_target.h