1 /*
2  * Copyright (c) 2022-2024 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 #ifndef FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_MOCK_ROSEN_TEST_TESTING_SHADER_EFFECT_H
17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_MOCK_ROSEN_TEST_TESTING_SHADER_EFFECT_H
18 
19 #include <memory>
20 
21 #include "testing_color.h"
22 #include "testing_image.h"
23 #include "testing_matrix.h"
24 #include "testing_point.h"
25 #include "testing_sampling_options.h"
26 
27 namespace OHOS::Ace::Testing {
28 enum class TileMode {
29     CLAMP,
30     REPEAT,
31     MIRROR,
32     DECAL,
33 };
34 class TestingShaderEffect {
35 public:
36     typedef uint32_t ColorQuad;
37     typedef float scalar;
38     TestingShaderEffect() = default;
39     ~TestingShaderEffect() = default;
40 
CreateSweepGradient(const TestingPoint &,const std::vector<uint32_t> &,const std::vector<float> &,TileMode,float,float,const TestingMatrix *)41     static std::shared_ptr<TestingShaderEffect> CreateSweepGradient(const TestingPoint& /* centerPt */,
42         const std::vector<uint32_t>& /* colors */, const std::vector<float>& /* pos */, TileMode /* mode */,
43         float /* startAngle */, float /* endAngle */, const TestingMatrix* /* matrix */)
44     {
45         return std::make_shared<TestingShaderEffect>();
46     }
47 
CreateLinearGradient(const TestingPoint &,const TestingPoint &,const std::vector<uint32_t> &,const std::vector<float> &,TileMode)48     static std::shared_ptr<TestingShaderEffect> CreateLinearGradient(const TestingPoint& /* startPt */,
49         const TestingPoint& /* endPt */, const std::vector<uint32_t>& /* colors */, const std::vector<float>& /* pos */,
50         TileMode /* mode */)
51     {
52         return std::make_shared<TestingShaderEffect>();
53     }
54 
CreateRadialGradient(const TestingPoint & centerPt,scalar radius,const std::vector<ColorQuad> & colors,const std::vector<scalar> & pos,TileMode mode)55     static std::shared_ptr<TestingShaderEffect> CreateRadialGradient(const TestingPoint& centerPt, scalar radius,
56         const std::vector<ColorQuad>& colors, const std::vector<scalar>& pos, TileMode mode)
57     {
58         return std::make_shared<TestingShaderEffect>();
59     }
60 
CreateTwoPointConical(const TestingPoint & startPt,scalar startRadius,const TestingPoint & endPt,scalar endRadius,const std::vector<ColorQuad> & colors,const std::vector<scalar> & pos,TileMode mode,const TestingMatrix * matrix)61     static std::shared_ptr<TestingShaderEffect> CreateTwoPointConical(const TestingPoint& startPt, scalar startRadius,
62         const TestingPoint& endPt, scalar endRadius, const std::vector<ColorQuad>& colors,
63         const std::vector<scalar>& pos, TileMode mode, const TestingMatrix* matrix)
64     {
65         return std::make_shared<TestingShaderEffect>();
66     }
67 
CreateColorShader(ColorQuad color)68     static std::shared_ptr<TestingShaderEffect> CreateColorShader(ColorQuad color)
69     {
70         return std::make_shared<TestingShaderEffect>();
71     }
72 
CreateImageShader(const TestingImage & image,TileMode tileX,TileMode tileY,const TestingSamplingOptions & sampling,const TestingMatrix & matrix)73     static std::shared_ptr<TestingShaderEffect> CreateImageShader(const TestingImage& image, TileMode tileX,
74         TileMode tileY, const TestingSamplingOptions& sampling, const TestingMatrix& matrix)
75     {
76         return std::make_shared<TestingShaderEffect>();
77     }
78 };
79 } // namespace OHOS::Ace::Testing
80 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_MOCK_ROSEN_TEST_TESTING_SHADER_EFFECT_H
81