[Impeller] Fix tests that aren't scaled right (flutter/engine#34748)

This commit is contained in:
Brandon DeRosier
2022-07-19 09:30:06 -07:00
committed by GitHub
parent d5a8db658b
commit f7d5d46d63
2 changed files with 8 additions and 5 deletions

View File

@@ -769,8 +769,8 @@ TEST_P(AiksTest, SolidStrokesRenderCorrectly) {
Point(60, 300), Point(600, 300), 20, Color::Red(), Color::Red());
auto screen_to_canvas = canvas.GetCurrentTransformation().Invert();
Point point_a = screen_to_canvas * handle_a;
Point point_b = screen_to_canvas * handle_b;
Point point_a = screen_to_canvas * handle_a * GetContentScale();
Point point_b = screen_to_canvas * handle_b * GetContentScale();
Point middle = (point_a + point_b) / 2;
auto radius = point_a.GetDistance(middle);
@@ -798,8 +798,10 @@ TEST_P(AiksTest, SolidStrokesRenderCorrectly) {
}
TEST_P(AiksTest, CoverageOriginShouldBeAccountedForInSubpasses) {
auto callback = [](AiksContext& renderer, RenderTarget& render_target) {
auto callback = [&](AiksContext& renderer, RenderTarget& render_target) {
Canvas canvas;
canvas.Scale(GetContentScale());
Paint alpha;
alpha.color = Color::Red().WithAlpha(0.5);

View File

@@ -1056,12 +1056,13 @@ TEST_P(EntityTest, BorderMaskBlurCoverageIsCorrect) {
}
TEST_P(EntityTest, DrawVerticesSolidColorTrianglesWithoutIndex) {
std::vector<Point> points = {Point(0, 0), Point(0, 1), Point(1, 0)};
std::vector<Point> points = {Point(100, 300), Point(200, 100),
Point(300, 300)};
std::vector<uint16_t> indexes;
std::vector<Color> colors = {Color::White(), Color::White(), Color::White()};
Vertices vertices = Vertices(points, indexes, colors, VertexMode::kTriangle,
Rect(0, 0, 4, 4));
Rect(100, 100, 300, 300));
std::shared_ptr<VerticesContents> contents =
std::make_shared<VerticesContents>(vertices);