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 #ifndef RS_ANCO_MANAGER_H 16 #define RS_ANCO_MANAGER_H 17 18 #include "common/rs_common_def.h" 19 #include "pipeline/rs_surface_handler.h" 20 #include "pipeline/rs_surface_render_node.h" 21 #include "screen_manager/screen_types.h" 22 23 namespace OHOS::Rosen { 24 class RSAncoManager { 25 public: 26 static RSAncoManager* Instance(); 27 AncoHebcStatus GetAncoHebcStatus() const; 28 void SetAncoHebcStatus(AncoHebcStatus hebcStatus); 29 bool AncoOptimizeDisplayNode(std::shared_ptr<RSSurfaceHandler>& surfaceHandler, 30 std::vector<std::shared_ptr<RSSurfaceRenderNode>>& hardwareEnabledNodes, 31 ScreenRotation rotation, uint32_t width, uint32_t height); 32 virtual bool IsAncoOptimize(ScreenRotation rotation); 33 34 private: 35 bool AncoOptimizeCheck(bool isHebc, int nodesCnt, int sfvNodesCnt); 36 // anco displayNode use hebc 37 std::atomic<int32_t> ancoHebcStatus_ = static_cast<int32_t>(AncoHebcStatus::INITIAL); 38 protected: 39 RSAncoManager() = default; 40 virtual ~RSAncoManager() = default; 41 }; 42 } // namespace OHOS::Rosen 43 #endif // RS_ANCO_MANAGER_H 44