1 /* 2 * Copyright (c) 2025 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 DRAWING_CONFIG_H 17 #define DRAWING_CONFIG_H 18 19 #include <mutex> 20 21 namespace OHOS { 22 namespace Rosen { 23 namespace Drawing { 24 25 class DrawingConfig { 26 public: 27 #ifdef DRAWING_DISABLE_API 28 static void UpdateDrawingProperties(); //更新Drawing的各类配置项, 非debug时仅初始化调用, debug时每帧调用。 29 30 enum class DrawingDisableFlag : int { 31 DISABLE_POINT = 0, 32 DISABLE_TEXTBLOB, 33 DISABLE_IMAGE, 34 DISABLE_RECT, 35 DISABLE_RRECT, 36 DISABLE_OVAL, 37 DISABLE_ARC, 38 DISABLE_PATH, 39 DISABLE_PICTURE, 40 DISABLE_IMAGE_RECT, 41 DISABLE_IMAGE_LATTICE, 42 DISABLE_SDF, 43 DISABLE_LINE, 44 DISABLE_NESTED_RRECT, 45 DISABLE_PIE, 46 DISABLE_CIRCLE, 47 DISABLE_BACKGROUND, 48 DISABLE_SHADOW, 49 DISABLE_SHADOW_STYLE, 50 DISABLE_COLOR, 51 DISABLE_REGION, 52 DISABLE_PATCH, 53 DISABLE_VERTICES, 54 DISABLE_ATLAS, 55 DISABLE_BITMAP, 56 DISABLE_IMAGE_NINE, 57 DISABLE_SVGDOM, 58 DISABLE_SYMBOL, 59 DISABLE_CLIP_RECT, 60 DISABLE_CLIP_IRECT, 61 DISABLE_CLIP_RRECT, 62 DISABLE_CLIP_PATH, 63 DISABLE_CLIP_REGION, 64 DISABLE_BLUR_IMAGE, 65 DISABLE_COLOR_FILTER, 66 DISABLE_IMAGE_FILTER, 67 DISABLE_MASK_FILTER, 68 DISABLE_SHADER, 69 DISABLE_BLENDER, 70 DISABLE_PATH_EFFECT, 71 COUNT // The total number of flags. 72 }; 73 74 static bool IsDisabled(DrawingDisableFlag flag); 75 private: 76 static std::mutex mutex; 77 #endif 78 }; 79 } 80 } 81 } 82 #endif // DRAWING_CONFIG_H 83