| Flutter Impeller |

Public Member Functions | List of all members
impeller::AiksInspector Class Reference

`#include <aiks_playground_inspector.h>`

## Public Member Functions
| AiksInspector ()
const std::optional< Picture > & | RenderInspector (AiksContext &aiks_context, const std::function< std::optional< Picture >()> &picture_callback)
void | HackResetDueToTextureLeaks ()

## Detailed Description

Definition at line 16 of file aiks_playground_inspector.h.

## Constructor & Destructor Documentation

## ◆ AiksInspector()

impeller::AiksInspector::AiksInspector | ( |  | ) |
| default

## Member Function Documentation

## ◆ HackResetDueToTextureLeaks()

void impeller::AiksInspector::HackResetDueToTextureLeaks | ( |  | ) |

Definition at line 66 of file aiks_playground_inspector.cc.

66 {
67 last_picture_.reset();
68 }

Referenced by impeller::AiksPlayground::TearDown().

## ◆ RenderInspector()

const std::optional< Picture > & impeller::AiksInspector::RenderInspector | ( | AiksContext & | aiks_context,
|  | const std::function< std::optional< Picture >()> & | picture_callback
| ) |  |

Configure the next frame.

Configure the next frame.

Definition at line 25 of file aiks_playground_inspector.cc.

27 {
28 //----------------------------------------------------------------------------
29 /// Configure the next frame.
30 ///
31
32 RenderCapture(aiks_context.GetContext()->capture);
33
34 //----------------------------------------------------------------------------
35 /// Configure the next frame.
36 ///
37
38 if (ImGui::IsKeyPressed(ImGuiKey_Z)) {
39 wireframe_ = !wireframe_;
40 aiks_context.GetContentContext().SetWireframe(wireframe_);
41 }
42
43 if (ImGui::IsKeyPressed(ImGuiKey_C)) {
44 capturing_ = !capturing_;
45 if (capturing_) {
46 aiks_context.GetContext()->capture =
47 CaptureContext::MakeAllowlist({kSupportedDocuments});
48 }
49 }
50 if (!capturing_) {
51 hovered_element_ = nullptr;
52 selected_element_ = nullptr;
53 aiks_context.GetContext()->capture = CaptureContext::MakeInactive();
54 std::optional<Picture> new_picture = picture_callback();
55
56 // If the new picture doesn't have a pass, that means it was already moved
57 // into the inspector. Simply re-emit the last received valid picture.
58 if (!new_picture.has_value() || new_picture->pass) {
59 last_picture_ = std::move(new_picture);
60 }
61 }
62
63 return last_picture_;
64 }

References impeller::AiksContext::GetContentContext(), impeller::AiksContext::GetContext(), impeller::kSupportedDocuments, impeller::CaptureContext::MakeAllowlist(), impeller::CaptureContext::MakeInactive(), and impeller::ContentContext::SetWireframe().

Referenced by impeller::AiksPlayground::OpenPlaygroundHere().

The documentation for this class was generated from the following files:

- impeller/aiks/aiks_playground_inspector.h
- impeller/aiks/aiks_playground_inspector.cc

impeller::kSupportedDocuments
static const std::initializer_list< std::string > kSupportedDocuments
Definition: aiks_playground_inspector.cc:20
impeller::CaptureContext::MakeAllowlist
static CaptureContext MakeAllowlist(std::initializer_list< std::string > allowlist)
Definition: capture.cc:159
impeller::CaptureContext::MakeInactive
static CaptureContext MakeInactive()
Definition: capture.cc:155