1 /* 2 * Copyright (c) 2023 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_CORE_RS_RCD_RENDER_VISITOR_H 17 #define RENDER_SERVICE_CORE_RS_RCD_RENDER_VISITOR_H 18 19 #include <mutex> 20 #include <thread> 21 #include "pipeline/rs_processor.h" 22 #include "rs_rcd_surface_render_node.h" 23 #include "visitor/rs_node_visitor.h" 24 25 namespace OHOS { 26 namespace Rosen { 27 class RSPaintFilterCanvas; 28 29 // remove and use UniRenderVisitor instead when rcd is handled by in OH 6.0 rcd refactoring 30 class RSRcdRenderVisitor : public RSNodeVisitor { 31 public: 32 RSRcdRenderVisitor(); ~RSRcdRenderVisitor()33 ~RSRcdRenderVisitor() override {} 34 PrepareChildren(RSRenderNode & node)35 void PrepareChildren(RSRenderNode& node) override {} PrepareCanvasRenderNode(RSCanvasRenderNode & node)36 void PrepareCanvasRenderNode(RSCanvasRenderNode& node) override {} PrepareDisplayRenderNode(RSDisplayRenderNode & node)37 void PrepareDisplayRenderNode(RSDisplayRenderNode& node) override {} PrepareProxyRenderNode(RSProxyRenderNode & node)38 void PrepareProxyRenderNode(RSProxyRenderNode& node) override {} PrepareRootRenderNode(RSRootRenderNode & node)39 void PrepareRootRenderNode(RSRootRenderNode& node) override {} PrepareSurfaceRenderNode(RSSurfaceRenderNode & node)40 void PrepareSurfaceRenderNode(RSSurfaceRenderNode& node) override {} PrepareEffectRenderNode(RSEffectRenderNode & node)41 void PrepareEffectRenderNode(RSEffectRenderNode& node) override {} 42 ProcessChildren(RSRenderNode & node)43 void ProcessChildren(RSRenderNode& node) override {} ProcessCanvasRenderNode(RSCanvasRenderNode & node)44 void ProcessCanvasRenderNode(RSCanvasRenderNode& node) override {} ProcessDisplayRenderNode(RSDisplayRenderNode & node)45 void ProcessDisplayRenderNode(RSDisplayRenderNode& node) override {} ProcessProxyRenderNode(RSProxyRenderNode & node)46 void ProcessProxyRenderNode(RSProxyRenderNode& node) override {} ProcessRootRenderNode(RSRootRenderNode & node)47 void ProcessRootRenderNode(RSRootRenderNode& node) override {} ProcessSurfaceRenderNode(RSSurfaceRenderNode & node)48 void ProcessSurfaceRenderNode(RSSurfaceRenderNode& node) override {} ProcessEffectRenderNode(RSEffectRenderNode & node)49 void ProcessEffectRenderNode(RSEffectRenderNode& node) override {} 50 51 bool PrepareResourceBuffer(RSRcdSurfaceRenderNode &node, std::shared_ptr<rs_rcd::RoundCornerLayer>& layerInfo); 52 void ProcessRcdSurfaceRenderNode(RSRcdSurfaceRenderNode& node, bool resourceChanged); 53 void SetUniProcessor(std::shared_ptr<RSProcessor> processor); 54 55 private: 56 std::mutex bufferMut_; 57 std::shared_ptr<RSBaseRenderEngine> renderEngine_ = nullptr; 58 std::shared_ptr<RSProcessor> uniProcessor_ = nullptr; 59 }; 60 } // namespace Rosen 61 } // namespace OHOS 62 #endif // RENDER_SERVICE_CORE_RS_RCD_RENDER_VISITOR_H