From 3a2315895ea962578541675fc267091a8618900b Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Tue, 9 Jun 2020 16:55:13 -0400 Subject: [PATCH] SkMatrix::MakeFoo is deprecated, use SkMatrix::Foo instead (flutter/engine#18934) --- .../layers/backdrop_filter_layer_unittests.cc | 8 +++--- .../flow/layers/clip_path_layer_unittests.cc | 8 +++--- .../flow/layers/clip_rect_layer_unittests.cc | 8 +++--- .../flow/layers/clip_rrect_layer_unittests.cc | 8 +++--- .../layers/color_filter_layer_unittests.cc | 8 +++--- .../flow/layers/container_layer_unittests.cc | 8 +++--- .../layers/image_filter_layer_unittests.cc | 12 ++++----- .../flow/layers/layer_tree_unittests.cc | 2 +- .../src/flutter/flow/layers/opacity_layer.cc | 2 +- .../flow/layers/opacity_layer_unittests.cc | 26 +++++++++---------- .../flow/layers/picture_layer_unittests.cc | 2 +- .../layers/shader_mask_layer_unittests.cc | 18 ++++++------- .../flow/layers/transform_layer_unittests.cc | 16 ++++++------ .../flutter/flow/mutators_stack_unittests.cc | 4 +-- .../src/flutter/flow/scene_update_context.h | 2 +- .../flow/testing/mock_layer_unittests.cc | 4 +-- .../lib/ui/compositing/scene_builder.cc | 2 +- .../embedder/tests/embedder_unittests.cc | 6 ++--- .../platform/fuchsia/flutter/vulkan_surface.h | 2 +- 19 files changed, 73 insertions(+), 73 deletions(-) diff --git a/engine/src/flutter/flow/layers/backdrop_filter_layer_unittests.cc b/engine/src/flutter/flow/layers/backdrop_filter_layer_unittests.cc index 50afecbdc7..47f7b66e35 100644 --- a/engine/src/flutter/flow/layers/backdrop_filter_layer_unittests.cc +++ b/engine/src/flutter/flow/layers/backdrop_filter_layer_unittests.cc @@ -43,7 +43,7 @@ TEST_F(BackdropFilterLayerTest, PaintBeforePrerollDies) { #endif TEST_F(BackdropFilterLayerTest, EmptyFilter) { - const SkMatrix initial_transform = SkMatrix::MakeTrans(0.5f, 1.0f); + const SkMatrix initial_transform = SkMatrix::Translate(0.5f, 1.0f); const SkRect child_bounds = SkRect::MakeLTRB(5.0f, 6.0f, 20.5f, 21.5f); const SkPath child_path = SkPath().addRect(child_bounds); const SkPaint child_paint = SkPaint(SkColors::kYellow); @@ -68,7 +68,7 @@ TEST_F(BackdropFilterLayerTest, EmptyFilter) { } TEST_F(BackdropFilterLayerTest, SimpleFilter) { - const SkMatrix initial_transform = SkMatrix::MakeTrans(0.5f, 1.0f); + const SkMatrix initial_transform = SkMatrix::Translate(0.5f, 1.0f); const SkRect child_bounds = SkRect::MakeLTRB(5.0f, 6.0f, 20.5f, 21.5f); const SkPath child_path = SkPath().addRect(child_bounds); const SkPaint child_paint = SkPaint(SkColors::kYellow); @@ -94,7 +94,7 @@ TEST_F(BackdropFilterLayerTest, SimpleFilter) { } TEST_F(BackdropFilterLayerTest, MultipleChildren) { - const SkMatrix initial_transform = SkMatrix::MakeTrans(0.5f, 1.0f); + const SkMatrix initial_transform = SkMatrix::Translate(0.5f, 1.0f); const SkRect child_bounds = SkRect::MakeLTRB(5.0f, 6.0f, 2.5f, 3.5f); const SkPath child_path1 = SkPath().addRect(child_bounds); const SkPath child_path2 = @@ -134,7 +134,7 @@ TEST_F(BackdropFilterLayerTest, MultipleChildren) { } TEST_F(BackdropFilterLayerTest, Nested) { - const SkMatrix initial_transform = SkMatrix::MakeTrans(0.5f, 1.0f); + const SkMatrix initial_transform = SkMatrix::Translate(0.5f, 1.0f); const SkRect child_bounds = SkRect::MakeLTRB(5.0f, 6.0f, 2.5f, 3.5f); const SkPath child_path1 = SkPath().addRect(child_bounds); const SkPath child_path2 = diff --git a/engine/src/flutter/flow/layers/clip_path_layer_unittests.cc b/engine/src/flutter/flow/layers/clip_path_layer_unittests.cc index 8c327332ba..6491fe5b40 100644 --- a/engine/src/flutter/flow/layers/clip_path_layer_unittests.cc +++ b/engine/src/flutter/flow/layers/clip_path_layer_unittests.cc @@ -46,7 +46,7 @@ TEST_F(ClipPathLayerTest, PaintBeforePrerollDies) { } TEST_F(ClipPathLayerTest, PaintingCulledLayerDies) { - const SkMatrix initial_matrix = SkMatrix::MakeTrans(0.5f, 1.0f); + const SkMatrix initial_matrix = SkMatrix::Translate(0.5f, 1.0f); const SkRect child_bounds = SkRect::MakeXYWH(1.0, 2.0, 2.0, 2.0); const SkRect layer_bounds = SkRect::MakeXYWH(0.5, 1.0, 5.0, 6.0); const SkPath child_path = SkPath().addRect(child_bounds); @@ -74,7 +74,7 @@ TEST_F(ClipPathLayerTest, PaintingCulledLayerDies) { #endif TEST_F(ClipPathLayerTest, ChildOutsideBounds) { - const SkMatrix initial_matrix = SkMatrix::MakeTrans(0.5f, 1.0f); + const SkMatrix initial_matrix = SkMatrix::Translate(0.5f, 1.0f); const SkRect cull_bounds = SkRect::MakeXYWH(0.0, 0.0, 2.0, 4.0); const SkRect child_bounds = SkRect::MakeXYWH(2.5, 5.0, 4.5, 4.0); const SkRect layer_bounds = SkRect::MakeXYWH(0.5, 1.0, 5.0, 6.0); @@ -116,7 +116,7 @@ TEST_F(ClipPathLayerTest, ChildOutsideBounds) { } TEST_F(ClipPathLayerTest, FullyContainedChild) { - const SkMatrix initial_matrix = SkMatrix::MakeTrans(0.5f, 1.0f); + const SkMatrix initial_matrix = SkMatrix::Translate(0.5f, 1.0f); const SkRect child_bounds = SkRect::MakeXYWH(1.0, 2.0, 2.0, 2.0); const SkRect layer_bounds = SkRect::MakeXYWH(0.5, 1.0, 5.0, 6.0); const SkPath child_path = SkPath().addRect(child_bounds); @@ -151,7 +151,7 @@ TEST_F(ClipPathLayerTest, FullyContainedChild) { } TEST_F(ClipPathLayerTest, PartiallyContainedChild) { - const SkMatrix initial_matrix = SkMatrix::MakeTrans(0.5f, 1.0f); + const SkMatrix initial_matrix = SkMatrix::Translate(0.5f, 1.0f); const SkRect cull_bounds = SkRect::MakeXYWH(0.0, 0.0, 4.0, 5.5); const SkRect child_bounds = SkRect::MakeXYWH(2.5, 5.0, 4.5, 4.0); const SkRect layer_bounds = SkRect::MakeXYWH(0.5, 1.0, 5.0, 6.0); diff --git a/engine/src/flutter/flow/layers/clip_rect_layer_unittests.cc b/engine/src/flutter/flow/layers/clip_rect_layer_unittests.cc index b63ca0c3e9..70decfa154 100644 --- a/engine/src/flutter/flow/layers/clip_rect_layer_unittests.cc +++ b/engine/src/flutter/flow/layers/clip_rect_layer_unittests.cc @@ -45,7 +45,7 @@ TEST_F(ClipRectLayerTest, PaintBeforePrerollDies) { } TEST_F(ClipRectLayerTest, PaintingCulledLayerDies) { - const SkMatrix initial_matrix = SkMatrix::MakeTrans(0.5f, 1.0f); + const SkMatrix initial_matrix = SkMatrix::Translate(0.5f, 1.0f); const SkRect child_bounds = SkRect::MakeXYWH(1.0, 2.0, 2.0, 2.0); const SkRect layer_bounds = SkRect::MakeXYWH(0.5, 1.0, 5.0, 6.0); const SkPath child_path = SkPath().addRect(child_bounds); @@ -72,7 +72,7 @@ TEST_F(ClipRectLayerTest, PaintingCulledLayerDies) { #endif TEST_F(ClipRectLayerTest, ChildOutsideBounds) { - const SkMatrix initial_matrix = SkMatrix::MakeTrans(0.5f, 1.0f); + const SkMatrix initial_matrix = SkMatrix::Translate(0.5f, 1.0f); const SkRect cull_bounds = SkRect::MakeXYWH(0.0, 0.0, 2.0, 4.0); const SkRect child_bounds = SkRect::MakeXYWH(2.5, 5.0, 4.5, 4.0); const SkRect layer_bounds = SkRect::MakeXYWH(0.5, 1.0, 5.0, 6.0); @@ -114,7 +114,7 @@ TEST_F(ClipRectLayerTest, ChildOutsideBounds) { } TEST_F(ClipRectLayerTest, FullyContainedChild) { - const SkMatrix initial_matrix = SkMatrix::MakeTrans(0.5f, 1.0f); + const SkMatrix initial_matrix = SkMatrix::Translate(0.5f, 1.0f); const SkRect child_bounds = SkRect::MakeXYWH(1.0, 2.0, 2.0, 2.0); const SkRect layer_bounds = SkRect::MakeXYWH(0.5, 1.0, 5.0, 6.0); const SkPath child_path = SkPath().addRect(child_bounds); @@ -149,7 +149,7 @@ TEST_F(ClipRectLayerTest, FullyContainedChild) { } TEST_F(ClipRectLayerTest, PartiallyContainedChild) { - const SkMatrix initial_matrix = SkMatrix::MakeTrans(0.5f, 1.0f); + const SkMatrix initial_matrix = SkMatrix::Translate(0.5f, 1.0f); const SkRect cull_bounds = SkRect::MakeXYWH(0.0, 0.0, 4.0, 5.5); const SkRect child_bounds = SkRect::MakeXYWH(2.5, 5.0, 4.5, 4.0); const SkRect layer_bounds = SkRect::MakeXYWH(0.5, 1.0, 5.0, 6.0); diff --git a/engine/src/flutter/flow/layers/clip_rrect_layer_unittests.cc b/engine/src/flutter/flow/layers/clip_rrect_layer_unittests.cc index 57db2140ca..39d40b7222 100644 --- a/engine/src/flutter/flow/layers/clip_rrect_layer_unittests.cc +++ b/engine/src/flutter/flow/layers/clip_rrect_layer_unittests.cc @@ -48,7 +48,7 @@ TEST_F(ClipRRectLayerTest, PaintBeforePreollDies) { } TEST_F(ClipRRectLayerTest, PaintingCulledLayerDies) { - const SkMatrix initial_matrix = SkMatrix::MakeTrans(0.5f, 1.0f); + const SkMatrix initial_matrix = SkMatrix::Translate(0.5f, 1.0f); const SkRect child_bounds = SkRect::MakeXYWH(1.0, 2.0, 2.0, 2.0); const SkRect layer_bounds = SkRect::MakeXYWH(0.5, 1.0, 5.0, 6.0); const SkPath child_path = SkPath().addRect(child_bounds); @@ -77,7 +77,7 @@ TEST_F(ClipRRectLayerTest, PaintingCulledLayerDies) { #endif TEST_F(ClipRRectLayerTest, ChildOutsideBounds) { - const SkMatrix initial_matrix = SkMatrix::MakeTrans(0.5f, 1.0f); + const SkMatrix initial_matrix = SkMatrix::Translate(0.5f, 1.0f); const SkRect cull_bounds = SkRect::MakeXYWH(0.0, 0.0, 2.0, 4.0); const SkRect child_bounds = SkRect::MakeXYWH(2.5, 5.0, 4.5, 4.0); const SkRect layer_bounds = SkRect::MakeXYWH(0.5, 1.0, 5.0, 6.0); @@ -119,7 +119,7 @@ TEST_F(ClipRRectLayerTest, ChildOutsideBounds) { } TEST_F(ClipRRectLayerTest, FullyContainedChild) { - const SkMatrix initial_matrix = SkMatrix::MakeTrans(0.5f, 1.0f); + const SkMatrix initial_matrix = SkMatrix::Translate(0.5f, 1.0f); const SkRect child_bounds = SkRect::MakeXYWH(1.0, 2.0, 2.0, 2.0); const SkRect layer_bounds = SkRect::MakeXYWH(0.5, 1.0, 5.0, 6.0); const SkPath child_path = SkPath().addRect(child_bounds); @@ -154,7 +154,7 @@ TEST_F(ClipRRectLayerTest, FullyContainedChild) { } TEST_F(ClipRRectLayerTest, PartiallyContainedChild) { - const SkMatrix initial_matrix = SkMatrix::MakeTrans(0.5f, 1.0f); + const SkMatrix initial_matrix = SkMatrix::Translate(0.5f, 1.0f); const SkRect cull_bounds = SkRect::MakeXYWH(0.0, 0.0, 4.0, 5.5); const SkRect child_bounds = SkRect::MakeXYWH(2.5, 5.0, 4.5, 4.0); const SkRect layer_bounds = SkRect::MakeXYWH(0.5, 1.0, 5.0, 6.0); diff --git a/engine/src/flutter/flow/layers/color_filter_layer_unittests.cc b/engine/src/flutter/flow/layers/color_filter_layer_unittests.cc index af1e5788b6..5c16f8c0cb 100644 --- a/engine/src/flutter/flow/layers/color_filter_layer_unittests.cc +++ b/engine/src/flutter/flow/layers/color_filter_layer_unittests.cc @@ -43,7 +43,7 @@ TEST_F(ColorFilterLayerTest, PaintBeforePrerollDies) { #endif TEST_F(ColorFilterLayerTest, EmptyFilter) { - const SkMatrix initial_transform = SkMatrix::MakeTrans(0.5f, 1.0f); + const SkMatrix initial_transform = SkMatrix::Translate(0.5f, 1.0f); const SkRect child_bounds = SkRect::MakeLTRB(5.0f, 6.0f, 20.5f, 21.5f); const SkPath child_path = SkPath().addRect(child_bounds); const SkPaint child_paint = SkPaint(SkColors::kYellow); @@ -70,7 +70,7 @@ TEST_F(ColorFilterLayerTest, EmptyFilter) { } TEST_F(ColorFilterLayerTest, SimpleFilter) { - const SkMatrix initial_transform = SkMatrix::MakeTrans(0.5f, 1.0f); + const SkMatrix initial_transform = SkMatrix::Translate(0.5f, 1.0f); const SkRect child_bounds = SkRect::MakeLTRB(5.0f, 6.0f, 20.5f, 21.5f); const SkPath child_path = SkPath().addRect(child_bounds); const SkPaint child_paint = SkPaint(SkColors::kYellow); @@ -99,7 +99,7 @@ TEST_F(ColorFilterLayerTest, SimpleFilter) { } TEST_F(ColorFilterLayerTest, MultipleChildren) { - const SkMatrix initial_transform = SkMatrix::MakeTrans(0.5f, 1.0f); + const SkMatrix initial_transform = SkMatrix::Translate(0.5f, 1.0f); const SkRect child_bounds = SkRect::MakeLTRB(5.0f, 6.0f, 2.5f, 3.5f); const SkPath child_path1 = SkPath().addRect(child_bounds); const SkPath child_path2 = @@ -142,7 +142,7 @@ TEST_F(ColorFilterLayerTest, MultipleChildren) { } TEST_F(ColorFilterLayerTest, Nested) { - const SkMatrix initial_transform = SkMatrix::MakeTrans(0.5f, 1.0f); + const SkMatrix initial_transform = SkMatrix::Translate(0.5f, 1.0f); const SkRect child_bounds = SkRect::MakeLTRB(5.0f, 6.0f, 2.5f, 3.5f); const SkPath child_path1 = SkPath().addRect(child_bounds); const SkPath child_path2 = diff --git a/engine/src/flutter/flow/layers/container_layer_unittests.cc b/engine/src/flutter/flow/layers/container_layer_unittests.cc index c5230fe7e7..1c11e7c02b 100644 --- a/engine/src/flutter/flow/layers/container_layer_unittests.cc +++ b/engine/src/flutter/flow/layers/container_layer_unittests.cc @@ -52,7 +52,7 @@ TEST_F(ContainerLayerTest, Simple) { SkPath child_path; child_path.addRect(5.0f, 6.0f, 20.5f, 21.5f); SkPaint child_paint(SkColors::kGreen); - SkMatrix initial_transform = SkMatrix::MakeTrans(-0.5f, -0.5f); + SkMatrix initial_transform = SkMatrix::Translate(-0.5f, -0.5f); auto mock_layer = std::make_shared(child_path, child_paint); auto layer = std::make_shared(); @@ -82,7 +82,7 @@ TEST_F(ContainerLayerTest, Multiple) { child_path2.addRect(8.0f, 2.0f, 16.5f, 14.5f); SkPaint child_paint1(SkColors::kGray); SkPaint child_paint2(SkColors::kGreen); - SkMatrix initial_transform = SkMatrix::MakeTrans(-0.5f, -0.5f); + SkMatrix initial_transform = SkMatrix::Translate(-0.5f, -0.5f); auto mock_layer1 = std::make_shared( child_path1, child_paint1, true /* fake_has_platform_view */); @@ -124,7 +124,7 @@ TEST_F(ContainerLayerTest, MultipleWithEmpty) { child_path1.addRect(5.0f, 6.0f, 20.5f, 21.5f); SkPaint child_paint1(SkColors::kGray); SkPaint child_paint2(SkColors::kGreen); - SkMatrix initial_transform = SkMatrix::MakeTrans(-0.5f, -0.5f); + SkMatrix initial_transform = SkMatrix::Translate(-0.5f, -0.5f); auto mock_layer1 = std::make_shared(child_path1, child_paint1); auto mock_layer2 = std::make_shared(SkPath(), child_paint2); @@ -161,7 +161,7 @@ TEST_F(ContainerLayerTest, NeedsSystemComposite) { child_path2.addRect(8.0f, 2.0f, 16.5f, 14.5f); SkPaint child_paint1(SkColors::kGray); SkPaint child_paint2(SkColors::kGreen); - SkMatrix initial_transform = SkMatrix::MakeTrans(-0.5f, -0.5f); + SkMatrix initial_transform = SkMatrix::Translate(-0.5f, -0.5f); auto mock_layer1 = std::make_shared( child_path1, child_paint1, false /* fake_has_platform_view */, diff --git a/engine/src/flutter/flow/layers/image_filter_layer_unittests.cc b/engine/src/flutter/flow/layers/image_filter_layer_unittests.cc index 305ec01611..3583d1540d 100644 --- a/engine/src/flutter/flow/layers/image_filter_layer_unittests.cc +++ b/engine/src/flutter/flow/layers/image_filter_layer_unittests.cc @@ -42,7 +42,7 @@ TEST_F(ImageFilterLayerTest, PaintBeforePrerollDies) { #endif TEST_F(ImageFilterLayerTest, EmptyFilter) { - const SkMatrix initial_transform = SkMatrix::MakeTrans(0.5f, 1.0f); + const SkMatrix initial_transform = SkMatrix::Translate(0.5f, 1.0f); const SkRect child_bounds = SkRect::MakeLTRB(5.0f, 6.0f, 20.5f, 21.5f); const SkPath child_path = SkPath().addRect(child_bounds); const SkPaint child_paint = SkPaint(SkColors::kYellow); @@ -70,7 +70,7 @@ TEST_F(ImageFilterLayerTest, EmptyFilter) { } TEST_F(ImageFilterLayerTest, SimpleFilter) { - const SkMatrix initial_transform = SkMatrix::MakeTrans(0.5f, 1.0f); + const SkMatrix initial_transform = SkMatrix::Translate(0.5f, 1.0f); const SkRect child_bounds = SkRect::MakeLTRB(5.0f, 6.0f, 20.5f, 21.5f); const SkPath child_path = SkPath().addRect(child_bounds); const SkPaint child_paint = SkPaint(SkColors::kYellow); @@ -103,11 +103,11 @@ TEST_F(ImageFilterLayerTest, SimpleFilter) { } TEST_F(ImageFilterLayerTest, SimpleFilterBounds) { - const SkMatrix initial_transform = SkMatrix::MakeTrans(0.5f, 1.0f); + const SkMatrix initial_transform = SkMatrix::Translate(0.5f, 1.0f); const SkRect child_bounds = SkRect::MakeLTRB(5.0f, 6.0f, 20.5f, 21.5f); const SkPath child_path = SkPath().addRect(child_bounds); const SkPaint child_paint = SkPaint(SkColors::kYellow); - const SkMatrix filter_transform = SkMatrix::MakeScale(2.0, 2.0); + const SkMatrix filter_transform = SkMatrix::Scale(2.0, 2.0); auto layer_filter = SkImageFilter::MakeMatrixFilter( filter_transform, SkFilterQuality::kMedium_SkFilterQuality, nullptr); auto mock_layer = std::make_shared(child_path, child_paint); @@ -136,7 +136,7 @@ TEST_F(ImageFilterLayerTest, SimpleFilterBounds) { } TEST_F(ImageFilterLayerTest, MultipleChildren) { - const SkMatrix initial_transform = SkMatrix::MakeTrans(0.5f, 1.0f); + const SkMatrix initial_transform = SkMatrix::Translate(0.5f, 1.0f); const SkRect child_bounds = SkRect::MakeLTRB(5.0f, 6.0f, 2.5f, 3.5f); const SkPath child_path1 = SkPath().addRect(child_bounds); const SkPath child_path2 = @@ -181,7 +181,7 @@ TEST_F(ImageFilterLayerTest, MultipleChildren) { } TEST_F(ImageFilterLayerTest, Nested) { - const SkMatrix initial_transform = SkMatrix::MakeTrans(0.5f, 1.0f); + const SkMatrix initial_transform = SkMatrix::Translate(0.5f, 1.0f); const SkRect child_bounds = SkRect::MakeLTRB(5.0f, 6.0f, 2.5f, 3.5f); const SkPath child_path1 = SkPath().addRect(child_bounds); const SkPath child_path2 = diff --git a/engine/src/flutter/flow/layers/layer_tree_unittests.cc b/engine/src/flutter/flow/layers/layer_tree_unittests.cc index 9851cebf26..1215b72f78 100644 --- a/engine/src/flutter/flow/layers/layer_tree_unittests.cc +++ b/engine/src/flutter/flow/layers/layer_tree_unittests.cc @@ -20,7 +20,7 @@ class LayerTreeTest : public CanvasTest { LayerTreeTest() : layer_tree_(SkISize::Make(64, 64), 100.0f, 1.0f), compositor_context_(fml::kDefaultFrameBudget), - root_transform_(SkMatrix::MakeTrans(1.0f, 1.0f)), + root_transform_(SkMatrix::Translate(1.0f, 1.0f)), scoped_frame_(compositor_context_.AcquireFrame(nullptr, &mock_canvas(), nullptr, diff --git a/engine/src/flutter/flow/layers/opacity_layer.cc b/engine/src/flutter/flow/layers/opacity_layer.cc index 9fd0bcc09b..0d9ade296d 100644 --- a/engine/src/flutter/flow/layers/opacity_layer.cc +++ b/engine/src/flutter/flow/layers/opacity_layer.cc @@ -41,7 +41,7 @@ void OpacityLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { context->is_opaque = parent_is_opaque && (alpha_ == SK_AlphaOPAQUE); context->mutators_stack.PushTransform( - SkMatrix::MakeTrans(offset_.fX, offset_.fY)); + SkMatrix::Translate(offset_.fX, offset_.fY)); context->mutators_stack.PushOpacity(alpha_); Layer::AutoPrerollSaveLayerState save = Layer::AutoPrerollSaveLayerState::Create(context); diff --git a/engine/src/flutter/flow/layers/opacity_layer_unittests.cc b/engine/src/flutter/flow/layers/opacity_layer_unittests.cc index 735bb0ae3c..183dcee52d 100644 --- a/engine/src/flutter/flow/layers/opacity_layer_unittests.cc +++ b/engine/src/flutter/flow/layers/opacity_layer_unittests.cc @@ -55,8 +55,8 @@ TEST_F(OpacityLayerTest, PaintBeforePreollDies) { TEST_F(OpacityLayerTest, ChildIsCached) { const SkAlpha alpha_half = 255 / 2; - auto initial_transform = SkMatrix::MakeTrans(50.0, 25.5); - auto other_transform = SkMatrix::MakeScale(1.0, 2.0); + auto initial_transform = SkMatrix::Translate(50.0, 25.5); + auto other_transform = SkMatrix::Scale(1.0, 2.0); const SkPath child_path = SkPath().addRect(SkRect::MakeWH(5.0f, 5.0f)); auto mock_layer = std::make_shared(child_path); auto layer = @@ -84,8 +84,8 @@ TEST_F(OpacityLayerTest, ChildIsCached) { TEST_F(OpacityLayerTest, ChildrenNotCached) { const SkAlpha alpha_half = 255 / 2; - auto initial_transform = SkMatrix::MakeTrans(50.0, 25.5); - auto other_transform = SkMatrix::MakeScale(1.0, 2.0); + auto initial_transform = SkMatrix::Translate(50.0, 25.5); + auto other_transform = SkMatrix::Scale(1.0, 2.0); const SkPath child_path1 = SkPath().addRect(SkRect::MakeWH(5.0f, 5.0f)); const SkPath child_path2 = SkPath().addRect(SkRect::MakeWH(5.0f, 5.0f)); auto mock_layer1 = std::make_shared(child_path1); @@ -121,9 +121,9 @@ TEST_F(OpacityLayerTest, ChildrenNotCached) { TEST_F(OpacityLayerTest, FullyOpaque) { const SkPath child_path = SkPath().addRect(SkRect::MakeWH(5.0f, 5.0f)); const SkPoint layer_offset = SkPoint::Make(0.5f, 1.5f); - const SkMatrix initial_transform = SkMatrix::MakeTrans(0.5f, 0.5f); + const SkMatrix initial_transform = SkMatrix::Translate(0.5f, 0.5f); const SkMatrix layer_transform = - SkMatrix::MakeTrans(layer_offset.fX, layer_offset.fY); + SkMatrix::Translate(layer_offset.fX, layer_offset.fY); #ifndef SUPPORT_FRACTIONAL_TRANSLATION const SkMatrix integral_layer_transform = RasterCache::GetIntegralTransCTM( SkMatrix::Concat(initial_transform, layer_transform)); @@ -170,9 +170,9 @@ TEST_F(OpacityLayerTest, FullyOpaque) { TEST_F(OpacityLayerTest, FullyTransparent) { const SkPath child_path = SkPath().addRect(SkRect::MakeWH(5.0f, 5.0f)); const SkPoint layer_offset = SkPoint::Make(0.5f, 1.5f); - const SkMatrix initial_transform = SkMatrix::MakeTrans(0.5f, 0.5f); + const SkMatrix initial_transform = SkMatrix::Translate(0.5f, 0.5f); const SkMatrix layer_transform = - SkMatrix::MakeTrans(layer_offset.fX, layer_offset.fY); + SkMatrix::Translate(layer_offset.fX, layer_offset.fY); #ifndef SUPPORT_FRACTIONAL_TRANSLATION const SkMatrix integral_layer_transform = RasterCache::GetIntegralTransCTM( SkMatrix::Concat(initial_transform, layer_transform)); @@ -218,9 +218,9 @@ TEST_F(OpacityLayerTest, FullyTransparent) { TEST_F(OpacityLayerTest, HalfTransparent) { const SkPath child_path = SkPath().addRect(SkRect::MakeWH(5.0f, 5.0f)); const SkPoint layer_offset = SkPoint::Make(0.5f, 1.5f); - const SkMatrix initial_transform = SkMatrix::MakeTrans(0.5f, 0.5f); + const SkMatrix initial_transform = SkMatrix::Translate(0.5f, 0.5f); const SkMatrix layer_transform = - SkMatrix::MakeTrans(layer_offset.fX, layer_offset.fY); + SkMatrix::Translate(layer_offset.fX, layer_offset.fY); #ifndef SUPPORT_FRACTIONAL_TRANSLATION const SkMatrix integral_layer_transform = RasterCache::GetIntegralTransCTM( SkMatrix::Concat(initial_transform, layer_transform)); @@ -272,11 +272,11 @@ TEST_F(OpacityLayerTest, Nested) { const SkPath child3_path = SkPath().addRect(SkRect::MakeWH(6.0f, 6.0f)); const SkPoint layer1_offset = SkPoint::Make(0.5f, 1.5f); const SkPoint layer2_offset = SkPoint::Make(2.5f, 0.5f); - const SkMatrix initial_transform = SkMatrix::MakeTrans(0.5f, 0.5f); + const SkMatrix initial_transform = SkMatrix::Translate(0.5f, 0.5f); const SkMatrix layer1_transform = - SkMatrix::MakeTrans(layer1_offset.fX, layer1_offset.fY); + SkMatrix::Translate(layer1_offset.fX, layer1_offset.fY); const SkMatrix layer2_transform = - SkMatrix::MakeTrans(layer2_offset.fX, layer2_offset.fY); + SkMatrix::Translate(layer2_offset.fX, layer2_offset.fY); #ifndef SUPPORT_FRACTIONAL_TRANSLATION const SkMatrix integral_layer1_transform = RasterCache::GetIntegralTransCTM( SkMatrix::Concat(initial_transform, layer1_transform)); diff --git a/engine/src/flutter/flow/layers/picture_layer_unittests.cc b/engine/src/flutter/flow/layers/picture_layer_unittests.cc index 4f565cf500..dc9e6080c1 100644 --- a/engine/src/flutter/flow/layers/picture_layer_unittests.cc +++ b/engine/src/flutter/flow/layers/picture_layer_unittests.cc @@ -71,7 +71,7 @@ TEST_F(PictureLayerTest, InvalidPictureDies) { TEST_F(PictureLayerTest, SimplePicture) { const SkPoint layer_offset = SkPoint::Make(1.5f, -0.5f); const SkMatrix layer_offset_matrix = - SkMatrix::MakeTrans(layer_offset.fX, layer_offset.fY); + SkMatrix::Translate(layer_offset.fX, layer_offset.fY); const SkRect picture_bounds = SkRect::MakeLTRB(5.0f, 6.0f, 20.5f, 21.5f); auto mock_picture = SkPicture::MakePlaceholder(picture_bounds); auto layer = std::make_shared( diff --git a/engine/src/flutter/flow/layers/shader_mask_layer_unittests.cc b/engine/src/flutter/flow/layers/shader_mask_layer_unittests.cc index 895c6a9360..a4118ce2db 100644 --- a/engine/src/flutter/flow/layers/shader_mask_layer_unittests.cc +++ b/engine/src/flutter/flow/layers/shader_mask_layer_unittests.cc @@ -44,7 +44,7 @@ TEST_F(ShaderMaskLayerTest, PaintBeforePreollDies) { #endif TEST_F(ShaderMaskLayerTest, EmptyFilter) { - const SkMatrix initial_transform = SkMatrix::MakeTrans(0.5f, 1.0f); + const SkMatrix initial_transform = SkMatrix::Translate(0.5f, 1.0f); const SkRect child_bounds = SkRect::MakeLTRB(5.0f, 6.0f, 20.5f, 21.5f); const SkRect layer_bounds = SkRect::MakeLTRB(2.0f, 4.0f, 6.5f, 6.5f); const SkPath child_path = SkPath().addRect(child_bounds); @@ -73,7 +73,7 @@ TEST_F(ShaderMaskLayerTest, EmptyFilter) { MockCanvas::DrawCall{ 1, MockCanvas::DrawPathData{child_path, child_paint}}, MockCanvas::DrawCall{ - 1, MockCanvas::ConcatMatrixData{SkMatrix::MakeTrans( + 1, MockCanvas::ConcatMatrixData{SkMatrix::Translate( layer_bounds.fLeft, layer_bounds.fTop)}}, MockCanvas::DrawCall{ 1, MockCanvas::DrawRectData{SkRect::MakeWH( @@ -84,7 +84,7 @@ TEST_F(ShaderMaskLayerTest, EmptyFilter) { } TEST_F(ShaderMaskLayerTest, SimpleFilter) { - const SkMatrix initial_transform = SkMatrix::MakeTrans(0.5f, 1.0f); + const SkMatrix initial_transform = SkMatrix::Translate(0.5f, 1.0f); const SkRect child_bounds = SkRect::MakeLTRB(5.0f, 6.0f, 20.5f, 21.5f); const SkRect layer_bounds = SkRect::MakeLTRB(2.0f, 4.0f, 6.5f, 6.5f); const SkPath child_path = SkPath().addRect(child_bounds); @@ -113,7 +113,7 @@ TEST_F(ShaderMaskLayerTest, SimpleFilter) { MockCanvas::DrawCall{ 1, MockCanvas::DrawPathData{child_path, child_paint}}, MockCanvas::DrawCall{ - 1, MockCanvas::ConcatMatrixData{SkMatrix::MakeTrans( + 1, MockCanvas::ConcatMatrixData{SkMatrix::Translate( layer_bounds.fLeft, layer_bounds.fTop)}}, MockCanvas::DrawCall{ 1, MockCanvas::DrawRectData{SkRect::MakeWH( @@ -124,7 +124,7 @@ TEST_F(ShaderMaskLayerTest, SimpleFilter) { } TEST_F(ShaderMaskLayerTest, MultipleChildren) { - const SkMatrix initial_transform = SkMatrix::MakeTrans(0.5f, 1.0f); + const SkMatrix initial_transform = SkMatrix::Translate(0.5f, 1.0f); const SkRect child_bounds = SkRect::MakeLTRB(5.0f, 6.0f, 20.5f, 21.5f); const SkRect layer_bounds = SkRect::MakeLTRB(2.0f, 4.0f, 6.5f, 6.5f); const SkPath child_path1 = SkPath().addRect(child_bounds); @@ -167,7 +167,7 @@ TEST_F(ShaderMaskLayerTest, MultipleChildren) { MockCanvas::DrawCall{ 1, MockCanvas::DrawPathData{child_path2, child_paint2}}, MockCanvas::DrawCall{ - 1, MockCanvas::ConcatMatrixData{SkMatrix::MakeTrans( + 1, MockCanvas::ConcatMatrixData{SkMatrix::Translate( layer_bounds.fLeft, layer_bounds.fTop)}}, MockCanvas::DrawCall{ 1, MockCanvas::DrawRectData{SkRect::MakeWH( @@ -178,7 +178,7 @@ TEST_F(ShaderMaskLayerTest, MultipleChildren) { } TEST_F(ShaderMaskLayerTest, Nested) { - const SkMatrix initial_transform = SkMatrix::MakeTrans(0.5f, 1.0f); + const SkMatrix initial_transform = SkMatrix::Translate(0.5f, 1.0f); const SkRect child_bounds = SkRect::MakeLTRB(5.0f, 6.0f, 7.5f, 8.5f); const SkRect layer_bounds = SkRect::MakeLTRB(2.0f, 4.0f, 20.5f, 20.5f); const SkPath child_path1 = SkPath().addRect(child_bounds); @@ -234,7 +234,7 @@ TEST_F(ShaderMaskLayerTest, Nested) { MockCanvas::DrawCall{ 2, MockCanvas::DrawPathData{child_path2, child_paint2}}, MockCanvas::DrawCall{ - 2, MockCanvas::ConcatMatrixData{SkMatrix::MakeTrans( + 2, MockCanvas::ConcatMatrixData{SkMatrix::Translate( layer_bounds.fLeft, layer_bounds.fTop)}}, MockCanvas::DrawCall{ 2, @@ -243,7 +243,7 @@ TEST_F(ShaderMaskLayerTest, Nested) { filter_paint2}}, MockCanvas::DrawCall{2, MockCanvas::RestoreData{1}}, MockCanvas::DrawCall{ - 1, MockCanvas::ConcatMatrixData{SkMatrix::MakeTrans( + 1, MockCanvas::ConcatMatrixData{SkMatrix::Translate( layer_bounds.fLeft, layer_bounds.fTop)}}, MockCanvas::DrawCall{ 1, diff --git a/engine/src/flutter/flow/layers/transform_layer_unittests.cc b/engine/src/flutter/flow/layers/transform_layer_unittests.cc index b99f35b2c7..5820e02105 100644 --- a/engine/src/flutter/flow/layers/transform_layer_unittests.cc +++ b/engine/src/flutter/flow/layers/transform_layer_unittests.cc @@ -66,8 +66,8 @@ TEST_F(TransformLayerTest, Simple) { SkPath child_path; child_path.addRect(5.0f, 6.0f, 20.5f, 21.5f); SkRect cull_rect = SkRect::MakeXYWH(2.0f, 2.0f, 14.0f, 14.0f); - SkMatrix initial_transform = SkMatrix::MakeTrans(-0.5f, -0.5f); - SkMatrix layer_transform = SkMatrix::MakeTrans(2.5f, 2.5f); + SkMatrix initial_transform = SkMatrix::Translate(-0.5f, -0.5f); + SkMatrix layer_transform = SkMatrix::Translate(2.5f, 2.5f); SkMatrix inverse_layer_transform; EXPECT_TRUE(layer_transform.invert(&inverse_layer_transform)); @@ -104,9 +104,9 @@ TEST_F(TransformLayerTest, Nested) { SkPath child_path; child_path.addRect(5.0f, 6.0f, 20.5f, 21.5f); SkRect cull_rect = SkRect::MakeXYWH(2.0f, 2.0f, 14.0f, 14.0f); - SkMatrix initial_transform = SkMatrix::MakeTrans(-0.5f, -0.5f); - SkMatrix layer1_transform = SkMatrix::MakeTrans(2.5f, 2.5f); - SkMatrix layer2_transform = SkMatrix::MakeTrans(2.5f, 2.5f); + SkMatrix initial_transform = SkMatrix::Translate(-0.5f, -0.5f); + SkMatrix layer1_transform = SkMatrix::Translate(2.5f, 2.5f); + SkMatrix layer2_transform = SkMatrix::Translate(2.5f, 2.5f); SkMatrix inverse_layer1_transform, inverse_layer2_transform; EXPECT_TRUE(layer1_transform.invert(&inverse_layer1_transform)); EXPECT_TRUE(layer2_transform.invert(&inverse_layer2_transform)); @@ -157,9 +157,9 @@ TEST_F(TransformLayerTest, NestedSeparated) { SkPath child_path; child_path.addRect(5.0f, 6.0f, 20.5f, 21.5f); SkRect cull_rect = SkRect::MakeXYWH(2.0f, 2.0f, 14.0f, 14.0f); - SkMatrix initial_transform = SkMatrix::MakeTrans(-0.5f, -0.5f); - SkMatrix layer1_transform = SkMatrix::MakeTrans(2.5f, 2.5f); - SkMatrix layer2_transform = SkMatrix::MakeTrans(2.5f, 2.5f); + SkMatrix initial_transform = SkMatrix::Translate(-0.5f, -0.5f); + SkMatrix layer1_transform = SkMatrix::Translate(2.5f, 2.5f); + SkMatrix layer2_transform = SkMatrix::Translate(2.5f, 2.5f); SkMatrix inverse_layer1_transform, inverse_layer2_transform; EXPECT_TRUE(layer1_transform.invert(&inverse_layer1_transform)); EXPECT_TRUE(layer2_transform.invert(&inverse_layer2_transform)); diff --git a/engine/src/flutter/flow/mutators_stack_unittests.cc b/engine/src/flutter/flow/mutators_stack_unittests.cc index 1d31a81623..19daa1fa2e 100644 --- a/engine/src/flutter/flow/mutators_stack_unittests.cc +++ b/engine/src/flutter/flow/mutators_stack_unittests.cc @@ -115,7 +115,7 @@ TEST(MutatorsStack, Traversal) { TEST(MutatorsStack, Equality) { MutatorsStack stack; - SkMatrix matrix = SkMatrix::MakeScale(1, 1); + SkMatrix matrix = SkMatrix::Scale(1, 1); stack.PushTransform(matrix); SkRect rect = SkRect::MakeEmpty(); stack.PushClipRect(rect); @@ -127,7 +127,7 @@ TEST(MutatorsStack, Equality) { stack.PushOpacity(alpha); MutatorsStack stackOther; - SkMatrix matrixOther = SkMatrix::MakeScale(1, 1); + SkMatrix matrixOther = SkMatrix::Scale(1, 1); stackOther.PushTransform(matrixOther); SkRect rectOther = SkRect::MakeEmpty(); stackOther.PushClipRect(rectOther); diff --git a/engine/src/flutter/flow/scene_update_context.h b/engine/src/flutter/flow/scene_update_context.h index a4d1156cc6..d014df9e3b 100644 --- a/engine/src/flutter/flow/scene_update_context.h +++ b/engine/src/flutter/flow/scene_update_context.h @@ -180,7 +180,7 @@ class SceneUpdateContext { // The transformation matrix of the current context. It's used to construct // the LayerRasterCacheKey for a given layer. - SkMatrix Matrix() const { return SkMatrix::MakeScale(ScaleX(), ScaleY()); } + SkMatrix Matrix() const { return SkMatrix::Scale(ScaleX(), ScaleY()); } bool HasRetainedNode(const LayerRasterCacheKey& key) const { return surface_producer_->HasRetainedNode(key); diff --git a/engine/src/flutter/flow/testing/mock_layer_unittests.cc b/engine/src/flutter/flow/testing/mock_layer_unittests.cc index d5a215fde5..0e6e37978c 100644 --- a/engine/src/flutter/flow/testing/mock_layer_unittests.cc +++ b/engine/src/flutter/flow/testing/mock_layer_unittests.cc @@ -36,8 +36,8 @@ TEST_F(MockLayerTest, PaintingEmptyLayerDies) { TEST_F(MockLayerTest, SimpleParams) { const SkPath path = SkPath().addRect(5.0f, 6.0f, 20.5f, 21.5f); const SkPaint paint = SkPaint(SkColors::kBlue); - const SkMatrix start_matrix = SkMatrix::MakeTrans(1.0f, 2.0f); - const SkMatrix scale_matrix = SkMatrix::MakeScale(0.5f, 0.5f); + const SkMatrix start_matrix = SkMatrix::Translate(1.0f, 2.0f); + const SkMatrix scale_matrix = SkMatrix::Scale(0.5f, 0.5f); const SkRect cull_rect = SkRect::MakeWH(5.0f, 5.0f); const float parent_elevation = 5.0f; const bool parent_has_platform_view = true; diff --git a/engine/src/flutter/lib/ui/compositing/scene_builder.cc b/engine/src/flutter/lib/ui/compositing/scene_builder.cc index ed189283ab..4ae901428f 100644 --- a/engine/src/flutter/lib/ui/compositing/scene_builder.cc +++ b/engine/src/flutter/lib/ui/compositing/scene_builder.cc @@ -100,7 +100,7 @@ void SceneBuilder::pushTransform(Dart_Handle layer_handle, } void SceneBuilder::pushOffset(Dart_Handle layer_handle, double dx, double dy) { - SkMatrix sk_matrix = SkMatrix::MakeTrans(dx, dy); + SkMatrix sk_matrix = SkMatrix::Translate(dx, dy); auto layer = std::make_shared(sk_matrix); PushLayer(layer); EngineLayer::MakeRetained(layer_handle, layer); diff --git a/engine/src/flutter/shell/platform/embedder/tests/embedder_unittests.cc b/engine/src/flutter/shell/platform/embedder/tests/embedder_unittests.cc index 82e392bbf8..fe721c369a 100644 --- a/engine/src/flutter/shell/platform/embedder/tests/embedder_unittests.cc +++ b/engine/src/flutter/shell/platform/embedder/tests/embedder_unittests.cc @@ -3258,7 +3258,7 @@ TEST_F(EmbedderTest, PlatformViewMutatorsAreValidWithPixelRatio) { case kFlutterPlatformViewMutationTypeTransformation: mutation.type = kFlutterPlatformViewMutationTypeTransformation; mutation.transformation = - FlutterTransformationMake(SkMatrix::MakeScale(2.0)); + FlutterTransformationMake(SkMatrix::Scale(2.0, 2.0)); break; } @@ -3643,7 +3643,7 @@ TEST_F(EmbedderTest, ComplexClipsAreCorrectlyCalculated) { ASSERT_EQ(mutations[2]->type, kFlutterPlatformViewMutationTypeTransformation); ASSERT_EQ(SkMatrixMake(mutations[2]->transformation), - SkMatrix::MakeTrans(512.0, 0.0)); + SkMatrix::Translate(512.0, 0.0)); ASSERT_EQ(mutations[3]->type, kFlutterPlatformViewMutationTypeClipRect); @@ -3653,7 +3653,7 @@ TEST_F(EmbedderTest, ComplexClipsAreCorrectlyCalculated) { ASSERT_EQ(mutations[4]->type, kFlutterPlatformViewMutationTypeTransformation); ASSERT_EQ(SkMatrixMake(mutations[4]->transformation), - SkMatrix::MakeTrans(-256.0, 0.0)); + SkMatrix::Translate(-256.0, 0.0)); ASSERT_EQ(mutations[5]->type, kFlutterPlatformViewMutationTypeClipRect); diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/vulkan_surface.h b/engine/src/flutter/shell/platform/fuchsia/flutter/vulkan_surface.h index 2315e0bcee..545808e0d4 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/vulkan_surface.h +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/vulkan_surface.h @@ -202,7 +202,7 @@ class VulkanSurface final size_t age_ = 0; bool valid_ = false; - flutter::LayerRasterCacheKey retained_key_ = {0, SkMatrix::MakeScale(1, 1)}; + flutter::LayerRasterCacheKey retained_key_ = {0, SkMatrix::Scale(1, 1)}; std::unique_ptr retained_node_ = nullptr; std::atomic used_in_retained_rendering_ = {false};