1 /* 2 * Copyright (c) 2021-2022 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 RS_CORE_PIPELINE_PHYSICAL_SCREEN_PROCESSOR_H 17 #define RS_CORE_PIPELINE_PHYSICAL_SCREEN_PROCESSOR_H 18 19 #include "rs_composer_adapter.h" 20 #include "rs_processor.h" 21 22 namespace OHOS { 23 namespace Rosen { 24 class RSPhysicalScreenProcessor : public RSProcessor { 25 public: 26 RSPhysicalScreenProcessor(); 27 ~RSPhysicalScreenProcessor() noexcept override; 28 29 bool Init(RSDisplayRenderNode& node, int32_t offsetX, int32_t offsetY, ScreenId mirroredId) override; 30 void ProcessSurface(RSSurfaceRenderNode& node) override; 31 void ProcessDisplaySurface(RSDisplayRenderNode& node) override; 32 void PostProcess() override; 33 private: 34 void Redraw(const sptr<Surface>& surface, const std::vector<LayerInfoPtr>& layers); 35 uint32_t GetLayerLevel(uint32_t layerLevel) const; 36 void ClosePerf(uint32_t layerLevel); 37 void RequestPerf(uint32_t layerLevel); 38 39 std::unique_ptr<RSComposerAdapter> composerAdapter_; 40 std::vector<LayerInfoPtr> layers_; 41 }; 42 } // namespace Rosen 43 } // namespace OHOS 44 #endif // RS_CORE_PIPELINE_PHYSICAL_SCREEN_PROCESSOR_H 45