已合并
【UT】检测SDFTransformShape的matrix的边界值的tdd #351
chensiyi_CE创建于 2025年11月30日
【UT】检测SDFTransformShape的matrix的边界值的tdd #351
已合并
共 2 个文件变更+409-0
| @@ -176,6 +176,7 @@ ohos_unittest("GraphicsEffectTest") { | |||
| 176 | "ge_sdf_rrect_shader_shape_test.cpp", | 176 | "ge_sdf_rrect_shader_shape_test.cpp", |
| 177 | "ge_sdf_shader_shape_test.cpp", | 177 | "ge_sdf_shader_shape_test.cpp", |
| 178 | "ge_sdf_shadow_shader_test.cpp", | 178 | "ge_sdf_shadow_shader_test.cpp", |
| 179 | "ge_sdf_transform_shader_shape_test.cpp", | ||
| 179 | "ge_sdf_union_op_shader_shape_test.cpp", | 180 | "ge_sdf_union_op_shader_shape_test.cpp", |
| 180 | "ge_shader_filter_test.cpp", | 181 | "ge_shader_filter_test.cpp", |
| 181 | "ge_shader_test.cpp", | 182 | "ge_shader_test.cpp", |
| @@ -0,0 +1,408 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2025 Huawei Device Co., Ltd. | ||
| 3 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 4 | * you may not use this file except in compliance with the License. | ||
| 5 | * You may obtain a copy of the License at | ||
| 6 | * | ||
| 7 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 8 | * | ||
| 9 | * Unless required by applicable law or agreed to in writing, software | ||
| 10 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 12 | * See the License for the specific language governing permissions and | ||
| 13 | * limitations under the License. | ||
| 14 | */ | ||
| 15 | |||
| 16 | |||
| 17 | |||
| 18 | |||
| 19 | |||
| 20 | |||
| 21 | using namespace testing; | ||
| 22 | using namespace testing::ext; | ||
| 23 | |||
| 24 | namespace OHOS { | ||
| 25 | namespace Rosen { | ||
| 26 | namespace Drawing { | ||
| 27 | class GESDFTransformShaderShapeTest : public testing::Test { | ||
| 28 | public: | ||
| 29 | static void SetUpTestCase(); | ||
| 30 | static void TearDownTestCase(); | ||
| 31 | void SetUp() override; | ||
| 32 | void TearDown() override; | ||
| 33 | |||
| 34 | std::shared_ptr<GESDFShaderShape> CreateTestShape() const; | ||
| 35 | }; | ||
| 36 | |||
| 37 | void GESDFTransformShaderShapeTest::SetUpTestCase(void) {} | ||
| 38 | void GESDFTransformShaderShapeTest::TearDownTestCase(void) {} | ||
| 39 | |||
| 40 | void GESDFTransformShaderShapeTest::SetUp() {} | ||
| 41 | void GESDFTransformShaderShapeTest::TearDown() {} | ||
| 42 | |||
| 43 | std::shared_ptr<GESDFShaderShape> GESDFTransformShaderShapeTest::CreateTestShape() const | ||
| 44 | { | ||
| 45 | GESDFRRectShapeParams param; | ||
| 46 | param.rrect = {0.0f, 0.0f, 100.0f, 100.0f, 10.0f, 10.0f}; | ||
| 47 | return std::make_shared<GESDFRRectShaderShape>(param); | ||
| 48 | } | ||
| 49 | |||
| 50 | /** | ||
| 51 | * @tc.name: GenerateDrawingShader_001 | ||
| 52 | * @tc.desc: Verify the GenerateDrawingShader function with valid parameters | ||
| 53 | * @tc.type: FUNC | ||
| 54 | */ | ||
| 55 | HWTEST_F(GESDFTransformShaderShapeTest, GenerateDrawingShader_001, TestSize.Level1) | ||
| 56 | { | ||
| 57 | GTEST_LOG_(INFO) << "GESDFTransformShaderShapeTest GenerateDrawingShader_001 start"; | ||
| 58 | GESDFTransformShapeParams param; | ||
| 59 | param.shape = CreateTestShape(); | ||
| 60 | param.matrix = Drawing::Matrix(); // Identity matrix | ||
| 61 | |||
| 62 | GESDFTransformShaderShape shape(param); | ||
| 63 | auto shader = shape.GenerateDrawingShader(100.0f, 100.0f); | ||
| 64 | EXPECT_NE(shader, nullptr); | ||
| 65 | GTEST_LOG_(INFO) << "GESDFTransformShaderShapeTest GenerateDrawingShader_001 end"; | ||
| 66 | } | ||
| 67 | |||
| 68 | /** | ||
| 69 | * @tc.name: GenerateDrawingShader_002 | ||
| 70 | * @tc.desc: Verify GenerateDrawingShader returns null when shape is null | ||
| 71 | * @tc.type: FUNC | ||
| 72 | */ | ||
| 73 | HWTEST_F(GESDFTransformShaderShapeTest, GenerateDrawingShader_002, TestSize.Level1) | ||
| 74 | { | ||
| 75 | GTEST_LOG_(INFO) << "GESDFTransformShaderShapeTest GenerateDrawingShader_002 start"; | ||
| 76 | GESDFTransformShapeParams param; | ||
| 77 | param.shape = nullptr; | ||
| 78 | param.matrix = Drawing::Matrix(); | ||
| 79 | |||
| 80 | GESDFTransformShaderShape shape(param); | ||
| 81 | auto shader = shape.GenerateDrawingShader(100.0f, 100.0f); | ||
| 82 | EXPECT_EQ(shader, nullptr); | ||
| 83 | GTEST_LOG_(INFO) << "GESDFTransformShaderShapeTest GenerateDrawingShader_002 end"; | ||
| 84 | } | ||
| 85 | |||
| 86 | /** | ||
| 87 | * @tc.name: GenerateDrawingShader_003 | ||
| 88 | * @tc.desc: Verify GenerateDrawingShader with non-identity matrix | ||
| 89 | * @tc.type: FUNC | ||
| 90 | */ | ||
| 91 | HWTEST_F(GESDFTransformShaderShapeTest, GenerateDrawingShader_003, TestSize.Level1) | ||
| 92 | { | ||
| 93 | GTEST_LOG_(INFO) << "GESDFTransformShaderShapeTest GenerateDrawingShader_003 start"; | ||
| 94 | GESDFTransformShapeParams param; | ||
| 95 | param.shape = CreateTestShape(); | ||
| 96 | |||
| 97 | // Create a translation matrix | ||
| 98 | Drawing::Matrix matrix; | ||
| 99 | matrix.Translate(10.0f, 20.0f); | ||
| 100 | param.matrix = matrix; | ||
| 101 | |||
| 102 | GESDFTransformShaderShape shape(param); | ||
| 103 | auto shader = shape.GenerateDrawingShader(100.0f, 100.0f); | ||
| 104 | EXPECT_NE(shader, nullptr); | ||
| 105 | GTEST_LOG_(INFO) << "GESDFTransformShaderShapeTest GenerateDrawingShader_003 end"; | ||
| 106 | } | ||
| 107 | |||
| 108 | /** | ||
| 109 | * @tc.name: GenerateDrawingShaderHasNormal_001 | ||
| 110 | * @tc.desc: Verify GenerateDrawingShaderHasNormal returns non-null shader with valid parameters | ||
| 111 | * @tc.type: FUNC | ||
| 112 | */ | ||
| 113 | HWTEST_F(GESDFTransformShaderShapeTest, GenerateDrawingShaderHasNormal_001, TestSize.Level1) | ||
| 114 | { | ||
| 115 | GTEST_LOG_(INFO) << "GESDFTransformShaderShapeTest GenerateDrawingShaderHasNormal_001 start"; | ||
| 116 | GESDFTransformShapeParams param; | ||
| 117 | param.shape = CreateTestShape(); | ||
| 118 | param.matrix = Drawing::Matrix(); | ||
| 119 | |||
| 120 | GESDFTransformShaderShape shape(param); | ||
| 121 | auto shader = shape.GenerateDrawingShaderHasNormal(100.0f, 100.0f); | ||
| 122 | EXPECT_NE(shader, nullptr); | ||
| 123 | GTEST_LOG_(INFO) << "GESDFTransformShaderShapeTest GenerateDrawingShaderHasNormal_001 end"; | ||
| 124 | } | ||
| 125 | |||
| 126 | /** | ||
| 127 | * @tc.name: GenerateDrawingShaderHasNormal_002 | ||
| 128 | * @tc.desc: Verify GenerateDrawingShaderHasNormal returns null when shape is null | ||
| 129 | * @tc.type: FUNC | ||
| 130 | */ | ||
| 131 | HWTEST_F(GESDFTransformShaderShapeTest, GenerateDrawingShaderHasNormal_002, TestSize.Level1) | ||
| 132 | { | ||
| 133 | GTEST_LOG_(INFO) << "GESDFTransformShaderShapeTest GenerateDrawingShaderHasNormal_002 start"; | ||
| 134 | GESDFTransformShapeParams param; | ||
| 135 | param.shape = nullptr; | ||
| 136 | param.matrix = Drawing::Matrix(); | ||
| 137 | |||
| 138 | GESDFTransformShaderShape shape(param); | ||
| 139 | auto shader = shape.GenerateDrawingShaderHasNormal(100.0f, 100.0f); | ||
| 140 | EXPECT_EQ(shader, nullptr); | ||
| 141 | GTEST_LOG_(INFO) << "GESDFTransformShaderShapeTest GenerateDrawingShaderHasNormal_002 end"; | ||
| 142 | } | ||
| 143 | |||
| 144 | /** | ||
| 145 | * @tc.name: GenerateDrawingShaderHasNormal_003 | ||
| 146 | * @tc.desc: Verify GenerateDrawingShaderHasNormal with non-identity matrix | ||
| 147 | * @tc.type: FUNC | ||
| 148 | */ | ||
| 149 | HWTEST_F(GESDFTransformShaderShapeTest, GenerateDrawingShaderHasNormal_003, TestSize.Level1) | ||
| 150 | { | ||
| 151 | GTEST_LOG_(INFO) << "GESDFTransformShaderShapeTest GenerateDrawingShader_003 start"; | ||
| 152 | GESDFTransformShapeParams param; | ||
| 153 | param.shape = CreateTestShape(); | ||
| 154 | |||
| 155 | // Create a translation matrix | ||
| 156 | Drawing::Matrix matrix; | ||
| 157 | matrix.Translate(10.0f, 20.0f); | ||
| 158 | param.matrix = matrix; | ||
| 159 | |||
| 160 | GESDFTransformShaderShape shape(param); | ||
| 161 | auto shader = shape.GenerateDrawingShaderHasNormal(100.0f, 100.0f); | ||
| 162 | EXPECT_NE(shader, nullptr); | ||
| 163 | GTEST_LOG_(INFO) << "GESDFTransformShaderShapeTest GenerateDrawingShader_003 end"; | ||
| 164 | } | ||
| 165 | |||
| 166 | /** | ||
| 167 | * @tc.name: GetSDFShapeType_001 | ||
| 168 | * @tc.desc: Verify GetSDFShapeType returns correct type | ||
| 169 | * @tc.type: FUNC | ||
| 170 | */ | ||
| 171 | HWTEST_F(GESDFTransformShaderShapeTest, GetSDFShapeType_001, TestSize.Level1) | ||
| 172 | { | ||
| 173 | GTEST_LOG_(INFO) << "GESDFTransformShaderShapeTest GetSDFShapeType_001 start"; | ||
| 174 | GESDFTransformShapeParams param; | ||
| 175 | param.shape = CreateTestShape(); | ||
| 176 | param.matrix = Drawing::Matrix(); | ||
| 177 | |||
| 178 | GESDFTransformShaderShape shape(param); | ||
| 179 | EXPECT_EQ(shape.GetSDFShapeType(), GESDFShapeType::TRANSFORM); | ||
| 180 | GTEST_LOG_(INFO) << "GESDFTransformShaderShapeTest GetSDFShapeType_001 end"; | ||
| 181 | } | ||
| 182 | |||
| 183 | /** | ||
| 184 | * @tc.name: GetMatrix_001 | ||
| 185 | * @tc.desc: Verify GetMatrix returns correct matrix | ||
| 186 | * @tc.type: FUNC | ||
| 187 | */ | ||
| 188 | HWTEST_F(GESDFTransformShaderShapeTest, GetMatrix_001, TestSize.Level1) | ||
| 189 | { | ||
| 190 | GTEST_LOG_(INFO) << "GESDFTransformShaderShapeTest GetMatrix_001 start"; | ||
| 191 | GESDFTransformShapeParams param; | ||
| 192 | param.shape = CreateTestShape(); | ||
| 193 | |||
| 194 | // Create a specific matrix | ||
| 195 | Drawing::Matrix expectedMatrix; | ||
| 196 | expectedMatrix.Translate(30.0f, 40.0f); | ||
| 197 | expectedMatrix.Scale(2.0f, 1.5f, 1.0f, 1.0f); | ||
| 198 | param.matrix = expectedMatrix; | ||
| 199 | |||
| 200 | GESDFTransformShaderShape shape(param); | ||
| 201 | const auto& matrix = shape.GetMatrix(); | ||
| 202 | |||
| 203 | EXPECT_EQ(matrix, param.matrix); | ||
| 204 | GTEST_LOG_(INFO) << "GESDFTransformShaderShapeTest GetMatrix_001 end"; | ||
| 205 | } | ||
| 206 | |||
| 207 | /** | ||
| 208 | * @tc.name: GetMatrix_002 | ||
| 209 | * @tc.desc: Verify GetMatrix returns identity matrix when not set | ||
| 210 | * @tc.type: FUNC | ||
| 211 | */ | ||
| 212 | HWTEST_F(GESDFTransformShaderShapeTest, GetMatrix_002, TestSize.Level1) | ||
| 213 | { | ||
| 214 | GTEST_LOG_(INFO) << "GESDFTransformShaderShapeTest GetMatrix_002 start"; | ||
| 215 | GESDFTransformShapeParams param; | ||
| 216 | param.shape = CreateTestShape(); | ||
| 217 | // matrix is default constructed (identity) | ||
| 218 | |||
| 219 | GESDFTransformShaderShape shape(param); | ||
| 220 | const auto& matrix = shape.GetMatrix(); | ||
| 221 | |||
| 222 | // Should return identity matrix | ||
| 223 | EXPECT_EQ(matrix, Drawing::Matrix()); | ||
| 224 | GTEST_LOG_(INFO) << "GESDFTransformShaderShapeTest GetMatrix_002 end"; | ||
| 225 | } | ||
| 226 | |||
| 227 | /** | ||
| 228 | * @tc.name: CopyState_001 | ||
| 229 | * @tc.desc: Verify CopyState correctly copies parameters | ||
| 230 | * @tc.type: FUNC | ||
| 231 | */ | ||
| 232 | HWTEST_F(GESDFTransformShaderShapeTest, CopyState_001, TestSize.Level1) | ||
| 233 | { | ||
| 234 | GTEST_LOG_(INFO) << "GESDFTransformShaderShapeTest CopyState_001 start"; | ||
| 235 | |||
| 236 | // Create first shape | ||
| 237 | GESDFTransformShapeParams param1; | ||
| 238 | param1.shape = CreateTestShape(); | ||
| 239 | Drawing::Matrix matrix1; | ||
| 240 | matrix1.Translate(10.0f, 20.0f); | ||
| 241 | param1.matrix = matrix1; | ||
| 242 | |||
| 243 | // Create second shape with different parameters | ||
| 244 | GESDFTransformShapeParams param2; | ||
| 245 | param2.shape = nullptr; | ||
| 246 | Drawing::Matrix matrix2; | ||
| 247 | matrix2.Scale(2.0f, 3.0f, 1.0f, 1.0f); | ||
| 248 | param2.matrix = matrix2; | ||
| 249 | |||
| 250 | GESDFTransformShaderShape shape1(param1); | ||
| 251 | GESDFTransformShaderShape shape2(param2); | ||
| 252 | |||
| 253 | // Copy state and verify | ||
| 254 | shape1.CopyState(shape2); | ||
| 255 | EXPECT_EQ(shape1.GetMatrix(), param2.matrix); | ||
| 256 | |||
| 257 | GTEST_LOG_(INFO) << "GESDFTransformShaderShapeTest CopyState_001 end"; | ||
| 258 | } | ||
| 259 | |||
| 260 | /** | ||
| 261 | * @tc.name: GetSDFTransformShaderShapeBuilder_001 | ||
| 262 | * @tc.desc: Verify GetSDFTransformShaderShapeBuilder returns valid builder | ||
| 263 | * @tc.type: FUNC | ||
| 264 | */ | ||
| 265 | HWTEST_F(GESDFTransformShaderShapeTest, GetSDFTransformShaderShapeBuilder_001, TestSize.Level1) | ||
| 266 | { | ||
| 267 | GTEST_LOG_(INFO) << "GESDFTransformShaderShapeTest GetSDFTransformShaderShapeBuilder_001 start"; | ||
| 268 | GESDFTransformShapeParams param; | ||
| 269 | param.shape = CreateTestShape(); | ||
| 270 | param.matrix = Drawing::Matrix(); | ||
| 271 | param.matrix.Translate(30.0f, 40.0f); | ||
| 272 | |||
| 273 | GESDFTransformShaderShape shape(param); | ||
| 274 | auto builder = shape.GetSDFTransformShaderShapeBuilder(); | ||
| 275 | EXPECT_NE(builder, nullptr); | ||
| 276 | |||
| 277 | // If created, it will reuse builder (thread_local) | ||
| 278 | EXPECT_NE(shape.GetSDFTransformShaderShapeBuilder(), nullptr); | ||
| 279 | GTEST_LOG_(INFO) << "GESDFTransformShaderShapeTest GetSDFTransformShaderShapeBuilder_001 end"; | ||
| 280 | } | ||
| 281 | |||
| 282 | /** | ||
| 283 | * @tc.name: GenerateShaderEffect_001 | ||
| 284 | * @tc.desc: Verify GenerateShaderEffect returns shader with valid parameters | ||
| 285 | * @tc.type: FUNC | ||
| 286 | */ | ||
| 287 | HWTEST_F(GESDFTransformShaderShapeTest, GenerateShaderEffect_001, TestSize.Level1) | ||
| 288 | { | ||
| 289 | GTEST_LOG_(INFO) << "GESDFTransformShaderShapeTest GenerateShaderEffect_001 start"; | ||
| 290 | GESDFTransformShapeParams param; | ||
| 291 | param.shape = CreateTestShape(); | ||
| 292 | param.matrix = Drawing::Matrix(); | ||
| 293 | |||
| 294 | GESDFTransformShaderShape shape(param); | ||
| 295 | auto builder = shape.GetSDFTransformShaderShapeBuilder(); | ||
| 296 | auto shapeShader = param.shape->GenerateDrawingShader(100.0f, 100.0f); | ||
| 297 | |||
| 298 | auto shader = shape.GenerateShaderEffect(100.0f, 100.0f, shapeShader, builder); | ||
| 299 | EXPECT_NE(shader, nullptr); | ||
| 300 | GTEST_LOG_(INFO) << "GESDFTransformShaderShapeTest GenerateShaderEffect_001 end"; | ||
| 301 | } | ||
| 302 | |||
| 303 | /** | ||
| 304 | * @tc.name: GenerateShaderEffect_002 | ||
| 305 | * @tc.desc: Verify GenerateShaderEffect returns null for invalid builder | ||
| 306 | * @tc.type: FUNC | ||
| 307 | */ | ||
| 308 | HWTEST_F(GESDFTransformShaderShapeTest, GenerateShaderEffect_002, TestSize.Level1) | ||
| 309 | { | ||
| 310 | GTEST_LOG_(INFO) << "GESDFTransformShaderShapeTest GenerateShaderEffect_002 start"; | ||
| 311 | GESDFTransformShapeParams param; | ||
| 312 | param.shape = CreateTestShape(); | ||
| 313 | param.matrix = Drawing::Matrix(); | ||
| 314 | |||
| 315 | GESDFTransformShaderShape shape(param); | ||
| 316 | auto shapeShader = param.shape->GenerateDrawingShader(100.0f, 100.0f); | ||
| 317 | |||
| 318 | auto shader = shape.GenerateShaderEffect(100.0f, 100.0f, shapeShader, nullptr); | ||
| 319 | EXPECT_EQ(shader, nullptr); | ||
| 320 | GTEST_LOG_(INFO) << "GESDFTransformShaderShapeTest GenerateShaderEffect_002 end"; | ||
| 321 | } | ||
| 322 | |||
| 323 | /** | ||
| 324 | * @tc.name: GenerateShaderEffect_003 | ||
| 325 | * @tc.desc: Verify GenerateShaderEffect returns original shader for identity matrix | ||
| 326 | * @tc.type: FUNC | ||
| 327 | */ | ||
| 328 | HWTEST_F(GESDFTransformShaderShapeTest, GenerateShaderEffect_003, TestSize.Level1) | ||
| 329 | { | ||
| 330 | GTEST_LOG_(INFO) << "GESDFTransformShaderShapeTest GenerateShaderEffect_003 start"; | ||
| 331 | GESDFTransformShapeParams param; | ||
| 332 | param.shape = CreateTestShape(); | ||
| 333 | param.matrix = Drawing::Matrix(); // Identity matrix | ||
| 334 | |||
| 335 | GESDFTransformShaderShape shape(param); | ||
| 336 | auto builder = shape.GetSDFTransformShaderShapeBuilder(); | ||
| 337 | auto shapeShader = param.shape->GenerateDrawingShader(100.0f, 100.0f); | ||
| 338 | |||
| 339 | auto shader = shape.GenerateShaderEffect(100.0f, 100.0f, shapeShader, builder); | ||
| 340 | EXPECT_EQ(shader, shapeShader); | ||
| 341 | GTEST_LOG_(INFO) << "GESDFTransformShaderShapeTest GenerateShaderEffect_003 end"; | ||
| 342 | } | ||
| 343 | |||
| 344 | /** | ||
| 345 | * @tc.name: MatrixBoundaryTest_001 | ||
| 346 | * @tc.desc: Verify maximum of matrix value | ||
| 347 | * @tc.type: FUNC | ||
| 348 | */ | ||
| 349 | HWTEST_F(GESDFTransformShaderShapeTest, MatrixBoundaryTest_001, TestSize.Level1) | ||
| 350 | { | ||
| 351 | GTEST_LOG_(INFO) << "GESDFTransformShaderShapeTest MatrixBoundaryTest_001 start"; | ||
| 352 | float infinity = std::numeric_limits<float>::infinity(); | ||
| 353 | GESDFTransformShapeParams param; | ||
| 354 | param.shape = CreateTestShape(); | ||
| 355 | // Create a translation matrix | ||
| 356 | Drawing::Matrix matrix; | ||
| 357 | matrix.Translate(infinity, -infinity); | ||
| 358 | param.matrix = matrix; | ||
| 359 | GESDFTransformShaderShape shape(param); | ||
| 360 | auto shader = shape.GenerateDrawingShader(100.0f, 100.0f); | ||
| 361 | EXPECT_NE(shader, nullptr); | ||
| 362 | GTEST_LOG_(INFO) << "GESDFTransformShaderShapeTest MatrixBoundaryTest_001 end"; | ||
| 363 | } | ||
| 364 | |||
| 365 | /** | ||
| 366 | * @tc.name: MatrixBoundaryTest_002 | ||
| 367 | * @tc.desc: Verify maximum of matrix value | ||
| 368 | * @tc.type: FUNC | ||
| 369 | */ | ||
| 370 | HWTEST_F(GESDFTransformShaderShapeTest, MatrixBoundaryTest_002, TestSize.Level1) | ||
| 371 | { | ||
| 372 | GTEST_LOG_(INFO) << "GESDFTransformShaderShapeTest MatrixBoundaryTest_002 start"; | ||
| 373 | float infinity = std::numeric_limits<float>::infinity(); | ||
| 374 | GESDFTransformShapeParams param; | ||
| 375 | param.shape = CreateTestShape(); | ||
| 376 | // Create a translation matrix | ||
| 377 | Drawing::Matrix matrix; | ||
| 378 | matrix.Rotate(infinity, 0, 0); // degree, px, py | ||
| 379 | param.matrix = matrix; | ||
| 380 | GESDFTransformShaderShape shape(param); | ||
| 381 | auto shader = shape.GenerateDrawingShader(100.0f, 100.0f); | ||
| 382 | EXPECT_NE(shader, nullptr); | ||
| 383 | GTEST_LOG_(INFO) << "GESDFTransformShaderShapeTest MatrixBoundaryTest_002 end"; | ||
| 384 | } | ||
| 385 | |||
| 386 | /** | ||
| 387 | * @tc.name: MatrixBoundaryTest_003 | ||
| 388 | * @tc.desc: Verify maximum of matrix value | ||
| 389 | * @tc.type: FUNC | ||
| 390 | */ | ||
| 391 | HWTEST_F(GESDFTransformShaderShapeTest, MatrixBoundaryTest_003, TestSize.Level1) | ||
| 392 | { | ||
| 393 | GTEST_LOG_(INFO) << "GESDFTransformShaderShapeTest MatrixBoundaryTest_003 start"; | ||
| 394 | float infinity = std::numeric_limits<float>::infinity(); | ||
| 395 | GESDFTransformShapeParams param; | ||
| 396 | param.shape = CreateTestShape(); | ||
| 397 | // Create a translation matrix | ||
| 398 | Drawing::Matrix matrix; | ||
| 399 | matrix.Scale(infinity, -infinity, 0, 0); // sx, sy, px, py | ||
| 400 | param.matrix = matrix; | ||
| 401 | GESDFTransformShaderShape shape(param); | ||
| 402 | auto shader = shape.GenerateDrawingShader(100.0f, 100.0f); | ||
| 403 | EXPECT_NE(shader, nullptr); | ||
| 404 | GTEST_LOG_(INFO) << "GESDFTransformShaderShapeTest MatrixBoundaryTest_003 end"; | ||
| 405 | } | ||
| 406 | } // namespace Drawing | ||
| 407 | } // namespace Rosen | ||
| 408 | } // namespace OHOS | ||
字母序