1 /*
2  * Copyright (c) 2022 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 #include "pipeline/rs_occlusion_config.h"
16 
17 namespace OHOS {
18 namespace Rosen {
GetInstance()19 RSOcclusionConfig& RSOcclusionConfig::GetInstance()
20 {
21     static RSOcclusionConfig instance;
22     return instance;
23 }
24 
IsLeashWindow(std::string win)25 bool RSOcclusionConfig::IsLeashWindow(std::string win)
26 {
27     return win.find(leashWin_) != std::string::npos;
28 }
29 
IsStartingWindow(std::string win)30 bool RSOcclusionConfig::IsStartingWindow(std::string win)
31 {
32     return win.find(startWin_) != std::string::npos;
33 }
34 
IsAlphaWindow(std::string win)35 bool RSOcclusionConfig::IsAlphaWindow(std::string win)
36 {
37     for (auto str : alphaWins_) {
38         if (win.find(str) != std::string::npos) {
39             return true;
40         }
41     }
42     return false;
43 }
44 
IsDividerBar(std::string win)45 bool RSOcclusionConfig::IsDividerBar(std::string win)
46 {
47     return win.find(dividerBar_) != std::string::npos;
48 }
49 } // namespace Rosen
50 } // namespace OHOS
51