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

Commit 6bf9f63

Browse files
Reverts "[Impeller] Reland: Implement draw order optimization. (#54215)" (#54261)
Reverts: #54215 Initiated by: bdero Reason for reverting: Causing golden diffs in framework roll https://flutter-gold.skia.org/search?issue=152633&crs=github&patchsets=2&corpus=flutter Original PR Author: bdero Reviewed By: {jonahwilliams} This change reverts the following previous change: Original PR: #54136 Revert PR: #54067 Includes fixes for issue seen in [these goldens](https://flutter-gold.skia.org/search?issue=152354&crs=github&patchsets=2&corpus=flutter). The problem was that the scissor was ending up wrong after clip replay for opaque draws that are supposed to occur outside the parent clip scope(s). To fix it, I made clip replay draws as well as the subpass texture draw apply lazily. For the clip replay, there's no need to apply a given clip until we come across an entity that has a depth less than or equal to the clip. And for the subpass texture (which is often translucent), we can defer drawing it until we come across another translucent draw. Deferring the subpass texture is important because if we draw it immediately, then all of the replay clips need to be drawn immediately too. ## Description For each clip scope, draw opaque items in reverse order and translucent/backdrop-independent items in their original order afterwards. Clips are treated as translucent by the parent scope. Respects clips, subpass collapse, and the clear color optimization. ### Local new_gallery before/after (iPhone 12 mini): ``` cd ~/projects/flutter/flutter/dev/integration_tests/new_gallery flutter drive --profile --local-engine-src-path ~/projects/flutter/engine/src --local-engine=ios_profile --local-engine-host=host_profile_arm64 --trace-startup -t test_driver/transitions_perf.dart -d 00008101-000A59A93C10001E ``` ![image](https://github.com/user-attachments/assets/7372c128-ca71-44a6-8e6c-b0043025f751)
1 parent 8130df2 commit 6bf9f63

15 files changed

+88
-629
lines changed

ci/licenses_golden/excluded_files

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@
164164
../../../flutter/impeller/entity/contents/host_buffer_unittests.cc
165165
../../../flutter/impeller/entity/contents/test
166166
../../../flutter/impeller/entity/contents/tiled_texture_contents_unittests.cc
167-
../../../flutter/impeller/entity/draw_order_resolver_unittests.cc
168167
../../../flutter/impeller/entity/entity_pass_target_unittests.cc
169168
../../../flutter/impeller/entity/entity_pass_unittests.cc
170169
../../../flutter/impeller/entity/entity_unittests.cc

ci/licenses_golden/licenses_flutter

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42128,8 +42128,6 @@ ORIGIN: ../../../flutter/impeller/entity/contents/tiled_texture_contents.cc + ..
4212842128
ORIGIN: ../../../flutter/impeller/entity/contents/tiled_texture_contents.h + ../../../flutter/LICENSE
4212942129
ORIGIN: ../../../flutter/impeller/entity/contents/vertices_contents.cc + ../../../flutter/LICENSE
4213042130
ORIGIN: ../../../flutter/impeller/entity/contents/vertices_contents.h + ../../../flutter/LICENSE
42131-
ORIGIN: ../../../flutter/impeller/entity/draw_order_resolver.cc + ../../../flutter/LICENSE
42132-
ORIGIN: ../../../flutter/impeller/entity/draw_order_resolver.h + ../../../flutter/LICENSE
4213342131
ORIGIN: ../../../flutter/impeller/entity/entity.cc + ../../../flutter/LICENSE
4213442132
ORIGIN: ../../../flutter/impeller/entity/entity.h + ../../../flutter/LICENSE
4213542133
ORIGIN: ../../../flutter/impeller/entity/entity_pass.cc + ../../../flutter/LICENSE
@@ -45011,8 +45009,6 @@ FILE: ../../../flutter/impeller/entity/contents/tiled_texture_contents.cc
4501145009
FILE: ../../../flutter/impeller/entity/contents/tiled_texture_contents.h
4501245010
FILE: ../../../flutter/impeller/entity/contents/vertices_contents.cc
4501345011
FILE: ../../../flutter/impeller/entity/contents/vertices_contents.h
45014-
FILE: ../../../flutter/impeller/entity/draw_order_resolver.cc
45015-
FILE: ../../../flutter/impeller/entity/draw_order_resolver.h
4501645012
FILE: ../../../flutter/impeller/entity/entity.cc
4501745013
FILE: ../../../flutter/impeller/entity/entity.h
4501845014
FILE: ../../../flutter/impeller/entity/entity_pass.cc

impeller/entity/BUILD.gn

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,6 @@ impeller_component("entity") {
166166
"contents/tiled_texture_contents.h",
167167
"contents/vertices_contents.cc",
168168
"contents/vertices_contents.h",
169-
"draw_order_resolver.cc",
170-
"draw_order_resolver.h",
171169
"entity.cc",
172170
"entity.h",
173171
"entity_pass.cc",
@@ -250,7 +248,6 @@ impeller_component("entity_unittests") {
250248
"contents/filters/matrix_filter_contents_unittests.cc",
251249
"contents/host_buffer_unittests.cc",
252250
"contents/tiled_texture_contents_unittests.cc",
253-
"draw_order_resolver_unittests.cc",
254251
"entity_pass_target_unittests.cc",
255252
"entity_pass_unittests.cc",
256253
"entity_playground.cc",

impeller/entity/contents/color_source_contents.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,6 @@ class ColorSourceContents : public Contents {
213213
pass.SetVertexBuffer(std::move(geometry_result.vertex_buffer));
214214
options.primitive_type = geometry_result.type;
215215

216-
// Enable depth writing for all opaque entities in order to allow
217-
// reordering. Opaque entities are coerced to source blending by
218-
// `EntityPass::AddEntity`.
219-
options.depth_write_enabled = options.blend_mode == BlendMode::kSource;
220-
221216
// Take the pre-populated vertex shader uniform struct and set managed
222217
// values.
223218
frame_info.mvp = geometry_result.transform;

impeller/entity/contents/filters/gaussian_blur_filter_contents.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -575,16 +575,16 @@ Entity ApplyBlurStyle(FilterContents::BlurStyle blur_style,
575575
const ContentContext& renderer, const Entity& entity,
576576
RenderPass& pass) mutable {
577577
bool result = true;
578+
blur_entity.SetClipDepth(entity.GetClipDepth());
579+
blur_entity.SetTransform(entity.GetTransform() *
580+
blurred_transform);
581+
result = result && blur_entity.Render(renderer, pass);
578582
snapshot_entity.SetTransform(
579583
entity.GetTransform() *
580584
Matrix::MakeScale(1.f / source_space_scalar) *
581585
snapshot_transform);
582586
snapshot_entity.SetClipDepth(entity.GetClipDepth());
583587
result = result && snapshot_entity.Render(renderer, pass);
584-
blur_entity.SetClipDepth(entity.GetClipDepth());
585-
blur_entity.SetTransform(entity.GetTransform() *
586-
blurred_transform);
587-
result = result && blur_entity.Render(renderer, pass);
588588
return result;
589589
}),
590590
fml::MakeCopyable([blur_entity = blur_entity.Clone(),

impeller/entity/contents/texture_contents.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,6 @@ bool TextureContents::Render(const ContentContext& renderer,
153153
}
154154
pipeline_options.primitive_type = PrimitiveType::kTriangleStrip;
155155

156-
pipeline_options.depth_write_enabled =
157-
stencil_enabled_ && pipeline_options.blend_mode == BlendMode::kSource;
158-
159156
pass.SetPipeline(strict_source_rect_enabled_
160157
? renderer.GetTextureStrictSrcPipeline(pipeline_options)
161158
: renderer.GetTexturePipeline(pipeline_options));

impeller/entity/draw_order_resolver.cc

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

impeller/entity/draw_order_resolver.h

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

0 commit comments

Comments
 (0)