Skip to content

Commit

Permalink
[Impeller] remove entity pass and re-combine canvas implementations. (#…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
jonahwilliams committed Sep 26, 2024
1 parent 00861f5 commit bf09d34
Show file tree
Hide file tree
Showing 84 changed files with 1,288 additions and 5,420 deletions.
1 change: 0 additions & 1 deletion BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ group("flutter") {
"//flutter/display_list:display_list_region_benchmarks",
"//flutter/display_list:display_list_transform_benchmarks",
"//flutter/fml:fml_benchmarks",
"//flutter/impeller/aiks:canvas_benchmarks",
"//flutter/impeller/geometry:geometry_benchmarks",
"//flutter/lib/ui:ui_benchmarks",
"//flutter/shell/common:shell_benchmarks",
Expand Down
1 change: 0 additions & 1 deletion ci/builders/linux_host_engine.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@
"flutter/display_list:display_list_transform_benchmarks",
"flutter/fml:fml_benchmarks",
"flutter/impeller/geometry:geometry_benchmarks",
"flutter/impeller/aiks:canvas_benchmarks",
"flutter/lib/ui:ui_benchmarks",
"flutter/shell/common:shell_benchmarks",
"flutter/shell/testing",
Expand Down
1 change: 0 additions & 1 deletion ci/builders/standalone/linux_benchmarks.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"flutter/display_list:display_list_transform_benchmarks",
"flutter/fml:fml_benchmarks",
"flutter/impeller/geometry:geometry_benchmarks",
"flutter/impeller/aiks:canvas_benchmarks",
"flutter/lib/ui:ui_benchmarks",
"flutter/shell/common:shell_benchmarks",
"flutter/shell/testing",
Expand Down
2 changes: 0 additions & 2 deletions ci/licenses_golden/excluded_files
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,9 @@
../../../flutter/impeller/.clang-format
../../../flutter/impeller/.gitignore
../../../flutter/impeller/README.md
../../../flutter/impeller/aiks/aiks_gradient_unittests.cc
../../../flutter/impeller/aiks/aiks_unittests.cc
../../../flutter/impeller/aiks/aiks_unittests.h
../../../flutter/impeller/aiks/canvas_unittests.cc
../../../flutter/impeller/aiks/testing
../../../flutter/impeller/base/README.md
../../../flutter/impeller/base/allocation_size_unittests.cc
../../../flutter/impeller/base/base_unittests.cc
Expand Down
22 changes: 0 additions & 22 deletions ci/licenses_golden/licenses_flutter
Original file line number Diff line number Diff line change
Expand Up @@ -42624,21 +42624,14 @@ ORIGIN: ../../../flutter/impeller/aiks/aiks_playground.cc + ../../../flutter/LIC
ORIGIN: ../../../flutter/impeller/aiks/aiks_playground.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/aiks/canvas.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/aiks/canvas.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/aiks/canvas_benchmarks.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/aiks/color_filter.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/aiks/color_filter.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/aiks/color_source.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/aiks/color_source.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/aiks/experimental_canvas.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/aiks/experimental_canvas.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/aiks/image_filter.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/aiks/image_filter.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/aiks/paint.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/aiks/paint.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/aiks/paint_pass_delegate.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/aiks/paint_pass_delegate.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/aiks/picture.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/aiks/picture.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/base/allocation.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/base/allocation.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/base/allocation_size.cc + ../../../flutter/LICENSE
Expand Down Expand Up @@ -42833,12 +42826,8 @@ ORIGIN: ../../../flutter/impeller/entity/draw_order_resolver.cc + ../../../flutt
ORIGIN: ../../../flutter/impeller/entity/draw_order_resolver.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/entity/entity.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/entity/entity.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/entity/entity_pass.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/entity/entity_pass.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/entity/entity_pass_clip_stack.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/entity/entity_pass_clip_stack.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/entity/entity_pass_delegate.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/entity/entity_pass_delegate.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/entity/entity_pass_target.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/entity/entity_pass_target.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/entity/entity_playground.cc + ../../../flutter/LICENSE
Expand Down Expand Up @@ -45499,21 +45488,14 @@ FILE: ../../../flutter/impeller/aiks/aiks_playground.cc
FILE: ../../../flutter/impeller/aiks/aiks_playground.h
FILE: ../../../flutter/impeller/aiks/canvas.cc
FILE: ../../../flutter/impeller/aiks/canvas.h
FILE: ../../../flutter/impeller/aiks/canvas_benchmarks.cc
FILE: ../../../flutter/impeller/aiks/color_filter.cc
FILE: ../../../flutter/impeller/aiks/color_filter.h
FILE: ../../../flutter/impeller/aiks/color_source.cc
FILE: ../../../flutter/impeller/aiks/color_source.h
FILE: ../../../flutter/impeller/aiks/experimental_canvas.cc
FILE: ../../../flutter/impeller/aiks/experimental_canvas.h
FILE: ../../../flutter/impeller/aiks/image_filter.cc
FILE: ../../../flutter/impeller/aiks/image_filter.h
FILE: ../../../flutter/impeller/aiks/paint.cc
FILE: ../../../flutter/impeller/aiks/paint.h
FILE: ../../../flutter/impeller/aiks/paint_pass_delegate.cc
FILE: ../../../flutter/impeller/aiks/paint_pass_delegate.h
FILE: ../../../flutter/impeller/aiks/picture.cc
FILE: ../../../flutter/impeller/aiks/picture.h
FILE: ../../../flutter/impeller/base/allocation.cc
FILE: ../../../flutter/impeller/base/allocation.h
FILE: ../../../flutter/impeller/base/allocation_size.cc
Expand Down Expand Up @@ -45708,12 +45690,8 @@ FILE: ../../../flutter/impeller/entity/draw_order_resolver.cc
FILE: ../../../flutter/impeller/entity/draw_order_resolver.h
FILE: ../../../flutter/impeller/entity/entity.cc
FILE: ../../../flutter/impeller/entity/entity.h
FILE: ../../../flutter/impeller/entity/entity_pass.cc
FILE: ../../../flutter/impeller/entity/entity_pass.h
FILE: ../../../flutter/impeller/entity/entity_pass_clip_stack.cc
FILE: ../../../flutter/impeller/entity/entity_pass_clip_stack.h
FILE: ../../../flutter/impeller/entity/entity_pass_delegate.cc
FILE: ../../../flutter/impeller/entity/entity_pass_delegate.h
FILE: ../../../flutter/impeller/entity/entity_pass_target.cc
FILE: ../../../flutter/impeller/entity/entity_pass_target.h
FILE: ../../../flutter/impeller/entity/entity_playground.cc
Expand Down
7 changes: 0 additions & 7 deletions common/config.gni
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ declare_args() {
# See [go/slimpeller-dashboard](https://github.com/orgs/flutter/projects/21)
# for details.
slimpeller = false

# Opt into new DL dispatcher that skips AIKS layer
experimental_canvas = true
}

# feature_defines_list ---------------------------------------------------------
Expand Down Expand Up @@ -76,10 +73,6 @@ if (slimpeller) {
feature_defines_list += [ "SLIMPELLER=1" ]
}

if (experimental_canvas) {
feature_defines_list += [ "EXPERIMENTAL_CANVAS=1" ]
}

if (is_ios || is_mac) {
flutter_cflags_objc = [
"-Werror=overriding-method-mismatch",
Expand Down
24 changes: 0 additions & 24 deletions display_list/testing/dl_test_surface_metal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,42 +87,18 @@ sk_sp<DlPixelData> DlMetalSurfaceProvider::ImpellerSnapshot(
const sk_sp<DisplayList>& list,
int width,
int height) const {
#if EXPERIMENTAL_CANVAS
auto texture = DisplayListToTexture(list, {width, height}, *aiks_context_);
return sk_make_sp<DlMetalPixelData>(
snapshotter_->MakeScreenshot(*aiks_context_, texture));
#else
InitScreenShotter();
impeller::DlDispatcher dispatcher;
dispatcher.drawColor(flutter::DlColor::kTransparent(),
flutter::DlBlendMode::kSrc);
list->Dispatch(dispatcher);
auto picture = dispatcher.EndRecordingAsPicture();
return sk_make_sp<DlMetalPixelData>(snapshotter_->MakeScreenshot(
*aiks_context_, picture, {width, height}, false));

#endif // EXPERIMENTAL_CANVAS
}

sk_sp<DlImage> DlMetalSurfaceProvider::MakeImpellerImage(
const sk_sp<DisplayList>& list,
int width,
int height) const {
InitScreenShotter();
#if EXPERIMENTAL_CANVAS
return impeller::DlImageImpeller::Make(
DisplayListToTexture(list, {width, height}, *aiks_context_));
#else
impeller::DlDispatcher dispatcher;
dispatcher.drawColor(flutter::DlColor::kTransparent(),
flutter::DlBlendMode::kSrc);
list->Dispatch(dispatcher);
auto picture = dispatcher.EndRecordingAsPicture();
std::shared_ptr<impeller::Texture> texture =
picture.ToImage(*aiks_context_, {width, height});
return impeller::DlImageImpeller::Make(texture);

#endif // EXPERIMENTAL_CANVAS
}

void DlMetalSurfaceProvider::InitScreenShotter() const {
Expand Down
32 changes: 0 additions & 32 deletions impeller/aiks/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,10 @@ impeller_component("aiks") {
"color_filter.h",
"color_source.cc",
"color_source.h",
"experimental_canvas.cc",
"experimental_canvas.h",
"image_filter.cc",
"image_filter.h",
"paint.cc",
"paint.h",
"paint_pass_delegate.cc",
"paint_pass_delegate.h",
"picture.cc",
"picture.h",
]

public_deps = [
Expand Down Expand Up @@ -53,25 +47,9 @@ impeller_component("aiks_playground") {
]
}

impeller_component("context_spy") {
testonly = true

sources = [
"testing/context_mock.h",
"testing/context_spy.cc",
"testing/context_spy.h",
]
deps = [
"//flutter/impeller/entity:entity_test_helpers",
"//flutter/impeller/renderer",
"//flutter/testing:testing_lib",
]
}

template("aiks_unittests_component") {
target_name = invoker.target_name
predefined_sources = [
"aiks_gradient_unittests.cc",
"aiks_unittests.cc",
"aiks_unittests.h",
]
Expand All @@ -92,7 +70,6 @@ template("aiks_unittests_component") {
deps = [
":aiks",
":aiks_playground",
":context_spy",
"//flutter/impeller/geometry:geometry_asserts",
"//flutter/impeller/golden_tests:golden_playground_test",
"//flutter/impeller/playground:playground_test",
Expand All @@ -116,12 +93,3 @@ aiks_unittests_component("aiks_unittests_golden") {
"IMPELLER_ENABLE_VALIDATION=1",
]
}

executable("canvas_benchmarks") {
testonly = true
sources = [ "canvas_benchmarks.cc" ]
deps = [
":aiks",
"//flutter/benchmarking",
]
}
21 changes: 0 additions & 21 deletions impeller/aiks/aiks_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

#include "impeller/aiks/aiks_context.h"

#include "fml/closure.h"
#include "impeller/aiks/picture.h"
#include "impeller/typographer/typographer_context.h"

namespace impeller {
Expand Down Expand Up @@ -45,23 +43,4 @@ ContentContext& AiksContext::GetContentContext() const {
return *content_context_;
}

bool AiksContext::Render(const Picture& picture,
const RenderTarget& render_target,
bool reset_host_buffer) {
if (!IsValid()) {
return false;
}

fml::ScopedCleanupClosure closure([&]() {
if (reset_host_buffer) {
content_context_->GetTransientsBuffer().Reset();
}
});
if (picture.pass) {
return picture.pass->Render(*content_context_, render_target);
}

return true;
}

} // namespace impeller
4 changes: 0 additions & 4 deletions impeller/aiks/aiks_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ class AiksContext {

ContentContext& GetContentContext() const;

bool Render(const Picture& picture,
const RenderTarget& render_target,
bool reset_host_buffer);

private:
std::shared_ptr<Context> context_;
std::unique_ptr<ContentContext> content_context_;
Expand Down
45 changes: 0 additions & 45 deletions impeller/aiks/aiks_gradient_unittests.cc

This file was deleted.

Loading

0 comments on commit bf09d34

Please sign in to comment.