SkMatrix::MakeFoo is deprecated, use SkMatrix::Foo instead (flutter/engine#18934)
This commit is contained in:
@@ -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 =
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 =
|
||||
|
||||
@@ -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<MockLayer>(child_path, child_paint);
|
||||
auto layer = std::make_shared<ContainerLayer>();
|
||||
@@ -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<MockLayer>(
|
||||
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<MockLayer>(child_path1, child_paint1);
|
||||
auto mock_layer2 = std::make_shared<MockLayer>(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<MockLayer>(
|
||||
child_path1, child_paint1, false /* fake_has_platform_view */,
|
||||
|
||||
@@ -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<MockLayer>(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 =
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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<MockLayer>(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<MockLayer>(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));
|
||||
|
||||
@@ -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<PictureLayer>(
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<flutter::TransformLayer>(sk_matrix);
|
||||
PushLayer(layer);
|
||||
EngineLayer::MakeRetained(layer_handle, layer);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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<scenic::EntityNode> retained_node_ = nullptr;
|
||||
|
||||
std::atomic<bool> used_in_retained_rendering_ = {false};
|
||||
|
||||
Reference in New Issue
Block a user