Merge branch 'devel/master' into sandbox/dkdk/tizen
[platform/core/uifw/dali-adaptor.git] / dali / integration-api / adaptor-framework / egl-interface.h
1 #ifndef DALI_INTEGRATION_EGL_INTERFACE_H
2 #define DALI_INTEGRATION_EGL_INTERFACE_H
3
4 /*
5  * Copyright (c) 2020 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 // INTERNAL INCLUDES
22 #include <dali/internal/graphics/common/egl-include.h>
23
24 namespace Dali
25 {
26 enum ColorDepth
27 {
28   COLOR_DEPTH_24 = 24,
29   COLOR_DEPTH_32 = 32
30 };
31
32 /**
33  * EglInterface provides an interface for managing EGL contexts
34  */
35 class EglInterface
36 {
37 public:
38   /**
39     * Create the OpenGL context.
40     * @return true if successful
41     */
42   virtual bool CreateContext() = 0;
43
44   /**
45    * Make the OpenGL context current
46    */
47   virtual void MakeContextCurrent(EGLSurface eglSurface, EGLContext eglContext) = 0;
48
49   /**
50    * Terminate GL
51    */
52   virtual void TerminateGles() = 0;
53
54   /**
55    * Performs an OpenGL swap buffers command
56    */
57   virtual void SwapBuffers(EGLSurface& eglSurface) = 0;
58
59   /**
60    * Performs an OpenGL copy buffers command
61    */
62   virtual void CopyBuffers(EGLSurface& eglSurface) = 0;
63
64   /**
65    * Performs an EGL wait GL command
66    */
67   virtual void WaitGL() = 0;
68
69 protected:
70   /**
71    * Virtual protected destructor, no deletion through this interface
72    */
73   virtual ~EglInterface()
74   {
75   }
76 };
77
78 } // namespace Dali
79
80 #endif // DALI_INTEGRATION_EGL_INTERFACE_H