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 IMAGE_TEST_H 17 #define IMAGE_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 "image/bitmap.h" 25 #include "image/image.h" 26 #include "utils/log.h" 27 #include "utils/matrix.h" 28 #include "utils/rect.h" 29 30 namespace OHOS { 31 namespace Rosen { 32 namespace Drawing { 33 class ImageTest { 34 public: 35 using TestFunc = std::function<void(Canvas&, uint32_t, uint32_t)>; GetInstance()36 inline static ImageTest& GetInstance() 37 { 38 static ImageTest imageTestCase; 39 return imageTestCase; 40 } 41 42 static void TestDrawImage(Canvas& canvas, uint32_t width, uint32_t height); 43 static void TestDrawImageRect(Canvas& canvas, uint32_t width, uint32_t height); 44 std::vector<TestFunc> ImageTestCase(); 45 46 private: 47 ImageTest() = default; 48 virtual ~ImageTest() = default; 49 }; 50 } // namespace Drawing 51 } // namespace Rosen 52 } // namespace OHOS 53 #endif // IMAGE_TEST_H