1 #ifndef DALI_INTERNAL_BASE_GRAPHICS_IMPLEMENTATION_H
2 #define DALI_INTERNAL_BASE_GRAPHICS_IMPLEMENTATION_H
5 * Copyright (c) 2019 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
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>
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 #include <dali/internal/graphics/gles/egl-context-helper-implementation.h>
43 class EglGraphics : public GraphicsInterface
55 virtual ~EglGraphics();
58 * @copydoc Dali::Internal::Adaptor::GraphicsInterface::Initialize()
60 void Initialize( EnvironmentOptions* environmentOptions ) override;
63 * Creates the graphics interface for EGL
64 * @return The graphics interface for EGL
66 EglInterface* Create();
70 * Default version is gles 3.0
72 void SetGlesVersion( const int32_t glesVersion );
75 * Set whether the surfaceless context is supported
76 * @param[in] isSupported Whether the surfaceless context is supported
78 void SetIsSurfacelessContextSupported( const bool isSupported );
81 * Gets the GL abstraction
82 * @return The GL abstraction
84 Integration::GlAbstraction& GetGlAbstraction() const;
87 * Gets the implementation of EGL
88 * @return The implementation of EGL
90 EglImplementation& GetEglImplementation() const;
93 * Gets the graphics interface for EGL
94 * @return The graphics interface for EGL
96 EglInterface& GetEglInterface() const;
99 * @copydoc Dali::Integration::GlAbstraction& GetGlesInterface()
101 GlImplementation& GetGlesInterface();
104 * Gets the implementation of GlSyncAbstraction for EGL.
105 * @return The implementation of GlSyncAbstraction for EGL.
107 EglSyncImplementation& GetSyncImplementation();
110 * Gets the implementation of GlContextHelperAbstraction for EGL.
111 * @return The implementation of GlContextHelperAbstraction for EGL.
113 EglContextHelperImplementation& GetContextHelperImplementation();
116 * @copydoc Dali::Internal::Adaptor::GraphicsInterface::GetDepthBufferRequired()
118 Integration::DepthBufferAvailable& GetDepthBufferRequired();
121 * @copydoc Dali::Internal::Adaptor::GraphicsInterface::GetStencilBufferRequired()
123 Integration::StencilBufferAvailable GetStencilBufferRequired();
126 * Gets the EGL image extension
127 * @return The EGL image extension
129 EglImageExtensions* GetImageExtensions();
132 * @copydoc Dali::Internal::Adaptor::GraphicsInterface::Destroy()
134 void Destroy() override;
137 // Eliminate copy and assigned operations
138 EglGraphics(const EglGraphics& rhs) = delete;
139 EglGraphics& operator=(const EglGraphics& rhs) = delete;
143 std::unique_ptr< GlImplementation > mGLES; ///< GL implementation
144 std::unique_ptr< EglImplementation > mEglImplementation; ///< EGL implementation
145 std::unique_ptr< EglImageExtensions > mEglImageExtensions; ///< EGL image extension
146 std::unique_ptr< EglSyncImplementation > mEglSync; ///< GlSyncAbstraction implementation for EGL
147 std::unique_ptr< EglContextHelperImplementation > mEglContextHelper; ///< GlContextHelperAbstraction implementation for EGL
149 int mMultiSamplingLevel; ///< The multiple sampling level
152 } // namespace Adaptor
154 } // namespace Internal
158 #endif // DALI_INTERNAL_BASE_GRAPHICS_IMPLEMENTATION_H