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 FILTER_TEST_H 17 #define FILTER_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/filter.h" 24 #include "utils/log.h" 25 26 namespace OHOS { 27 namespace Rosen { 28 namespace Drawing { 29 class FilterTest { 30 public: 31 using TestFunc = std::function<void(Canvas&, uint32_t, uint32_t)>; GetInstance()32 inline static FilterTest& GetInstance() 33 { 34 static FilterTest filterTestCase; 35 return filterTestCase; 36 } 37 38 static void TestDrawFilter(Canvas& canvas, uint32_t width, uint32_t height); 39 std::vector<TestFunc> FilterTestCase(); 40 41 private: 42 FilterTest() = default; 43 virtual ~FilterTest() = default; 44 }; 45 } // namespace Drawing 46 } // namespace Rosen 47 } // namespace OHOS 48 #endif // FILTER_TEST_H