mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
[Impeller] Check coverage after screen clip (flutter/engine#41129)
[Impeller] Check coverage after screen clip
This commit is contained in:
parent
56821f80e7
commit
7eef190afb
@ -2099,5 +2099,25 @@ TEST_P(AiksTest, TranslucentSaveLayerWithColorMatrixImageFilterDrawsCorrectly) {
|
||||
ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture()));
|
||||
}
|
||||
|
||||
/// This is a regression check for https://github.com/flutter/engine/pull/41129
|
||||
/// The entire screen is green if successful. If failing, no frames will render,
|
||||
/// or the entire screen will be transparent black.
|
||||
TEST_P(AiksTest, CanRenderTinyOverlappingSubpasses) {
|
||||
Canvas canvas;
|
||||
canvas.DrawPaint({.color = Color::Red()});
|
||||
|
||||
// Draw two overlapping subpixel circles.
|
||||
canvas.SaveLayer({});
|
||||
canvas.DrawCircle({100, 100}, 0.1, {.color = Color::Yellow()});
|
||||
canvas.Restore();
|
||||
canvas.SaveLayer({});
|
||||
canvas.DrawCircle({100, 100}, 0.1, {.color = Color::Yellow()});
|
||||
canvas.Restore();
|
||||
|
||||
canvas.DrawPaint({.color = Color::Green()});
|
||||
|
||||
ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture()));
|
||||
}
|
||||
|
||||
} // namespace testing
|
||||
} // namespace impeller
|
||||
|
||||
@ -397,13 +397,18 @@ EntityPass::EntityResult EntityPass::GetEntityForElement(
|
||||
}
|
||||
}
|
||||
|
||||
if (!subpass_coverage.has_value() || subpass_coverage->size.IsEmpty()) {
|
||||
if (!subpass_coverage.has_value()) {
|
||||
// The subpass doesn't contain anything visible, so skip it.
|
||||
return EntityPass::EntityResult::Skip();
|
||||
}
|
||||
|
||||
subpass_coverage =
|
||||
subpass_coverage->Intersection(Rect::MakeSize(root_pass_size));
|
||||
if (!subpass_coverage.has_value() ||
|
||||
ISize(subpass_coverage->size).IsEmpty()) {
|
||||
// The subpass doesn't contain anything visible, so skip it.
|
||||
return EntityPass::EntityResult::Skip();
|
||||
}
|
||||
|
||||
auto subpass_target =
|
||||
CreateRenderTarget(renderer, //
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user