[dali_2.0.42] Merge branch 'devel/master'
[platform/core/uifw/dali-adaptor.git] / dali / internal / graphics / gles / egl-context-helper-implementation.h
1 #ifndef DALI_INTERNAL_ADAPTOR_EGL_CONTEXT_HELPER_IMPLEMENTATION_H
2 #define DALI_INTERNAL_ADAPTOR_EGL_CONTEXT_HELPER_IMPLEMENTATION_H
3
4 /*
5  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 #include <dali/internal/graphics/common/egl-include.h>
22 // EXTERNAL INCLUDES
23 #include <dali/integration-api/gl-context-helper-abstraction.h>
24
25 // INTERNAL INCLUDES
26 #include <dali/public-api/dali-adaptor-common.h>
27
28 namespace Dali
29 {
30 namespace Integration
31 {
32 class RenderSurface;
33 }
34
35 namespace Internal
36 {
37 namespace Adaptor
38 {
39 class EglImplementation;
40
41 /**
42  * EglContextHelperImplementation is a concrete implementation for GlContextHelperAbstraction.
43  * It provides helper functions to access EGL context APIs
44  */
45 class EglContextHelperImplementation : public Integration::GlContextHelperAbstraction
46 {
47 public:
48   /**
49    * Constructor
50    */
51   EglContextHelperImplementation();
52
53   /**
54    * Destructor
55    */
56   virtual ~EglContextHelperImplementation() = default;
57
58   /**
59    * Initialize with the Egl implementation.
60    * @param[in] impl The EGL implementation (to access the EGL context)
61    */
62   void Initialize(EglImplementation* impl);
63
64   /**
65    * @copydoc Dali::Integration::GlContextHelperAbstraction::MakeSurfacelessContextCurrent()
66    */
67   void MakeSurfacelessContextCurrent() override;
68
69   /**
70    * @copydoc Dali::Integration::GlContextHelperAbstraction::MakeContextNull()
71    */
72   void MakeContextNull() override;
73
74   /**
75    * @copydoc Dali::Integration::GlContextHelperAbstraction::WaitClient()
76    */
77   void WaitClient() override;
78
79 private:
80   EglImplementation* mEglImplementation; ///< Egl implementation (to access the EGL context)
81 };
82
83 } // namespace Adaptor
84 } // namespace Internal
85 } // namespace Dali
86
87 #endif // DALI_INTERNAL_ADAPTOR_EGL_CONTEXT_HELPER_IMPLEMENTATION_H