[Impeller] Apply the entity transformation when rendering FramebufferBlendContents (flutter/engine#46106)
Fixes https://github.com/flutter/flutter/issues/134930
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user