| Flutter Impeller |

aiks_playground_inspector.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_AIKS_AIKS_PLAYGROUND_INSPECTOR_H_
6 #define FLUTTER_IMPELLER_AIKS_AIKS_PLAYGROUND_INSPECTOR_H_
7
8 #include <functional>
9 #include <optional>
10
11 #include "flutter/fml/macros.h"
12 #include "impeller/aiks/aiks_context.h"
13 #include "impeller/aiks/picture.h"
14 #include "impeller/core/capture.h"
15 #include "impeller/renderer/context.h"
16
17 namespace impeller {
18
19 class AiksInspector {
20 public:
21 AiksInspector();
22
23 const std::optional<Picture>& RenderInspector(
24 AiksContext& aiks_context,
25 const std::function<std::optional<Picture>()>& picture_callback);
26
27 // Resets (releases) the underlying |Picture| object.
28 //
29 // Underlying issue: <https://github.com/flutter/flutter/issues/134678>.
30 //
31 // The tear-down code is not running in the right order; we still have a
32 // reference to the |Picture| object when the |Context| is being destroyed,
33 // which causes the |Texture| objects to leak.
34 //
35 // TODO(matanlurey): https://github.com/flutter/flutter/issues/134748.
36 void HackResetDueToTextureLeaks();
37
38 private:
39 void RenderCapture(CaptureContext& capture_context);
40 void RenderCaptureElement(CaptureElement& element);
41
42 bool capturing_ = false;
43 bool wireframe_ = false;
44 CaptureElement* hovered_element_ = nullptr;
45 CaptureElement* selected_element_ = nullptr;
46 std::optional<Picture> last_picture_;
47
48 AiksInspector(const AiksInspector&) = delete;
49
50 AiksInspector& operator=(const AiksInspector&) = delete;
51 };
52
53 }; // namespace impeller
54
55 #endif // FLUTTER_IMPELLER_AIKS_AIKS_PLAYGROUND_INSPECTOR_H_
capture.h
impeller::AiksContext
Definition: aiks_context.h:20
impeller::AiksInspector::RenderInspector
const std::optional< Picture > & RenderInspector(AiksContext &aiks_context, const std::function< std::optional< Picture >()> &picture_callback)
Definition: aiks_playground_inspector.cc:25
impeller::AiksInspector::HackResetDueToTextureLeaks
void HackResetDueToTextureLeaks()
Definition: aiks_playground_inspector.cc:66
aiks_context.h
picture.h
impeller::AiksInspector
Definition: aiks_playground_inspector.h:19
impeller::CaptureContext
Definition: capture.h:269
impeller::AiksInspector::AiksInspector
AiksInspector()
impeller::CaptureElement
Definition: capture.h:199
context.h
impeller
Definition: aiks_blur_unittests.cc:20