Merge branch 'devel/master' into tizen
[platform/core/uifw/dali-adaptor.git] / dali / internal / graphics / gles / egl-graphics.h
1 #ifndef DALI_INTERNAL_BASE_GRAPHICS_IMPLEMENTATION_H
2 #define DALI_INTERNAL_BASE_GRAPHICS_IMPLEMENTATION_H
3
4 /*
5  * Copyright (c) 2018 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 // EXTERNAL INCLUDES
22
23 // INTERNAL INCLUDES
24 #include <dali/internal/graphics/common/graphics-interface.h>
25 #include <dali/internal/graphics/gles/gl-proxy-implementation.h>
26 #include <dali/internal/graphics/gles/gl-implementation.h>
27 #include <dali/integration-api/egl-interface.h>
28
29 #include <dali/internal/graphics/gles/egl-implementation.h>
30 #include <dali/internal/graphics/common/egl-image-extensions.h>
31 #include <dali/internal/graphics/gles/egl-sync-implementation.h>
32
33
34 namespace Dali
35 {
36
37 namespace Internal
38 {
39
40 namespace Adaptor
41 {
42
43 class EglGraphics : public GraphicsInterface
44 {
45 public:
46
47   /**
48    * Constructor
49    */
50   EglGraphics();
51
52   /**
53    * Destructor
54    */
55   virtual ~EglGraphics();
56
57   /**
58    * @copydoc Dali::Internal::Adaptor::GraphicsInterface::Initialize()
59    */
60   void Initialize( EnvironmentOptions* environmentOptions ) override;
61
62   /**
63    * Creates the graphics interface for EGL
64    * @return The graphics interface for EGL
65    */
66   EglInterface* Create();
67
68   /**
69    * Gets the GL abstraction
70    * @return The GL abstraction
71    */
72   Integration::GlAbstraction& GetGlAbstraction() const;
73
74   /**
75    * Gets the implementation of EGL
76    * @return The implementation of EGL
77    */
78   EglImplementation& GetEglImplementation() const;
79
80   /**
81    * Gets the graphics interface for EGL
82    * @return The graphics interface for EGL
83    */
84   EglInterface& GetEglInterface() const;
85
86   /**
87    * @copydoc Dali::Integration::GlAbstraction& GetGlesInterface()
88    */
89   GlImplementation& GetGlesInterface();
90
91   /**
92    * Gets the implementation of GlSyncAbstraction for EGL.
93    * @return The implementation of GlSyncAbstraction for EGL.
94    */
95   EglSyncImplementation& GetSyncImplementation();
96
97   /**
98    * @copydoc Dali::Internal::Adaptor::GraphicsInterface::GetDepthBufferRequired()
99    */
100   Integration::DepthBufferAvailable& GetDepthBufferRequired();
101
102   /**
103    * @copydoc Dali::Internal::Adaptor::GraphicsInterface::GetStencilBufferRequired()
104    */
105   Integration::StencilBufferAvailable GetStencilBufferRequired();
106
107   /**
108    * Gets the EGL image extension
109    * @return The EGL image extension
110    */
111   EglImageExtensions* GetImageExtensions();
112
113   /**
114    * @copydoc Dali::Internal::Adaptor::GraphicsInterface::Destroy()
115    */
116   void Destroy() override;
117
118 private:
119   // Eliminate copy and assigned operations
120   EglGraphics(const EglGraphics& rhs) = delete;
121   EglGraphics& operator=(const EglGraphics& rhs) = delete;
122
123
124 private:
125   std::unique_ptr< GlImplementation > mGLES;                    ///< GL implementation
126   std::unique_ptr< EglImplementation > mEglImplementation;      ///< EGL implementation
127   std::unique_ptr< EglImageExtensions > mEglImageExtensions;    ///< EGL image extension
128   std::unique_ptr< EglSyncImplementation > mEglSync;            ///< GlSyncAbstraction implementation for EGL
129
130   int mMultiSamplingLevel;                                      ///< The multiple sampling level
131 };
132
133 } // namespace Adaptor
134
135 } // namespace Internal
136
137 } // namespace Dali
138
139 #endif // __DALI_INTERNAL_BASE_GRAPHICS_IMPLEMENTATION_H__