• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-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 #ifndef RENDER_SERVICE_BASE_CORE_PIPELINE_RS_RENDER_CONTENT_H
16 #define RENDER_SERVICE_BASE_CORE_PIPELINE_RS_RENDER_CONTENT_H
17 
18 #include <list>
19 #include "common/rs_macros.h"
20 #include "memory/rs_dfx_string.h"
21 #include "modifier/rs_render_modifier.h"
22 #include "property/rs_properties.h"
23 #include "property/rs_property_drawable.h"
24 
25 namespace OHOS {
26 namespace Rosen {
27 
28 class RSB_EXPORT RSRenderContent : public std::enable_shared_from_this<RSRenderContent> {
29 public:
30     RSRenderContent();
31     ~RSRenderContent() = default;
32 
33     RSRenderContent(const RSRenderContent&) = delete;
34     RSRenderContent(const RSRenderContent&&) = delete;
35     RSRenderContent& operator=(const RSRenderContent&) = delete;
36     RSRenderContent& operator=(const RSRenderContent&&) = delete;
37 
38     RSProperties& GetMutableRenderProperties();
39     const RSProperties& GetRenderProperties() const;
40     using DrawCmdContainer = std::map<RSModifierType, std::list<std::shared_ptr<RSRenderModifier>>>;
41     RSRenderNodeType GetType() const;
42 
43     void DrawPropertyDrawable(RSPropertyDrawableSlot slot, RSPaintFilterCanvas& canvas) const;
44     void DrawPropertyDrawableRange(
45         RSPropertyDrawableSlot begin, RSPropertyDrawableSlot end, RSPaintFilterCanvas& canvas) const;
46 
47 private:
48     RSProperties renderProperties_;
49     RSPropertyDrawable::DrawableVec propertyDrawablesVec_;
50     DrawCmdContainer drawCmdModifiers_;
51     RSRenderNodeType type_ = RSRenderNodeType::UNKNOW;
52 
53     friend class RSRenderNode;
54     friend class RSModifierDrawable;
55 #ifdef RS_PROFILER_ENABLED
56     friend class RSProfiler;
57 #endif
58 };
59 } // namespace Rosen
60 } // namespace OHOS
61 
62 #endif // RENDER_SERVICE_BASE_CORE_PIPELINE_RS_RENDER_CONTENT_H