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 #ifndef SHADER_TEST_H 17 #define SHADER_TEST_H 18 19 #include "draw/brush.h" 20 #include "draw/canvas.h" 21 #include "draw/color.h" 22 #include "draw/pen.h" 23 #include "effect/shader_effect.h" 24 #include "utils/log.h" 25 #include "utils/rect.h" 26 27 namespace OHOS { 28 namespace Rosen { 29 namespace Drawing { 30 class ShaderTest { 31 public: 32 using TestFunc = std::function<void(Canvas&, uint32_t, uint32_t)>; GetInstance()33 inline static ShaderTest& GetInstance() 34 { 35 static ShaderTest shaderTestCase; 36 return shaderTestCase; 37 } 38 39 static void TestDrawShader(Canvas& canvas, uint32_t width, uint32_t height); 40 std::vector<TestFunc> ShaderTestCase(); 41 42 private: 43 ShaderTest() = default; 44 virtual ~ShaderTest() = default; 45 }; 46 } // namespace Drawing 47 } // namespace Rosen 48 } // namespace OHOS 49 #endif // SHADER_TEST_H