Skip to content

Commit bf09d34

Browse files
[Impeller] remove entity pass and re-combine canvas implementations. (flutter#55019)
Shouldn't land until experimental canvas bakes a while Major milestone along the route to making display list the impeller API. Removes the secondary compositor in entity pass. After this point, we can begin ripping out the DL->Aiks conversions and making entities more efficient. Fixes flutter/flutter#132417 Fixes flutter/flutter#126386 Fixes flutter/flutter#155114 Part of flutter/flutter#142054
1 parent 00861f5 commit bf09d34

File tree

84 files changed

+1288
-5420
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+1288
-5420
lines changed

BUILD.gn

-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ group("flutter") {
143143
"//flutter/display_list:display_list_region_benchmarks",
144144
"//flutter/display_list:display_list_transform_benchmarks",
145145
"//flutter/fml:fml_benchmarks",
146-
"//flutter/impeller/aiks:canvas_benchmarks",
147146
"//flutter/impeller/geometry:geometry_benchmarks",
148147
"//flutter/lib/ui:ui_benchmarks",
149148
"//flutter/shell/common:shell_benchmarks",

ci/builders/linux_host_engine.json

-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@
168168
"flutter/display_list:display_list_transform_benchmarks",
169169
"flutter/fml:fml_benchmarks",
170170
"flutter/impeller/geometry:geometry_benchmarks",
171-
"flutter/impeller/aiks:canvas_benchmarks",
172171
"flutter/lib/ui:ui_benchmarks",
173172
"flutter/shell/common:shell_benchmarks",
174173
"flutter/shell/testing",

ci/builders/standalone/linux_benchmarks.json

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
"flutter/display_list:display_list_transform_benchmarks",
3131
"flutter/fml:fml_benchmarks",
3232
"flutter/impeller/geometry:geometry_benchmarks",
33-
"flutter/impeller/aiks:canvas_benchmarks",
3433
"flutter/lib/ui:ui_benchmarks",
3534
"flutter/shell/common:shell_benchmarks",
3635
"flutter/shell/testing",

ci/licenses_golden/excluded_files

-2
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,9 @@
128128
../../../flutter/impeller/.clang-format
129129
../../../flutter/impeller/.gitignore
130130
../../../flutter/impeller/README.md
131-
../../../flutter/impeller/aiks/aiks_gradient_unittests.cc
132131
../../../flutter/impeller/aiks/aiks_unittests.cc
133132
../../../flutter/impeller/aiks/aiks_unittests.h
134133
../../../flutter/impeller/aiks/canvas_unittests.cc
135-
../../../flutter/impeller/aiks/testing
136134
../../../flutter/impeller/base/README.md
137135
../../../flutter/impeller/base/allocation_size_unittests.cc
138136
../../../flutter/impeller/base/base_unittests.cc

ci/licenses_golden/licenses_flutter

-22
Original file line numberDiff line numberDiff line change
@@ -42624,21 +42624,14 @@ ORIGIN: ../../../flutter/impeller/aiks/aiks_playground.cc + ../../../flutter/LIC
4262442624
ORIGIN: ../../../flutter/impeller/aiks/aiks_playground.h + ../../../flutter/LICENSE
4262542625
ORIGIN: ../../../flutter/impeller/aiks/canvas.cc + ../../../flutter/LICENSE
4262642626
ORIGIN: ../../../flutter/impeller/aiks/canvas.h + ../../../flutter/LICENSE
42627-
ORIGIN: ../../../flutter/impeller/aiks/canvas_benchmarks.cc + ../../../flutter/LICENSE
4262842627
ORIGIN: ../../../flutter/impeller/aiks/color_filter.cc + ../../../flutter/LICENSE
4262942628
ORIGIN: ../../../flutter/impeller/aiks/color_filter.h + ../../../flutter/LICENSE
4263042629
ORIGIN: ../../../flutter/impeller/aiks/color_source.cc + ../../../flutter/LICENSE
4263142630
ORIGIN: ../../../flutter/impeller/aiks/color_source.h + ../../../flutter/LICENSE
42632-
ORIGIN: ../../../flutter/impeller/aiks/experimental_canvas.cc + ../../../flutter/LICENSE
42633-
ORIGIN: ../../../flutter/impeller/aiks/experimental_canvas.h + ../../../flutter/LICENSE
4263442631
ORIGIN: ../../../flutter/impeller/aiks/image_filter.cc + ../../../flutter/LICENSE
4263542632
ORIGIN: ../../../flutter/impeller/aiks/image_filter.h + ../../../flutter/LICENSE
4263642633
ORIGIN: ../../../flutter/impeller/aiks/paint.cc + ../../../flutter/LICENSE
4263742634
ORIGIN: ../../../flutter/impeller/aiks/paint.h + ../../../flutter/LICENSE
42638-
ORIGIN: ../../../flutter/impeller/aiks/paint_pass_delegate.cc + ../../../flutter/LICENSE
42639-
ORIGIN: ../../../flutter/impeller/aiks/paint_pass_delegate.h + ../../../flutter/LICENSE
42640-
ORIGIN: ../../../flutter/impeller/aiks/picture.cc + ../../../flutter/LICENSE
42641-
ORIGIN: ../../../flutter/impeller/aiks/picture.h + ../../../flutter/LICENSE
4264242635
ORIGIN: ../../../flutter/impeller/base/allocation.cc + ../../../flutter/LICENSE
4264342636
ORIGIN: ../../../flutter/impeller/base/allocation.h + ../../../flutter/LICENSE
4264442637
ORIGIN: ../../../flutter/impeller/base/allocation_size.cc + ../../../flutter/LICENSE
@@ -42833,12 +42826,8 @@ ORIGIN: ../../../flutter/impeller/entity/draw_order_resolver.cc + ../../../flutt
4283342826
ORIGIN: ../../../flutter/impeller/entity/draw_order_resolver.h + ../../../flutter/LICENSE
4283442827
ORIGIN: ../../../flutter/impeller/entity/entity.cc + ../../../flutter/LICENSE
4283542828
ORIGIN: ../../../flutter/impeller/entity/entity.h + ../../../flutter/LICENSE
42836-
ORIGIN: ../../../flutter/impeller/entity/entity_pass.cc + ../../../flutter/LICENSE
42837-
ORIGIN: ../../../flutter/impeller/entity/entity_pass.h + ../../../flutter/LICENSE
4283842829
ORIGIN: ../../../flutter/impeller/entity/entity_pass_clip_stack.cc + ../../../flutter/LICENSE
4283942830
ORIGIN: ../../../flutter/impeller/entity/entity_pass_clip_stack.h + ../../../flutter/LICENSE
42840-
ORIGIN: ../../../flutter/impeller/entity/entity_pass_delegate.cc + ../../../flutter/LICENSE
42841-
ORIGIN: ../../../flutter/impeller/entity/entity_pass_delegate.h + ../../../flutter/LICENSE
4284242831
ORIGIN: ../../../flutter/impeller/entity/entity_pass_target.cc + ../../../flutter/LICENSE
4284342832
ORIGIN: ../../../flutter/impeller/entity/entity_pass_target.h + ../../../flutter/LICENSE
4284442833
ORIGIN: ../../../flutter/impeller/entity/entity_playground.cc + ../../../flutter/LICENSE
@@ -45499,21 +45488,14 @@ FILE: ../../../flutter/impeller/aiks/aiks_playground.cc
4549945488
FILE: ../../../flutter/impeller/aiks/aiks_playground.h
4550045489
FILE: ../../../flutter/impeller/aiks/canvas.cc
4550145490
FILE: ../../../flutter/impeller/aiks/canvas.h
45502-
FILE: ../../../flutter/impeller/aiks/canvas_benchmarks.cc
4550345491
FILE: ../../../flutter/impeller/aiks/color_filter.cc
4550445492
FILE: ../../../flutter/impeller/aiks/color_filter.h
4550545493
FILE: ../../../flutter/impeller/aiks/color_source.cc
4550645494
FILE: ../../../flutter/impeller/aiks/color_source.h
45507-
FILE: ../../../flutter/impeller/aiks/experimental_canvas.cc
45508-
FILE: ../../../flutter/impeller/aiks/experimental_canvas.h
4550945495
FILE: ../../../flutter/impeller/aiks/image_filter.cc
4551045496
FILE: ../../../flutter/impeller/aiks/image_filter.h
4551145497
FILE: ../../../flutter/impeller/aiks/paint.cc
4551245498
FILE: ../../../flutter/impeller/aiks/paint.h
45513-
FILE: ../../../flutter/impeller/aiks/paint_pass_delegate.cc
45514-
FILE: ../../../flutter/impeller/aiks/paint_pass_delegate.h
45515-
FILE: ../../../flutter/impeller/aiks/picture.cc
45516-
FILE: ../../../flutter/impeller/aiks/picture.h
4551745499
FILE: ../../../flutter/impeller/base/allocation.cc
4551845500
FILE: ../../../flutter/impeller/base/allocation.h
4551945501
FILE: ../../../flutter/impeller/base/allocation_size.cc
@@ -45708,12 +45690,8 @@ FILE: ../../../flutter/impeller/entity/draw_order_resolver.cc
4570845690
FILE: ../../../flutter/impeller/entity/draw_order_resolver.h
4570945691
FILE: ../../../flutter/impeller/entity/entity.cc
4571045692
FILE: ../../../flutter/impeller/entity/entity.h
45711-
FILE: ../../../flutter/impeller/entity/entity_pass.cc
45712-
FILE: ../../../flutter/impeller/entity/entity_pass.h
4571345693
FILE: ../../../flutter/impeller/entity/entity_pass_clip_stack.cc
4571445694
FILE: ../../../flutter/impeller/entity/entity_pass_clip_stack.h
45715-
FILE: ../../../flutter/impeller/entity/entity_pass_delegate.cc
45716-
FILE: ../../../flutter/impeller/entity/entity_pass_delegate.h
4571745695
FILE: ../../../flutter/impeller/entity/entity_pass_target.cc
4571845696
FILE: ../../../flutter/impeller/entity/entity_pass_target.h
4571945697
FILE: ../../../flutter/impeller/entity/entity_playground.cc

common/config.gni

-7
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ declare_args() {
3535
# See [go/slimpeller-dashboard](https://github.com/orgs/flutter/projects/21)
3636
# for details.
3737
slimpeller = false
38-
39-
# Opt into new DL dispatcher that skips AIKS layer
40-
experimental_canvas = true
4138
}
4239

4340
# feature_defines_list ---------------------------------------------------------
@@ -76,10 +73,6 @@ if (slimpeller) {
7673
feature_defines_list += [ "SLIMPELLER=1" ]
7774
}
7875

79-
if (experimental_canvas) {
80-
feature_defines_list += [ "EXPERIMENTAL_CANVAS=1" ]
81-
}
82-
8376
if (is_ios || is_mac) {
8477
flutter_cflags_objc = [
8578
"-Werror=overriding-method-mismatch",

display_list/testing/dl_test_surface_metal.cc

-24
Original file line numberDiff line numberDiff line change
@@ -87,42 +87,18 @@ sk_sp<DlPixelData> DlMetalSurfaceProvider::ImpellerSnapshot(
8787
const sk_sp<DisplayList>& list,
8888
int width,
8989
int height) const {
90-
#if EXPERIMENTAL_CANVAS
9190
auto texture = DisplayListToTexture(list, {width, height}, *aiks_context_);
9291
return sk_make_sp<DlMetalPixelData>(
9392
snapshotter_->MakeScreenshot(*aiks_context_, texture));
94-
#else
95-
InitScreenShotter();
96-
impeller::DlDispatcher dispatcher;
97-
dispatcher.drawColor(flutter::DlColor::kTransparent(),
98-
flutter::DlBlendMode::kSrc);
99-
list->Dispatch(dispatcher);
100-
auto picture = dispatcher.EndRecordingAsPicture();
101-
return sk_make_sp<DlMetalPixelData>(snapshotter_->MakeScreenshot(
102-
*aiks_context_, picture, {width, height}, false));
103-
104-
#endif // EXPERIMENTAL_CANVAS
10593
}
10694

10795
sk_sp<DlImage> DlMetalSurfaceProvider::MakeImpellerImage(
10896
const sk_sp<DisplayList>& list,
10997
int width,
11098
int height) const {
11199
InitScreenShotter();
112-
#if EXPERIMENTAL_CANVAS
113100
return impeller::DlImageImpeller::Make(
114101
DisplayListToTexture(list, {width, height}, *aiks_context_));
115-
#else
116-
impeller::DlDispatcher dispatcher;
117-
dispatcher.drawColor(flutter::DlColor::kTransparent(),
118-
flutter::DlBlendMode::kSrc);
119-
list->Dispatch(dispatcher);
120-
auto picture = dispatcher.EndRecordingAsPicture();
121-
std::shared_ptr<impeller::Texture> texture =
122-
picture.ToImage(*aiks_context_, {width, height});
123-
return impeller::DlImageImpeller::Make(texture);
124-
125-
#endif // EXPERIMENTAL_CANVAS
126102
}
127103

128104
void DlMetalSurfaceProvider::InitScreenShotter() const {

impeller/aiks/BUILD.gn

-32
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,10 @@ impeller_component("aiks") {
1414
"color_filter.h",
1515
"color_source.cc",
1616
"color_source.h",
17-
"experimental_canvas.cc",
18-
"experimental_canvas.h",
1917
"image_filter.cc",
2018
"image_filter.h",
2119
"paint.cc",
2220
"paint.h",
23-
"paint_pass_delegate.cc",
24-
"paint_pass_delegate.h",
25-
"picture.cc",
26-
"picture.h",
2721
]
2822

2923
public_deps = [
@@ -53,25 +47,9 @@ impeller_component("aiks_playground") {
5347
]
5448
}
5549

56-
impeller_component("context_spy") {
57-
testonly = true
58-
59-
sources = [
60-
"testing/context_mock.h",
61-
"testing/context_spy.cc",
62-
"testing/context_spy.h",
63-
]
64-
deps = [
65-
"//flutter/impeller/entity:entity_test_helpers",
66-
"//flutter/impeller/renderer",
67-
"//flutter/testing:testing_lib",
68-
]
69-
}
70-
7150
template("aiks_unittests_component") {
7251
target_name = invoker.target_name
7352
predefined_sources = [
74-
"aiks_gradient_unittests.cc",
7553
"aiks_unittests.cc",
7654
"aiks_unittests.h",
7755
]
@@ -92,7 +70,6 @@ template("aiks_unittests_component") {
9270
deps = [
9371
":aiks",
9472
":aiks_playground",
95-
":context_spy",
9673
"//flutter/impeller/geometry:geometry_asserts",
9774
"//flutter/impeller/golden_tests:golden_playground_test",
9875
"//flutter/impeller/playground:playground_test",
@@ -116,12 +93,3 @@ aiks_unittests_component("aiks_unittests_golden") {
11693
"IMPELLER_ENABLE_VALIDATION=1",
11794
]
11895
}
119-
120-
executable("canvas_benchmarks") {
121-
testonly = true
122-
sources = [ "canvas_benchmarks.cc" ]
123-
deps = [
124-
":aiks",
125-
"//flutter/benchmarking",
126-
]
127-
}

impeller/aiks/aiks_context.cc

-21
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
#include "impeller/aiks/aiks_context.h"
66

7-
#include "fml/closure.h"
8-
#include "impeller/aiks/picture.h"
97
#include "impeller/typographer/typographer_context.h"
108

119
namespace impeller {
@@ -45,23 +43,4 @@ ContentContext& AiksContext::GetContentContext() const {
4543
return *content_context_;
4644
}
4745

48-
bool AiksContext::Render(const Picture& picture,
49-
const RenderTarget& render_target,
50-
bool reset_host_buffer) {
51-
if (!IsValid()) {
52-
return false;
53-
}
54-
55-
fml::ScopedCleanupClosure closure([&]() {
56-
if (reset_host_buffer) {
57-
content_context_->GetTransientsBuffer().Reset();
58-
}
59-
});
60-
if (picture.pass) {
61-
return picture.pass->Render(*content_context_, render_target);
62-
}
63-
64-
return true;
65-
}
66-
6746
} // namespace impeller

impeller/aiks/aiks_context.h

-4
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ class AiksContext {
4242

4343
ContentContext& GetContentContext() const;
4444

45-
bool Render(const Picture& picture,
46-
const RenderTarget& render_target,
47-
bool reset_host_buffer);
48-
4945
private:
5046
std::shared_ptr<Context> context_;
5147
std::unique_ptr<ContentContext> content_context_;

impeller/aiks/aiks_gradient_unittests.cc

-45
This file was deleted.

0 commit comments

Comments
 (0)