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 PERFEVENT_H 17 #define PERFEVENT_H 18 19 namespace OHOS { 20 namespace Rosen { 21 namespace Drawing { 22 enum COUNTER_TYPE { 23 COUNTER_INVALID_TYPE = -1, 24 COUNTER_FIRST_TYPE, 25 COUNTER_SECOND_TYPE, 26 COUNTER_THIRD_TYPE, 27 COUNTER_FORTH_TYPE, 28 }; 29 30 enum COUNTER_TIME_LIMIT { 31 COUNTER_MS_FIRST_TYPE = 1000000, 32 COUNTER_MS_SECOND_TYPE = 3000000, 33 COUNTER_MS_THIRD_TYPE = 5000000, 34 COUNTER_MS_FORTH_TYPE = 8000000, 35 }; 36 37 struct RsTextureEvent { initEventRsTextureEvent38 void initEvent (int32_t pid, int32_t maxBytes, int32_t budgetedBytes, int64_t allocTime, 39 bool clearCache) 40 { 41 fPid = pid; 42 fMaxBytes = maxBytes; 43 fBudgetedBytes = budgetedBytes; 44 fAllocTime = allocTime; 45 fClearCache = clearCache; 46 } 47 int32_t fPid {0}; 48 int32_t fMaxBytes {0}; 49 int32_t fBudgetedBytes {0}; 50 int64_t fAllocTime {0}; 51 bool fClearCache {false}; 52 }; 53 54 struct RsBlurEvent { initEventRsBlurEvent55 void initEvent (int32_t pid, uint16_t filterType, float blurRadius, int32_t width, 56 int32_t height, int64_t blurTime) 57 { 58 fPid = pid; 59 fFilterType = filterType; 60 fBlurRadius = blurRadius; 61 fWidth = width; 62 fHeight = height; 63 fBlurTime = blurTime; 64 } 65 int32_t fPid {0}; 66 uint16_t fFilterType {0}; 67 float fBlurRadius {0.0}; 68 int32_t fWidth {0}; 69 int32_t fHeight {0}; 70 int64_t fBlurTime {0}; 71 }; 72 } // namespace Drawing 73 } // namespace Rosen 74 } // namespace OHOS 75 #endif 76