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 
16 #include "egl_wrapper_object.h"
17 
18 #include "egl_wrapper_display.h"
19 #include "wrapper_log.h"
20 namespace OHOS {
EglWrapperObject(EglWrapperDisplay * disp)21 EglWrapperObject::EglWrapperObject(EglWrapperDisplay *disp) : display_(disp)
22 {
23     WLOGD("");
24     if (display_) {
25         display_->AddObject(this);
26     }
27 }
28 
GetDisplay()29 EglWrapperDisplay *EglWrapperObject::GetDisplay()
30 {
31     WLOGD("");
32     return display_;
33 }
34 
~EglWrapperObject()35 EglWrapperObject::~EglWrapperObject()
36 {
37     WLOGD("");
38 }
39 
Destroy()40 void EglWrapperObject::Destroy()
41 {
42     WLOGD("");
43     if (display_) {
44         display_->RemoveObject(this);
45     }
46 
47     delete this;
48 }
49 
Release()50 void EglWrapperObject::Release()
51 {
52     WLOGD("");
53     delete this;
54 }
55 } // namespace OHOS
56