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