[Impeller] Apply the entity transformation when rendering FramebufferBlendContents (flutter/engine#46106)

Fixes https://github.com/flutter/flutter/issues/134930
This commit is contained in:
Jason Simmons
2023-09-20 15:38:04 -07:00
committed by GitHub
parent 2681bee9ca
commit 32d185de0f
2 changed files with 19 additions and 1 deletions

View File

@@ -1577,6 +1577,23 @@ TEST_P(AiksTest, CanDrawPaintWithAdvancedBlend) {
ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture()));
}
TEST_P(AiksTest, DrawPaintWithAdvancedBlendOverFilter) {
Paint filtered = {
.color = Color::Black(),
.mask_blur_descriptor =
Paint::MaskBlurDescriptor{
.style = FilterContents::BlurStyle::kNormal,
.sigma = Sigma(60),
},
};
Canvas canvas;
canvas.DrawPaint({.color = Color::White()});
canvas.DrawCircle({300, 300}, 200, filtered);
canvas.DrawPaint({.color = Color::Green(), .blend_mode = BlendMode::kScreen});
ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture()));
}
#define BLEND_MODE_TUPLE(blend_mode) {#blend_mode, BlendMode::k##blend_mode},
struct BlendModeSelection {

View File

@@ -147,7 +147,8 @@ bool FramebufferBlendContents::Render(const ContentContext& renderer,
FS::BindTextureSamplerSrc(cmd, src_snapshot->texture, src_sampler);
frame_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) *
src_snapshot->transform;
entity.GetTransformation() *
Matrix::MakeTranslation(src_coverage.origin);
frame_info.src_y_coord_scale = src_snapshot->texture->GetYCoordScale();
VS::BindFrameInfo(cmd, host_buffer.EmplaceUniform(frame_info));