1 /* 2 * Copyright (c) 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 INTERFACE_MATRIX_TEST_H 17 #define INTERFACE_MATRIX_TEST_H 18 #include <native_drawing/drawing_canvas.h> 19 #include <native_drawing/drawing_path.h> 20 #include <native_drawing/drawing_rect.h> 21 22 #include "test_base.h" 23 #include "test_common.h" 24 25 class MatrixReset : public TestBase { 26 public: MatrixReset(int type)27 explicit MatrixReset(int type) : TestBase(type) 28 { 29 fileName_ = "MatrixReset"; 30 } ~MatrixReset()31 ~MatrixReset() override {}; 32 33 protected: 34 void OnTestPerformance(OH_Drawing_Canvas* canvas) override; 35 }; 36 37 class MatrixConcat : public TestBase { 38 public: MatrixConcat(int type)39 explicit MatrixConcat(int type) : TestBase(type) 40 { 41 fileName_ = "MatrixConcat"; 42 } ~MatrixConcat()43 ~MatrixConcat() override {}; 44 45 protected: 46 void OnTestPerformance(OH_Drawing_Canvas* canvas) override; 47 }; 48 49 class MatrixInvert : public TestBase { 50 public: MatrixInvert(int type)51 explicit MatrixInvert(int type) : TestBase(type) 52 { 53 fileName_ = "MatrixInvert"; 54 } ~MatrixInvert()55 ~MatrixInvert() override {}; 56 57 protected: 58 void OnTestPerformance(OH_Drawing_Canvas* canvas) override; 59 }; 60 61 class MatrixSetPolyToPoly : public TestBase { 62 public: MatrixSetPolyToPoly(int type)63 explicit MatrixSetPolyToPoly(int type) : TestBase(type) 64 { 65 fileName_ = "MatrixSetPolyToPoly"; 66 } ~MatrixSetPolyToPoly()67 ~MatrixSetPolyToPoly() override {}; 68 69 protected: 70 void OnTestPerformance(OH_Drawing_Canvas* canvas) override; 71 }; 72 73 class MatrixPreRotate : public TestBase { 74 public: MatrixPreRotate(int type)75 explicit MatrixPreRotate(int type) : TestBase(type) 76 { 77 fileName_ = "MatrixPreRotate"; 78 }; ~MatrixPreRotate()79 ~MatrixPreRotate() override {}; 80 81 protected: 82 void OnTestPerformance(OH_Drawing_Canvas* canvas) override; 83 }; 84 85 class MatrixPostScale : public TestBase { 86 public: MatrixPostScale(int type)87 explicit MatrixPostScale(int type) : TestBase(type) 88 { 89 fileName_ = "MatrixPostScale"; 90 }; ~MatrixPostScale()91 ~MatrixPostScale() override {}; 92 93 protected: 94 void OnTestPerformance(OH_Drawing_Canvas* canvas) override; 95 }; 96 97 class MatrixPostTranslate : public TestBase { 98 public: MatrixPostTranslate(int type)99 explicit MatrixPostTranslate(int type) : TestBase(type) 100 { 101 fileName_ = "MatrixPostTranslate"; 102 }; ~MatrixPostTranslate()103 ~MatrixPostTranslate() override {}; 104 105 protected: 106 void OnTestPerformance(OH_Drawing_Canvas* canvas) override; 107 }; 108 109 class MatrixIsEqual : public TestBase { 110 public: MatrixIsEqual(int type)111 explicit MatrixIsEqual(int type) : TestBase(type) 112 { 113 fileName_ = "MatrixIsEqual"; 114 }; ~MatrixIsEqual()115 ~MatrixIsEqual() override {}; 116 117 protected: 118 void OnTestPerformance(OH_Drawing_Canvas* canvas) override; 119 }; 120 121 #endif // INTERFACE_MATRIX_TEST_H