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_COLOR_TEST_H 17 #define INTERFACE_COLOR_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 ColorFilterCreateBlendMode : public TestBase { 26 public: ColorFilterCreateBlendMode(int type)27 explicit ColorFilterCreateBlendMode(int type) : TestBase(type) 28 { 29 fileName_ = "ColorFilterCreateBlendMode"; 30 }; ~ColorFilterCreateBlendMode()31 ~ColorFilterCreateBlendMode() override {}; 32 33 protected: 34 int rectWidth_ = 0; 35 int rectHeight_ = 0; 36 void OnTestPerformance(OH_Drawing_Canvas* canvas) override; 37 }; 38 39 class ColorFilterCreateCompose : public TestBase { 40 public: ColorFilterCreateCompose(int type)41 explicit ColorFilterCreateCompose(int type) : TestBase(type) 42 { 43 fileName_ = "ColorFilterCreateCompose"; 44 }; ~ColorFilterCreateCompose()45 ~ColorFilterCreateCompose() override {}; 46 47 protected: 48 int rectWidth_ = 0; 49 int rectHeight_ = 0; 50 void OnTestPerformance(OH_Drawing_Canvas* canvas) override; 51 }; 52 53 class ColorFilterCreateMatrix : public TestBase { 54 public: ColorFilterCreateMatrix(int type)55 explicit ColorFilterCreateMatrix(int type) : TestBase(type) 56 { 57 fileName_ = "ColorFilterCreateMatrix"; 58 }; ~ColorFilterCreateMatrix()59 ~ColorFilterCreateMatrix() override {}; 60 61 protected: 62 int rectWidth_ = 0; 63 int rectHeight_ = 0; 64 void OnTestPerformance(OH_Drawing_Canvas* canvas) override; 65 }; 66 67 class ColorFilterCreateLinearToSrgbGamma : public TestBase { 68 public: ColorFilterCreateLinearToSrgbGamma(int type)69 explicit ColorFilterCreateLinearToSrgbGamma(int type) : TestBase(type) 70 { 71 fileName_ = "ColorFilterCreateLinearToSrgbGamma"; 72 }; ~ColorFilterCreateLinearToSrgbGamma()73 ~ColorFilterCreateLinearToSrgbGamma() override {}; 74 75 protected: 76 int rectWidth_ = 0; 77 int rectHeight_ = 0; 78 void OnTestPerformance(OH_Drawing_Canvas* canvas) override; 79 }; 80 81 class ColorFilterCreateSrgbGammaToLinear : public TestBase { 82 public: ColorFilterCreateSrgbGammaToLinear(int type)83 explicit ColorFilterCreateSrgbGammaToLinear(int type) : TestBase(type) 84 { 85 fileName_ = "ColorFilterCreateSrgbGammaToLinear"; 86 }; ~ColorFilterCreateSrgbGammaToLinear()87 ~ColorFilterCreateSrgbGammaToLinear() override {}; 88 89 protected: 90 int rectWidth_ = 0; 91 int rectHeight_ = 0; 92 void OnTestPerformance(OH_Drawing_Canvas* canvas) override; 93 }; 94 95 class ColorFilterCreateLuma : public TestBase { 96 public: ColorFilterCreateLuma(int type)97 explicit ColorFilterCreateLuma(int type) : TestBase(type) 98 { 99 fileName_ = "ColorFilterCreateLuma"; 100 }; ~ColorFilterCreateLuma()101 ~ColorFilterCreateLuma() override {}; 102 103 protected: 104 int rectWidth_ = 0; 105 int rectHeight_ = 0; 106 void OnTestPerformance(OH_Drawing_Canvas* canvas) override; 107 }; 108 109 class ColorSpaceCreateSrgb : public TestBase { 110 public: ColorSpaceCreateSrgb(int type)111 explicit ColorSpaceCreateSrgb(int type) : TestBase(type) 112 { 113 fileName_ = "ColorSpaceCreateSrgb"; 114 }; ~ColorSpaceCreateSrgb()115 ~ColorSpaceCreateSrgb() override {}; 116 117 protected: 118 int rectWidth_ = 0; 119 int rectHeight_ = 0; 120 void OnTestPerformance(OH_Drawing_Canvas* canvas) override; 121 }; 122 123 class ColorSpaceCreateSrgbLinear : public TestBase { 124 public: ColorSpaceCreateSrgbLinear(int type)125 explicit ColorSpaceCreateSrgbLinear(int type) : TestBase(type) 126 { 127 fileName_ = "ColorSpaceCreateSrgbLinear"; 128 }; ~ColorSpaceCreateSrgbLinear()129 ~ColorSpaceCreateSrgbLinear() override {}; 130 131 protected: 132 int rectWidth_ = 0; 133 int rectHeight_ = 0; 134 void OnTestPerformance(OH_Drawing_Canvas* canvas) override; 135 }; 136 #endif // INTERFACE_COLOR_TEST_H