1 /* 2 * Copyright (c) 2021-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 RENDER_SERVICE_CLIENT_CORE_PIPELINE_RS_RENDER_THREAD_UTIL 17 #define RENDER_SERVICE_CLIENT_CORE_PIPELINE_RS_RENDER_THREAD_UTIL 18 19 #include "utils/rect.h" 20 21 namespace OHOS { 22 namespace Rosen { 23 24 #ifdef ROSEN_OHOS 25 namespace { 26 constexpr uint32_t API_VERSION_MOD = 1000; 27 constexpr uint32_t INVALID_API_COMPATIBLE_VERSION = 0; 28 } // namespace 29 #endif 30 31 class RSRenderThreadUtil { 32 public: 33 static void SrcRectScaleDown(Drawing::Rect& srcRect, const Drawing::Rect& localBounds); 34 static void SrcRectScaleFit(const Drawing::Rect& srcRect, Drawing::Rect& dstRect, const Drawing::Rect& localBounds); 35 #ifdef ROSEN_OHOS 36 static uint32_t GetApiCompatibleVersion(); 37 #endif 38 }; 39 } // namespace Rosen 40 } // namespace OHOS 41 42 #endif // RENDER_SERVICE_CLIENT_CORE_PIPELINE_RS_RENDER_THREAD_UTIL