1 /* 2 * Copyright (c) 2022-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 #include "transaction/rs_occlusion_data.h" 17 #include "platform/common/rs_log.h" 18 19 namespace OHOS { 20 namespace Rosen { ~RSOcclusionData()21RSOcclusionData::~RSOcclusionData() noexcept 22 { 23 } 24 Unmarshalling(Parcel & parcel)25RSOcclusionData* RSOcclusionData::Unmarshalling(Parcel& parcel) 26 { 27 auto data = new RSOcclusionData(); 28 auto size = parcel.ReadUint32(); 29 for (uint32_t i = 0; i < size; i++) { 30 uint64_t id = parcel.ReadUint64(); 31 data->visibleData_.emplace_back(id); 32 } 33 return data; 34 } 35 Marshalling(Parcel & parcel) const36bool RSOcclusionData::Marshalling(Parcel& parcel) const 37 { 38 parcel.WriteUint32(visibleData_.size()); 39 for (auto& data : visibleData_) { 40 parcel.WriteUint64(data); 41 } 42 43 return true; 44 } 45 } // namespace Rosen 46 } // namespace OHOS 47