1 /* 2 * Copyright (c) 2025 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 ROSEN_RENDER_SERVICE_BASE_RS_SELF_DRAWING_NODE_RECT_DATA_H 17 #define ROSEN_RENDER_SERVICE_BASE_RS_SELF_DRAWING_NODE_RECT_DATA_H 18 19 #include <map> 20 #include <parcel.h> 21 22 #include "common/rs_common_def.h" 23 #include "common/rs_macros.h" 24 #include "common/rs_rect.h" 25 26 namespace OHOS { 27 namespace Rosen { 28 29 using SelfDrawingNodeRectCallbackData = std::map<NodeId, RectI>; 30 class RSB_EXPORT RSSelfDrawingNodeRectData : public Parcelable { 31 public: 32 RSSelfDrawingNodeRectData() = default; RSSelfDrawingNodeRectData(SelfDrawingNodeRectCallbackData & data)33 RSSelfDrawingNodeRectData(SelfDrawingNodeRectCallbackData& data) 34 { 35 for (auto iter = data.begin(); iter != data.end(); ++iter) { 36 rectData_.insert(std::make_pair(iter->first, iter->second)); 37 } 38 } RSSelfDrawingNodeRectData(RSSelfDrawingNodeRectData && other)39 RSSelfDrawingNodeRectData(RSSelfDrawingNodeRectData&& other) : rectData_(std::move(other.rectData_)) {} 40 virtual ~RSSelfDrawingNodeRectData() noexcept = default; 41 GetRectData()42 const SelfDrawingNodeRectCallbackData& GetRectData() const 43 { 44 return rectData_; 45 } 46 [[nodiscard]] static RSSelfDrawingNodeRectData* Unmarshalling(Parcel& parcel); 47 bool Marshalling(Parcel& parcel) const override; 48 49 private: 50 SelfDrawingNodeRectCallbackData rectData_; 51 }; 52 } // namespace Rosen 53 } // namespace OHOS 54 55 #endif