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

Commit 2cb619d

Browse files
Revert "[Impeller] reduce advanced blend subpass count for single input with foreground color" (#40914)
Reverts #40886 This renders incorrectly when applied directly to contents instead of as a filter, essentially due to some transform mis handling. The code only works when the snapshot has an identity transform, which is only true as a subpass
1 parent 43a5c86 commit 2cb619d

File tree

6 files changed

+0
-246
lines changed

6 files changed

+0
-246
lines changed

ci/licenses_golden/licenses_flutter

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,8 +1200,6 @@ ORIGIN: ../../../flutter/impeller/entity/contents/filters/srgb_to_linear_filter_
12001200
ORIGIN: ../../../flutter/impeller/entity/contents/filters/srgb_to_linear_filter_contents.h + ../../../flutter/LICENSE
12011201
ORIGIN: ../../../flutter/impeller/entity/contents/filters/yuv_to_rgb_filter_contents.cc + ../../../flutter/LICENSE
12021202
ORIGIN: ../../../flutter/impeller/entity/contents/filters/yuv_to_rgb_filter_contents.h + ../../../flutter/LICENSE
1203-
ORIGIN: ../../../flutter/impeller/entity/contents/foreground_blend_contents.cc + ../../../flutter/LICENSE
1204-
ORIGIN: ../../../flutter/impeller/entity/contents/foreground_blend_contents.h + ../../../flutter/LICENSE
12051203
ORIGIN: ../../../flutter/impeller/entity/contents/framebuffer_blend_contents.cc + ../../../flutter/LICENSE
12061204
ORIGIN: ../../../flutter/impeller/entity/contents/framebuffer_blend_contents.h + ../../../flutter/LICENSE
12071205
ORIGIN: ../../../flutter/impeller/entity/contents/gradient_generator.cc + ../../../flutter/LICENSE
@@ -3784,8 +3782,6 @@ FILE: ../../../flutter/impeller/entity/contents/filters/srgb_to_linear_filter_co
37843782
FILE: ../../../flutter/impeller/entity/contents/filters/srgb_to_linear_filter_contents.h
37853783
FILE: ../../../flutter/impeller/entity/contents/filters/yuv_to_rgb_filter_contents.cc
37863784
FILE: ../../../flutter/impeller/entity/contents/filters/yuv_to_rgb_filter_contents.h
3787-
FILE: ../../../flutter/impeller/entity/contents/foreground_blend_contents.cc
3788-
FILE: ../../../flutter/impeller/entity/contents/foreground_blend_contents.h
37893785
FILE: ../../../flutter/impeller/entity/contents/framebuffer_blend_contents.cc
37903786
FILE: ../../../flutter/impeller/entity/contents/framebuffer_blend_contents.h
37913787
FILE: ../../../flutter/impeller/entity/contents/gradient_generator.cc

impeller/entity/BUILD.gn

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,6 @@ impeller_component("entity") {
180180
"contents/filters/srgb_to_linear_filter_contents.h",
181181
"contents/filters/yuv_to_rgb_filter_contents.cc",
182182
"contents/filters/yuv_to_rgb_filter_contents.h",
183-
"contents/foreground_blend_contents.cc",
184-
"contents/foreground_blend_contents.h",
185183
"contents/framebuffer_blend_contents.cc",
186184
"contents/framebuffer_blend_contents.h",
187185
"contents/gradient_generator.cc",

impeller/entity/contents/filters/blend_filter_contents.cc

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include "impeller/entity/contents/content_context.h"
1313
#include "impeller/entity/contents/contents.h"
1414
#include "impeller/entity/contents/filters/inputs/filter_input.h"
15-
#include "impeller/entity/contents/foreground_blend_contents.h"
1615
#include "impeller/entity/contents/solid_color_contents.h"
1716
#include "impeller/entity/entity.h"
1817
#include "impeller/geometry/path_builder.h"
@@ -374,20 +373,6 @@ std::optional<Entity> BlendFilterContents::RenderFilter(
374373
}
375374

376375
if (blend_mode_ <= Entity::kLastAdvancedBlendMode) {
377-
auto potential_alpha = GetAlpha().value_or(1.0);
378-
if (inputs.size() == 1 && foreground_color_.has_value() &&
379-
potential_alpha >= 1.0 - kEhCloseEnough) {
380-
auto contents = std::make_shared<AdvancedForegroundBlendContents>();
381-
contents->SetBlendMode(blend_mode_);
382-
contents->SetCoverage(coverage);
383-
contents->SetSrcInput(inputs[0]);
384-
contents->SetForegroundColor(foreground_color_.value());
385-
Entity entity;
386-
entity.SetTransformation(Matrix::MakeTranslation(coverage.origin));
387-
entity.SetContents(std::move(contents));
388-
return entity;
389-
}
390-
391376
return advanced_blend_proc_(inputs, renderer, entity, coverage,
392377
foreground_color_, GetAbsorbOpacity(),
393378
GetAlpha());

impeller/entity/contents/foreground_blend_contents.cc

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

impeller/entity/contents/foreground_blend_contents.h

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

impeller/entity/entity_unittests.cc

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2451,21 +2451,5 @@ TEST_P(EntityTest, InheritOpacityTest) {
24512451
ASSERT_FALSE(runtime_effect->CanInheritOpacity(entity));
24522452
}
24532453

2454-
TEST_P(EntityTest, ColorFilterWithForegroundColorAdvancedBlend) {
2455-
auto image = CreateTextureForFixture("boston.jpg");
2456-
auto filter = ColorFilterContents::MakeBlend(
2457-
BlendMode::kColorBurn, FilterInput::Make({image}), Color::Red());
2458-
2459-
auto callback = [&](ContentContext& context, RenderPass& pass) -> bool {
2460-
Entity entity;
2461-
entity.SetTransformation(Matrix::MakeScale(GetContentScale()) *
2462-
Matrix::MakeTranslation({500, 300}) *
2463-
Matrix::MakeScale(Vector2{0.5, 0.5}));
2464-
entity.SetContents(filter);
2465-
return entity.Render(context, pass);
2466-
};
2467-
ASSERT_TRUE(OpenPlaygroundHere(callback));
2468-
}
2469-
24702454
} // namespace testing
24712455
} // namespace impeller

0 commit comments

Comments
 (0)