Fixed solid blur style math (flutter/engine#55194)
fixes https://github.com/flutter/flutter/issues/155075 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This commit is contained in:
@@ -291,6 +291,7 @@ static sk_sp<DisplayList> MaskBlurVariantTest(
|
||||
builder.Scale(test_context.GetContentScale().x,
|
||||
test_context.GetContentScale().y);
|
||||
builder.Scale(0.8f, 0.8f);
|
||||
builder.Translate(50.f, 50.f);
|
||||
|
||||
DlPaint draw_paint;
|
||||
draw_paint.setColor(
|
||||
|
||||
@@ -565,28 +565,26 @@ Entity ApplyBlurStyle(FilterContents::BlurStyle blur_style,
|
||||
Entity::FromSnapshot(input_snapshot, entity.GetBlendMode());
|
||||
Entity result;
|
||||
Matrix blurred_transform = blur_entity.GetTransform();
|
||||
Matrix snapshot_transform =
|
||||
entity.GetTransform() * snapshot_entity.GetTransform();
|
||||
Matrix snapshot_transform = entity.GetTransform() * //
|
||||
Matrix::MakeScale(1.f / source_space_scalar) *
|
||||
input_snapshot.transform;
|
||||
result.SetContents(Contents::MakeAnonymous(
|
||||
fml::MakeCopyable(
|
||||
[blur_entity = blur_entity.Clone(), blurred_transform,
|
||||
source_space_scalar, snapshot_transform,
|
||||
snapshot_entity = std::move(snapshot_entity)](
|
||||
const ContentContext& renderer, const Entity& entity,
|
||||
RenderPass& pass) mutable {
|
||||
bool result = true;
|
||||
snapshot_entity.SetTransform(
|
||||
entity.GetTransform() *
|
||||
Matrix::MakeScale(1.f / source_space_scalar) *
|
||||
snapshot_transform);
|
||||
snapshot_entity.SetClipDepth(entity.GetClipDepth());
|
||||
result = result && snapshot_entity.Render(renderer, pass);
|
||||
blur_entity.SetClipDepth(entity.GetClipDepth());
|
||||
blur_entity.SetTransform(entity.GetTransform() *
|
||||
blurred_transform);
|
||||
result = result && blur_entity.Render(renderer, pass);
|
||||
return result;
|
||||
}),
|
||||
fml::MakeCopyable([blur_entity = blur_entity.Clone(),
|
||||
blurred_transform, snapshot_transform,
|
||||
snapshot_entity = std::move(snapshot_entity)](
|
||||
const ContentContext& renderer,
|
||||
const Entity& entity,
|
||||
RenderPass& pass) mutable {
|
||||
bool result = true;
|
||||
snapshot_entity.SetTransform(entity.GetTransform() *
|
||||
snapshot_transform);
|
||||
snapshot_entity.SetClipDepth(entity.GetClipDepth());
|
||||
result = result && snapshot_entity.Render(renderer, pass);
|
||||
blur_entity.SetClipDepth(entity.GetClipDepth());
|
||||
blur_entity.SetTransform(entity.GetTransform() * blurred_transform);
|
||||
result = result && blur_entity.Render(renderer, pass);
|
||||
return result;
|
||||
}),
|
||||
fml::MakeCopyable([blur_entity = blur_entity.Clone(),
|
||||
blurred_transform](const Entity& entity) mutable {
|
||||
blur_entity.SetTransform(entity.GetTransform() * blurred_transform);
|
||||
|
||||
Reference in New Issue
Block a user