Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit ba84e44

Browse files
authored
[Impeller] Reland: Remove Entity capture/AiksInspector. (#52932)
Resolves flutter/flutter#134748. This was a really fun experiment. I learned a lot from it, and it genuinely helped me solve some coverage-related problems, but the reality is it was too little too late -- by the time we had this capture system, we had already solved most of the problems that would have benefitted from this. It's been a few months since I've used or extended the capabilities of this capture system for something, and I don't have the spare time/energy to give it the love it needs to realize the vision I had for it. I still almost exclusively use a combination of native frame captures and print debugging to solve problems. RIP in peace. This reverts commit 3513909. (#52680)
1 parent fd24d40 commit ba84e44

26 files changed

+33
-1008
lines changed

ci/licenses_golden/licenses_flutter

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42255,8 +42255,6 @@ ORIGIN: ../../../flutter/impeller/aiks/aiks_context.cc + ../../../flutter/LICENS
4225542255
ORIGIN: ../../../flutter/impeller/aiks/aiks_context.h + ../../../flutter/LICENSE
4225642256
ORIGIN: ../../../flutter/impeller/aiks/aiks_playground.cc + ../../../flutter/LICENSE
4225742257
ORIGIN: ../../../flutter/impeller/aiks/aiks_playground.h + ../../../flutter/LICENSE
42258-
ORIGIN: ../../../flutter/impeller/aiks/aiks_playground_inspector.cc + ../../../flutter/LICENSE
42259-
ORIGIN: ../../../flutter/impeller/aiks/aiks_playground_inspector.h + ../../../flutter/LICENSE
4226042258
ORIGIN: ../../../flutter/impeller/aiks/canvas.cc + ../../../flutter/LICENSE
4226142259
ORIGIN: ../../../flutter/impeller/aiks/canvas.h + ../../../flutter/LICENSE
4226242260
ORIGIN: ../../../flutter/impeller/aiks/canvas_benchmarks.cc + ../../../flutter/LICENSE
@@ -42354,8 +42352,6 @@ ORIGIN: ../../../flutter/impeller/core/allocator.cc + ../../../flutter/LICENSE
4235442352
ORIGIN: ../../../flutter/impeller/core/allocator.h + ../../../flutter/LICENSE
4235542353
ORIGIN: ../../../flutter/impeller/core/buffer_view.cc + ../../../flutter/LICENSE
4235642354
ORIGIN: ../../../flutter/impeller/core/buffer_view.h + ../../../flutter/LICENSE
42357-
ORIGIN: ../../../flutter/impeller/core/capture.cc + ../../../flutter/LICENSE
42358-
ORIGIN: ../../../flutter/impeller/core/capture.h + ../../../flutter/LICENSE
4235942355
ORIGIN: ../../../flutter/impeller/core/device_buffer.cc + ../../../flutter/LICENSE
4236042356
ORIGIN: ../../../flutter/impeller/core/device_buffer.h + ../../../flutter/LICENSE
4236142357
ORIGIN: ../../../flutter/impeller/core/device_buffer_descriptor.cc + ../../../flutter/LICENSE
@@ -45126,8 +45122,6 @@ FILE: ../../../flutter/impeller/aiks/aiks_context.cc
4512645122
FILE: ../../../flutter/impeller/aiks/aiks_context.h
4512745123
FILE: ../../../flutter/impeller/aiks/aiks_playground.cc
4512845124
FILE: ../../../flutter/impeller/aiks/aiks_playground.h
45129-
FILE: ../../../flutter/impeller/aiks/aiks_playground_inspector.cc
45130-
FILE: ../../../flutter/impeller/aiks/aiks_playground_inspector.h
4513145125
FILE: ../../../flutter/impeller/aiks/canvas.cc
4513245126
FILE: ../../../flutter/impeller/aiks/canvas.h
4513345127
FILE: ../../../flutter/impeller/aiks/canvas_benchmarks.cc
@@ -45225,8 +45219,6 @@ FILE: ../../../flutter/impeller/core/allocator.cc
4522545219
FILE: ../../../flutter/impeller/core/allocator.h
4522645220
FILE: ../../../flutter/impeller/core/buffer_view.cc
4522745221
FILE: ../../../flutter/impeller/core/buffer_view.h
45228-
FILE: ../../../flutter/impeller/core/capture.cc
45229-
FILE: ../../../flutter/impeller/core/capture.h
4523045222
FILE: ../../../flutter/impeller/core/device_buffer.cc
4523145223
FILE: ../../../flutter/impeller/core/device_buffer.h
4523245224
FILE: ../../../flutter/impeller/core/device_buffer_descriptor.cc

impeller/BUILD.gn

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ config("impeller_public_config") {
1414
defines += [ "IMPELLER_DEBUG=1" ]
1515
}
1616

17-
if (impeller_capture) {
18-
defines += [ "IMPELLER_ENABLE_CAPTURE=1" ]
19-
}
20-
2117
if (impeller_supports_rendering) {
2218
defines += [ "IMPELLER_SUPPORTS_RENDERING=1" ]
2319
}

impeller/aiks/BUILD.gn

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ impeller_component("aiks_playground") {
4545
sources = [
4646
"aiks_playground.cc",
4747
"aiks_playground.h",
48-
"aiks_playground_inspector.cc",
49-
"aiks_playground_inspector.h",
5048
]
5149
deps = [
5250
":aiks",

impeller/aiks/aiks_playground.cc

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "impeller/aiks/aiks_playground.h"
66

77
#include <memory>
8+
#include <optional>
89

910
#include "impeller/aiks/aiks_context.h"
1011
#include "impeller/display_list/dl_dispatcher.h"
@@ -24,14 +25,24 @@ void AiksPlayground::SetTypographerContext(
2425
}
2526

2627
void AiksPlayground::TearDown() {
27-
inspector_.HackResetDueToTextureLeaks();
2828
PlaygroundTest::TearDown();
2929
}
3030

3131
bool AiksPlayground::OpenPlaygroundHere(Picture picture) {
32-
return OpenPlaygroundHere([&picture](AiksContext& renderer) -> Picture {
33-
return std::move(picture);
34-
});
32+
if (!switches_.enable_playground) {
33+
return true;
34+
}
35+
36+
AiksContext renderer(GetContext(), typographer_context_);
37+
38+
if (!renderer.IsValid()) {
39+
return false;
40+
}
41+
42+
return Playground::OpenPlaygroundHere(
43+
[&renderer, &picture](RenderTarget& render_target) -> bool {
44+
return renderer.Render(picture, render_target, true);
45+
});
3546
}
3647

3748
bool AiksPlayground::OpenPlaygroundHere(AiksPlaygroundCallback callback) {
@@ -46,10 +57,8 @@ bool AiksPlayground::OpenPlaygroundHere(AiksPlaygroundCallback callback) {
4657
}
4758

4859
return Playground::OpenPlaygroundHere(
49-
[this, &renderer, &callback](RenderTarget& render_target) -> bool {
50-
const std::optional<Picture>& picture = inspector_.RenderInspector(
51-
renderer, [&]() { return callback(renderer); });
52-
60+
[&renderer, &callback](RenderTarget& render_target) -> bool {
61+
std::optional<Picture> picture = callback(renderer);
5362
if (!picture.has_value()) {
5463
return false;
5564
}

impeller/aiks/aiks_playground.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
#include "flutter/display_list/display_list.h"
99
#include "impeller/aiks/aiks_context.h"
10-
#include "impeller/aiks/aiks_playground_inspector.h"
1110
#include "impeller/aiks/picture.h"
1211
#include "impeller/playground/playground_test.h"
1312
#include "impeller/typographer/typographer_context.h"
@@ -41,7 +40,6 @@ class AiksPlayground : public PlaygroundTest {
4140

4241
private:
4342
std::shared_ptr<TypographerContext> typographer_context_;
44-
AiksInspector inspector_;
4543

4644
AiksPlayground(const AiksPlayground&) = delete;
4745

impeller/aiks/aiks_playground_inspector.cc

Lines changed: 0 additions & 277 deletions
This file was deleted.

0 commit comments

Comments
 (0)