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 #include "ui/view/draw/content_modifier.h" 17 18 #include <memory> 19 20 #include "interfaces/inner_api/ace_kit/src/view/draw/modifier_adapter.h" 21 22 namespace OHOS::Ace::Kit { 23 ContentModifier()24ContentModifier::ContentModifier() {} 25 ~ContentModifier()26ContentModifier::~ContentModifier() {} 27 AttachRSProperty(const std::shared_ptr<Rosen::RSPropertyBase> & property)28void ContentModifier::AttachRSProperty(const std::shared_ptr<Rosen::RSPropertyBase>& property) 29 { 30 if (modifierAdapter_) { 31 modifierAdapter_->AttachRSProperty(property); 32 } 33 } 34 InitAdapter()35void ContentModifier::InitAdapter() 36 { 37 if (!modifierAdapter_) { 38 modifierAdapter_ = std::make_shared<ContentModifierAdapter>(Claim(this)); 39 } 40 } 41 GetRSModifier() const42const std::shared_ptr<ContentModifierAdapter>& ContentModifier::GetRSModifier() const 43 { 44 return modifierAdapter_; 45 } 46 47 } // namespace OHOS::Ace::Kit 48