1 /*
2 * Copyright (c) 2022 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 #include "gtest/gtest.h"
17
18 #include "effect/shader_effect.h"
19 #include "image/image.h"
20
21 using namespace testing;
22 using namespace testing::ext;
23
24 namespace OHOS {
25 namespace Rosen {
26 namespace Drawing {
27 class ShaderEffectTest : public testing::Test {
28 public:
29 static void SetUpTestCase();
30 static void TearDownTestCase();
31 void SetUp() override;
32 void TearDown() override;
33 };
34
SetUpTestCase()35 void ShaderEffectTest::SetUpTestCase() {}
TearDownTestCase()36 void ShaderEffectTest::TearDownTestCase() {}
SetUp()37 void ShaderEffectTest::SetUp() {}
TearDown()38 void ShaderEffectTest::TearDown() {}
39
40 /*
41 * @tc.name: CreateColorShader001
42 * @tc.desc:
43 * @tc.type: FUNC
44 * @tc.require: AR000GGNV3
45 * @tc.author:
46 */
47 HWTEST_F(ShaderEffectTest, CreateColorShader001, TestSize.Level1)
48 {
49 ColorQuad color = 13;
50 auto newShaderEffect = ShaderEffect::CreateColorShader(color);
51 EXPECT_TRUE(newShaderEffect != nullptr);
52 }
53
54 /*
55 * @tc.name: CreateColorShader002
56 * @tc.desc:
57 * @tc.type: FUNC
58 * @tc.require: AR000GGNV3
59 * @tc.author:
60 */
61 HWTEST_F(ShaderEffectTest, CreateColorShader002, TestSize.Level1)
62 {
63 ColorQuad color = 24;
64 auto newShaderEffect = ShaderEffect::CreateColorShader(color);
65 EXPECT_TRUE(newShaderEffect != nullptr);
66 }
67
68 /*
69 * @tc.name: CreateBlendShader001
70 * @tc.desc:
71 * @tc.type: FUNC
72 * @tc.require: AR000GGNV3
73 * @tc.author:
74 */
75 HWTEST_F(ShaderEffectTest, CreateBlendShader001, TestSize.Level1)
76 {
77 ShaderEffect shaderEffect1(ShaderEffect::ShaderEffectType::BLEND, 20);
78 ShaderEffect shaderEffect2(ShaderEffect::ShaderEffectType::LINEAR_GRADIENT, 10);
79 auto newShaderEffect = ShaderEffect::CreateBlendShader(shaderEffect1, shaderEffect2, BlendMode::CLEAR);
80 EXPECT_TRUE(newShaderEffect != nullptr);
81 }
82
83 /*
84 * @tc.name: CreateBlendShader002
85 * @tc.desc:
86 * @tc.type: FUNC
87 * @tc.require: AR000GGNV3
88 * @tc.author:
89 */
90 HWTEST_F(ShaderEffectTest, CreateBlendShader002, TestSize.Level1)
91 {
92 ShaderEffect shaderEffect3(ShaderEffect::ShaderEffectType::LINEAR_GRADIENT, 60);
93 ShaderEffect shaderEffect4(ShaderEffect::ShaderEffectType::CONICAL_GRADIENT, 4);
94 auto newShaderEffect = ShaderEffect::CreateBlendShader(shaderEffect3, shaderEffect4, BlendMode::DST);
95 EXPECT_TRUE(newShaderEffect != nullptr);
96 }
97
98 /*
99 * @tc.name: CreateImageShader001
100 * @tc.desc:
101 * @tc.type: FUNC
102 * @tc.require: AR000GGNV3
103 * @tc.author:
104 */
105 HWTEST_F(ShaderEffectTest, CreateImageShader001, TestSize.Level1)
106 {
107 Image image;
108 SamplingOptions sampling;
109 Matrix matrix;
110 auto newShaderEffect = ShaderEffect::CreateImageShader(image, TileMode::CLAMP, TileMode::REPEAT, sampling, matrix);
111 EXPECT_TRUE(newShaderEffect != nullptr);
112 }
113
114 /*
115 * @tc.name: CreateImageShader002
116 * @tc.desc:
117 * @tc.type: FUNC
118 * @tc.require: AR000GGNV3
119 * @tc.author:
120 */
121 HWTEST_F(ShaderEffectTest, CreateImageShader002, TestSize.Level1)
122 {
123 Image image;
124 SamplingOptions sampling;
125 Matrix matrix;
126 auto newShaderEffect = ShaderEffect::CreateImageShader(image, TileMode::REPEAT, TileMode::MIRROR, sampling, matrix);
127 EXPECT_TRUE(newShaderEffect != nullptr);
128 }
129
130 /*
131 * @tc.name: CreatePictureShader001
132 * @tc.desc:
133 * @tc.type: FUNC
134 * @tc.require: AR000GGNV3
135 * @tc.author:
136 */
137 HWTEST_F(ShaderEffectTest, CreatePictureShader001, TestSize.Level1)
138 {
139 Picture picture;
140 Matrix matrix;
141 Rect rect;
142 auto newShaderEffect = ShaderEffect::CreatePictureShader(
143 picture, TileMode::MIRROR, TileMode::REPEAT, FilterMode::LINEAR, matrix, rect);
144 EXPECT_TRUE(newShaderEffect != nullptr);
145 }
146
147 /*
148 * @tc.name: CreatePictureShader002
149 * @tc.desc:
150 * @tc.type: FUNC
151 * @tc.require: AR000GGNV3
152 * @tc.author:
153 */
154 HWTEST_F(ShaderEffectTest, CreatePictureShader002, TestSize.Level1)
155 {
156 Picture picture;
157 Matrix matrix;
158 Rect rect;
159 auto newShaderEffect =
160 ShaderEffect::CreatePictureShader(picture, TileMode::CLAMP, TileMode::REPEAT, FilterMode::LINEAR, matrix, rect);
161 EXPECT_TRUE(newShaderEffect != nullptr);
162 }
163
164 /*
165 * @tc.name: CreateLinearGradient001
166 * @tc.desc:
167 * @tc.type: FUNC
168 * @tc.require: AR000GGNV3
169 * @tc.author:
170 */
171 HWTEST_F(ShaderEffectTest, CreateLinearGradient001, TestSize.Level1)
172 {
173 Point startPoint;
174 Point endPoint;
175 std::vector<ColorQuad> colors;
176 std::vector<scalar> position;
177 auto newShaderEffect = ShaderEffect::CreateLinearGradient(startPoint, endPoint, colors, position, TileMode::CLAMP);
178 EXPECT_TRUE(newShaderEffect != nullptr);
179 }
180
181 /*
182 * @tc.name: CreateLinearGradient002
183 * @tc.desc:
184 * @tc.type: FUNC
185 * @tc.require: AR000GGNV3
186 * @tc.author:
187 */
188 HWTEST_F(ShaderEffectTest, CreateLinearGradient002, TestSize.Level1)
189 {
190 Point startPoint;
191 Point endPoint;
192 std::vector<ColorQuad> colors;
193 std::vector<scalar> position;
194 auto newShaderEffect = ShaderEffect::CreateLinearGradient(startPoint, endPoint, colors, position, TileMode::REPEAT);
195 EXPECT_TRUE(newShaderEffect != nullptr);
196 }
197
198 /*
199 * @tc.name: CreateRadialGradient001
200 * @tc.desc:
201 * @tc.type: FUNC
202 * @tc.require: AR000GGNV3
203 * @tc.author:
204 */
205 HWTEST_F(ShaderEffectTest, CreateRadialGradient001, TestSize.Level1)
206 {
207 Point centerPoint;
208 scalar radius = 0.5f;
209 std::vector<ColorQuad> colors;
210 std::vector<scalar> position;
211 TileMode tileMode = TileMode::MIRROR;
212 auto newShaderEffect = ShaderEffect::CreateRadialGradient(centerPoint, radius, colors, position, tileMode);
213 EXPECT_TRUE(newShaderEffect != nullptr);
214 }
215
216 /*
217 * @tc.name: CreateRadialGradient002
218 * @tc.desc:
219 * @tc.type: FUNC
220 * @tc.require: AR000GGNV3
221 * @tc.author:
222 */
223 HWTEST_F(ShaderEffectTest, CreateRadialGradient002, TestSize.Level1)
224 {
225 Point centerPoint;
226 scalar radius = 2.5f;
227 std::vector<ColorQuad> colors;
228 std::vector<scalar> position;
229 TileMode tileMode = TileMode::REPEAT;
230 auto newShaderEffect = ShaderEffect::CreateRadialGradient(centerPoint, radius, colors, position, tileMode);
231 EXPECT_TRUE(newShaderEffect != nullptr);
232 }
233
234 /*
235 * @tc.name: CreateTwoPointConical001
236 * @tc.desc:
237 * @tc.type: FUNC
238 * @tc.require: AR000GGNV3
239 * @tc.author:
240 */
241 HWTEST_F(ShaderEffectTest, CreateTwoPointConical001, TestSize.Level1)
242 {
243 Point startPoint;
244 scalar startRadius = 0.2f;
245 Point endPoint;
246 scalar endRadius = 0.5f;
247 std::vector<ColorQuad> colors;
248 std::vector<scalar> position;
249 TileMode tileMode = TileMode::MIRROR;
250 Matrix matrix;
251 auto newShaderEffect = ShaderEffect::CreateTwoPointConical(startPoint, startRadius, endPoint, endRadius, colors,
252 position, tileMode, &matrix);
253 EXPECT_TRUE(newShaderEffect != nullptr);
254 }
255
256 /*
257 * @tc.name: CreateTwoPointConical002
258 * @tc.desc:
259 * @tc.type: FUNC
260 * @tc.require: AR000GGNV3
261 * @tc.author:
262 */
263 HWTEST_F(ShaderEffectTest, CreateTwoPointConical002, TestSize.Level1)
264 {
265 Point startPoint;
266 scalar startRadius = 0.1f;
267 Point endPoint;
268 scalar endRadius = 0.7f;
269 std::vector<ColorQuad> colors;
270 std::vector<scalar> position;
271 TileMode tileMode = TileMode::REPEAT;
272 Matrix matrix;
273 auto newShaderEffect = ShaderEffect::CreateTwoPointConical(startPoint, startRadius, endPoint, endRadius, colors,
274 position, tileMode, &matrix);
275 EXPECT_TRUE(newShaderEffect != nullptr);
276 }
277
278 /*
279 * @tc.name: CreateSweepGradient001
280 * @tc.desc:
281 * @tc.type: FUNC
282 * @tc.require: AR000GGNV3
283 * @tc.author:
284 */
285 HWTEST_F(ShaderEffectTest, CreateSweepGradient001, TestSize.Level1)
286 {
287 Point centerPoint;
288 std::vector<ColorQuad> colors;
289 std::vector<scalar> position;
290 TileMode tileMode = TileMode::MIRROR;
291 scalar startAngle = 0.2f;
292 scalar endAngle = 0.5f;
293 auto newShaderEffect =
294 ShaderEffect::CreateSweepGradient(centerPoint, colors, position, tileMode, startAngle, endAngle, nullptr);
295 EXPECT_TRUE(newShaderEffect != nullptr);
296 }
297
298 /*
299 * @tc.name: CreateSweepGradient002
300 * @tc.desc:
301 * @tc.type: FUNC
302 * @tc.require: AR000GGNV3
303 * @tc.author:
304 */
305 HWTEST_F(ShaderEffectTest, CreateSweepGradient002, TestSize.Level1)
306 {
307 Point centerPoint;
308 std::vector<ColorQuad> colors;
309 std::vector<scalar> position;
310 TileMode tileMode = TileMode::REPEAT;
311 scalar startAngle = 10.2f;
312 scalar endAngle = 10.5f;
313 auto newShaderEffect =
314 ShaderEffect::CreateSweepGradient(centerPoint, colors, position, tileMode, startAngle, endAngle, nullptr);
315 EXPECT_TRUE(newShaderEffect != nullptr);
316 }
317
318 /*
319 * @tc.name: ArgsContructor001
320 * @tc.desc:
321 * @tc.type: FUNC
322 * @tc.require: AR000GGNV3
323 * @tc.author:
324 */
325 HWTEST_F(ShaderEffectTest, ArgsContructor001, TestSize.Level1)
326 {
327 auto newShaderEffect = std::make_unique<ShaderEffect>(ShaderEffect::ShaderEffectType::COLOR_EFFECT, 230);
328 ASSERT_TRUE(newShaderEffect != nullptr);
329 }
330
331 /*
332 * @tc.name: ArgsContructor002
333 * @tc.desc:
334 * @tc.type: FUNC
335 * @tc.require: AR000GGNV3
336 * @tc.author:
337 */
338 HWTEST_F(ShaderEffectTest, ArgsContructor002, TestSize.Level1)
339 {
340 auto newShaderEffect = std::make_unique<ShaderEffect>(ShaderEffect::ShaderEffectType::PICTURE, 100);
341 ASSERT_TRUE(newShaderEffect != nullptr);
342 }
343
344 /*
345 * @tc.name: ArgsContructor003
346 * @tc.desc:
347 * @tc.type: FUNC
348 * @tc.require: AR000GGNV3
349 * @tc.author:
350 */
351 HWTEST_F(ShaderEffectTest, ArgsContructor003, TestSize.Level1)
352 {
353 ShaderEffect shaderEffect3(ShaderEffect::ShaderEffectType::IMAGE, 55);
354 ShaderEffect shaderEffect4(ShaderEffect::ShaderEffectType::IMAGE, 100);
355 auto newShaderEffect = std::make_unique<ShaderEffect>(
356 ShaderEffect::ShaderEffectType::RADIAL_GRADIENT, shaderEffect3, shaderEffect4, BlendMode::SRC);
357 ASSERT_TRUE(newShaderEffect != nullptr);
358 }
359
360 /*
361 * @tc.name: ArgsContructor004
362 * @tc.desc:
363 * @tc.type: FUNC
364 * @tc.require: AR000GGNV3
365 * @tc.author:
366 */
367 HWTEST_F(ShaderEffectTest, ArgsContructor004, TestSize.Level1)
368 {
369 ShaderEffect shaderEffect3(ShaderEffect::ShaderEffectType::SWEEP_GRADIENT, 60);
370 ShaderEffect shaderEffect4(ShaderEffect::ShaderEffectType::IMAGE, 10);
371 auto newShaderEffect = std::make_unique<ShaderEffect>(
372 ShaderEffect::ShaderEffectType::SWEEP_GRADIENT, shaderEffect3, shaderEffect4, BlendMode::SRC);
373 ASSERT_TRUE(newShaderEffect != nullptr);
374 }
375
376 /*
377 * @tc.name: ArgsContructor005
378 * @tc.desc:
379 * @tc.type: FUNC
380 * @tc.require: AR000GGNV3
381 * @tc.author:
382 */
383 HWTEST_F(ShaderEffectTest, ArgsContructor005, TestSize.Level1)
384 {
385 Image image;
386 TileMode tileX = TileMode::REPEAT;
387 TileMode tileY = TileMode::MIRROR;
388 SamplingOptions sampling;
389 Matrix matrix;
390 auto newShaderEffect = std::make_unique<ShaderEffect>(
391 ShaderEffect::ShaderEffectType::CONICAL_GRADIENT, image, tileX, tileY, sampling, matrix);
392 ASSERT_TRUE(newShaderEffect != nullptr);
393 }
394
395 /*
396 * @tc.name: ArgsContructor006
397 * @tc.desc:
398 * @tc.type: FUNC
399 * @tc.require: AR000GGNV3
400 * @tc.author:
401 */
402 HWTEST_F(ShaderEffectTest, ArgsContructor006, TestSize.Level1)
403 {
404 Image image;
405 TileMode tileX = TileMode::REPEAT;
406 TileMode tileY = TileMode::CLAMP;
407 SamplingOptions sampling;
408 Matrix matrix;
409 auto newShaderEffect =
410 std::make_unique<ShaderEffect>(ShaderEffect::ShaderEffectType::PICTURE, image, tileX, tileY, sampling, matrix);
411 ASSERT_TRUE(newShaderEffect != nullptr);
412 }
413
414 /*
415 * @tc.name: ArgsContructor007
416 * @tc.desc:
417 * @tc.type: FUNC
418 * @tc.require: AR000GGNV3
419 * @tc.author:
420 */
421 HWTEST_F(ShaderEffectTest, ArgsContructor007, TestSize.Level1)
422 {
423 Image image;
424 SamplingOptions sampling;
425 Matrix matrix;
426 auto newShaderEffect = std::make_unique<ShaderEffect>(
427 ShaderEffect::ShaderEffectType::NO_TYPE, image, TileMode::CLAMP, TileMode::REPEAT, sampling, matrix);
428 ASSERT_TRUE(newShaderEffect != nullptr);
429 }
430
431 /*
432 * @tc.name: ArgsContructor008
433 * @tc.desc:
434 * @tc.type: FUNC
435 * @tc.require: AR000GGNV3
436 * @tc.author:
437 */
438 HWTEST_F(ShaderEffectTest, ArgsContructor008, TestSize.Level1)
439 {
440 Image image;
441 SamplingOptions sampling;
442 Matrix matrix;
443 auto newShaderEffect = std::make_unique<ShaderEffect>(
444 ShaderEffect::ShaderEffectType::CONICAL_GRADIENT, image, TileMode::REPEAT, TileMode::CLAMP, sampling, matrix);
445 ASSERT_TRUE(newShaderEffect != nullptr);
446 }
447
448 /*
449 * @tc.name: ArgsContructor009
450 * @tc.desc:
451 * @tc.type: FUNC
452 * @tc.require: AR000GGNV3
453 * @tc.author:
454 */
455 HWTEST_F(ShaderEffectTest, ArgsContructor009, TestSize.Level1)
456 {
457 Picture picture;
458 Rect rect;
459 Matrix matrix;
460 auto newShaderEffect = std::make_unique<ShaderEffect>(ShaderEffect::ShaderEffectType::PICTURE, picture,
461 TileMode::REPEAT, TileMode::MIRROR, FilterMode::LINEAR, matrix, rect);
462 ASSERT_TRUE(newShaderEffect != nullptr);
463 }
464
465 /*
466 * @tc.name: ArgsContructor010
467 * @tc.desc:
468 * @tc.type: FUNC
469 * @tc.require: AR000GGNV3
470 * @tc.author:
471 */
472 HWTEST_F(ShaderEffectTest, ArgsContructor010, TestSize.Level1)
473 {
474 Picture picture;
475 Rect rect;
476 Matrix matrix;
477 auto newShaderEffect = std::make_unique<ShaderEffect>(ShaderEffect::ShaderEffectType::CONICAL_GRADIENT, picture,
478 TileMode::MIRROR, TileMode::REPEAT, FilterMode::LINEAR, matrix, rect);
479 ASSERT_TRUE(newShaderEffect != nullptr);
480 }
481
482 /*
483 * @tc.name: ArgsContructor011
484 * @tc.desc:
485 * @tc.type: FUNC
486 * @tc.require: AR000GGNV3
487 * @tc.author:
488 */
489 HWTEST_F(ShaderEffectTest, ArgsContructor011, TestSize.Level1)
490 {
491 Point startPoint;
492 Point endPoint;
493 std::vector<ColorQuad> colors;
494 std::vector<scalar> position;
495 auto newShaderEffect = std::make_unique<ShaderEffect>(
496 ShaderEffect::ShaderEffectType::NO_TYPE, startPoint, endPoint, colors, position, TileMode::REPEAT);
497 ASSERT_TRUE(newShaderEffect != nullptr);
498 }
499
500 /*
501 * @tc.name: ArgsContructor012
502 * @tc.desc:
503 * @tc.type: FUNC
504 * @tc.require: AR000GGNV3
505 * @tc.author:
506 */
507 HWTEST_F(ShaderEffectTest, ArgsContructor012, TestSize.Level1)
508 {
509 Point startPoint;
510 Point endPoint;
511 std::vector<ColorQuad> colors;
512 std::vector<scalar> position;
513 auto newShaderEffect = std::make_unique<ShaderEffect>(
514 ShaderEffect::ShaderEffectType::COLOR_EFFECT, startPoint, endPoint, colors, position, TileMode::REPEAT);
515 ASSERT_TRUE(newShaderEffect != nullptr);
516 auto type = newShaderEffect->GetType();
517 EXPECT_EQ(type, ShaderEffect::ShaderEffectType::COLOR_EFFECT);
518 }
519
520 /*
521 * @tc.name: ArgsContructor013
522 * @tc.desc:
523 * @tc.type: FUNC
524 * @tc.require: AR000GGNV3
525 * @tc.author:
526 */
527 HWTEST_F(ShaderEffectTest, ArgsContructor013, TestSize.Level1)
528 {
529 Point centerPoint;
530 scalar radius = 0.5f;
531 std::vector<ColorQuad> colors;
532 std::vector<scalar> position;
533 auto newShaderEffect = std::make_unique<ShaderEffect>(
534 ShaderEffect::ShaderEffectType::SWEEP_GRADIENT, centerPoint, radius, colors, position, TileMode::REPEAT);
535 ASSERT_TRUE(newShaderEffect != nullptr);
536 auto type = newShaderEffect->GetType();
537 EXPECT_EQ(type, ShaderEffect::ShaderEffectType::SWEEP_GRADIENT);
538 }
539
540 /*
541 * @tc.name: ArgsContructor014
542 * @tc.desc:
543 * @tc.type: FUNC
544 * @tc.require: AR000GGNV3
545 * @tc.author:
546 */
547 HWTEST_F(ShaderEffectTest, ArgsContructor014, TestSize.Level1)
548 {
549 Point centerPoint;
550 scalar radius = 0.5f;
551 std::vector<ColorQuad> colors;
552 std::vector<scalar> position;
553 auto newShaderEffect = std::make_unique<ShaderEffect>(
554 ShaderEffect::ShaderEffectType::IMAGE, centerPoint, radius, colors, position, TileMode::REPEAT);
555 ASSERT_TRUE(newShaderEffect != nullptr);
556 }
557
558 /*
559 * @tc.name: ArgsContructor015
560 * @tc.desc:
561 * @tc.type: FUNC
562 * @tc.require: AR000GGNV3
563 * @tc.author:
564 */
565 HWTEST_F(ShaderEffectTest, ArgsContructor015, TestSize.Level1)
566 {
567 Point startPoint;
568 scalar startRadius = 0.1f;
569 Point endPoint;
570 scalar endRadius = 0.7f;
571 std::vector<ColorQuad> colors;
572 std::vector<scalar> position;
573 Matrix matrix;
574 auto newShaderEffect = std::make_unique<ShaderEffect>(ShaderEffect::ShaderEffectType::COLOR_EFFECT, startPoint,
575 startRadius, endPoint, endRadius, colors, position, TileMode::REPEAT, &matrix);
576 ASSERT_TRUE(newShaderEffect != nullptr);
577 }
578
579 /*
580 * @tc.name: ArgsContructor016
581 * @tc.desc:
582 * @tc.type: FUNC
583 * @tc.require: AR000GGNV3
584 * @tc.author:
585 */
586 HWTEST_F(ShaderEffectTest, ArgsContructor016, TestSize.Level1)
587 {
588 Point startPoint;
589 scalar startRadius = 55.1f;
590 Point endPoint;
591 scalar endRadius = 10.7f;
592 std::vector<ColorQuad> colors;
593 std::vector<scalar> position;
594 Matrix matrix;
595 auto newShaderEffect = std::make_unique<ShaderEffect>(ShaderEffect::ShaderEffectType::LINEAR_GRADIENT, startPoint,
596 startRadius, endPoint, endRadius, colors, position, TileMode::REPEAT, &matrix);
597 ASSERT_TRUE(newShaderEffect != nullptr);
598 }
599
600 /*
601 * @tc.name: ArgsContructor017
602 * @tc.desc:
603 * @tc.type: FUNC
604 * @tc.require: AR000GGNV3
605 * @tc.author:
606 */
607 HWTEST_F(ShaderEffectTest, ArgsContructor017, TestSize.Level1)
608 {
609 Point centerPoint;
610 scalar startAngle = 42.2f;
611 scalar endAngle = 55.7f;
612 std::vector<ColorQuad> colors;
613 std::vector<scalar> position;
614 auto newShaderEffect = std::make_unique<ShaderEffect>(
615 ShaderEffect::ShaderEffectType::BLEND, centerPoint, colors, position, TileMode::REPEAT, startAngle, endAngle,
616 nullptr);
617 ASSERT_TRUE(newShaderEffect != nullptr);
618 }
619
620 /*
621 * @tc.name: ArgsContructor017
622 * @tc.desc:
623 * @tc.type: FUNC
624 * @tc.require: AR000GGNV3
625 * @tc.author:
626 */
627 HWTEST_F(ShaderEffectTest, ArgsContructor018, TestSize.Level1)
628 {
629 Point centerPoint;
630 scalar startAngle = 3.55f;
631 scalar endAngle = 4.65f;
632 std::vector<ColorQuad> colors;
633 std::vector<scalar> position;
634 auto newShaderEffect = std::make_unique<ShaderEffect>(
635 ShaderEffect::ShaderEffectType::COLOR_EFFECT, centerPoint, colors, position, TileMode::REPEAT, startAngle, endAngle,
636 nullptr);
637 ASSERT_TRUE(newShaderEffect != nullptr);
638 }
639 } // namespace Drawing
640 } // namespace Rosen
641 } // namespace OHOS