Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Impeller] remove entity pass and re-combine canvas implementations. #55019

Merged
merged 26 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
282c1d9
[WIP] remove entity pass.
jonahwilliams Sep 7, 2024
68ed7f1
update external_view_embedder.
jonahwilliams Sep 7, 2024
5429b2a
++
jonahwilliams Sep 7, 2024
7888704
Merge branch 'main' of github.com:flutter/engine into remove_entity_pass
jonahwilliams Sep 7, 2024
391a90c
remove canvas benchmarks.
jonahwilliams Sep 7, 2024
a3fdd5e
remove entity/paint pass delgate.
jonahwilliams Sep 7, 2024
e8bf95a
Update gpu_surface_metal_impeller.mm
jonahwilliams Sep 7, 2024
ffa5f70
remove unused entity methods.
jonahwilliams Sep 7, 2024
ef83cf9
Merge branch 'remove_entity_pass' of github.com:jonahwilliams/engine …
jonahwilliams Sep 7, 2024
6d7c3c1
++
jonahwilliams Sep 7, 2024
e0d53f8
Merge branch 'main' of github.com:flutter/engine into remove_entity_pass
jonahwilliams Sep 10, 2024
5d1c0a6
Merge branch 'main' of github.com:flutter/engine into remove_entity_pass
jonahwilliams Sep 13, 2024
629fe13
add cull checking.
jonahwilliams Sep 13, 2024
01332ec
Merge branch 'main' into remove_entity_pass
jonahwilliams Sep 14, 2024
000741d
remove should render.
jonahwilliams Sep 14, 2024
a3348f0
combine experimental canvas.
jonahwilliams Sep 14, 2024
ed993b2
Merge branch 'remove_entity_pass' of github.com:jonahwilliams/engine …
jonahwilliams Sep 14, 2024
a5d7bf0
correct local culling bounds.
jonahwilliams Sep 14, 2024
44b1c55
update ignored files.
jonahwilliams Sep 14, 2024
cdaf24d
fix conical gradient test.
jonahwilliams Sep 14, 2024
8998c06
Update golden_tests.cc
jonahwilliams Sep 14, 2024
4d7397e
Merge branch 'main' of github.com:flutter/engine into remove_entity_pass
jonahwilliams Sep 25, 2024
cfaf0e5
Merge branch 'remove_entity_pass' of github.com:jonahwilliams/engine …
jonahwilliams Sep 25, 2024
f27fcca
Merge branch 'remove_entity_pass' of github.com:jonahwilliams/engine …
jonahwilliams Sep 25, 2024
6368c13
Merge branch 'remove_entity_pass' of github.com:jonahwilliams/engine …
jonahwilliams Sep 25, 2024
31ee47d
Merge branch 'main' into remove_entity_pass
jonahwilliams Sep 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

}

# 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