1 /*
2  * Copyright (c) 2021 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 "render/rs_shader.h"
17 
18 namespace OHOS {
19 namespace Rosen {
CreateRSShader()20 std::shared_ptr<RSShader> RSShader::CreateRSShader()
21 {
22     return std::make_shared<RSShader>();
23 }
24 
CreateRSShader(const std::shared_ptr<Drawing::ShaderEffect> & drShader)25 std::shared_ptr<RSShader> RSShader::CreateRSShader(const std::shared_ptr<Drawing::ShaderEffect>& drShader)
26 {
27     auto rsShader = std::make_shared<RSShader>();
28     rsShader->SetDrawingShader(drShader);
29     return rsShader;
30 }
31 
SetDrawingShader(const std::shared_ptr<Drawing::ShaderEffect> & drShader)32 void RSShader::SetDrawingShader(const std::shared_ptr<Drawing::ShaderEffect>& drShader)
33 {
34     drShader_ = drShader;
35 }
36 
GetDrawingShader() const37 const std::shared_ptr<Drawing::ShaderEffect>& RSShader::GetDrawingShader() const
38 {
39     return drShader_;
40 }
41 } // namespace Rosen
42 } // namespace OHOS