1 #ifndef __DALI_INTERNAL_RENDER_SURFACE_H__
2 #define __DALI_INTERNAL_RENDER_SURFACE_H__
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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.
21 #include <dali/public-api/adaptor-framework/common/render-surface.h>
22 #include <dali/public-api/common/dali-common.h>
23 #include <dali/public-api/common/view-mode.h>
33 } // namespace Integration
44 * This is the internal RenderSurface API
46 class DALI_IMPORT_API RenderSurface : public Dali::RenderSurface
52 SYNC_MODE_NONE, ///< Do not wait for RenderSync
53 SYNC_MODE_WAIT ///< Wait for RenderSync
66 virtual ~RenderSurface();
71 * Initialize EGL, RenderSurface should create egl display and initialize
72 * @param egl implementation to use for the creation
74 virtual void InitializeEgl( EglInterface& egl ) = 0;
78 * @param egl implementation to use for the creation
80 virtual void CreateEglSurface( EglInterface& egl ) = 0;
83 * Destroyes EGL Surface
84 * @param egl implementation to use for the destruction
86 virtual void DestroyEglSurface( EglInterface& egl ) = 0;
89 * Replace the EGL Surface
90 * @param egl implementation to use for the creation
91 * @return true if context was lost
93 virtual bool ReplaceEGLSurface( EglInterface& egl ) = 0;
96 * Resizes the underlying surface.
97 * Only available for x window
99 virtual void MoveResize( Dali::PositionSize positionSize ) = 0;
103 * @param dpiHorizontal set to the horizontal dpi
104 * @param dpiVertical set to the vertical dpi
106 virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) const = 0;
109 * Call to map the surface (only works if surface is a window)
111 virtual void Map() = 0;
114 * Transfers the ownership of a display
115 * @param newSurface to transfer
117 virtual void TransferDisplayOwner( Internal::Adaptor::RenderSurface& newSurface ) = 0;
120 * Consumes any possible events on the queue so that there is no leaking between frames
122 virtual void ConsumeEvents() = 0;
125 * Set the stereoscopic 3D view mode
126 * @param[in] viewMode The new view mode
128 virtual void SetViewMode( ViewMode viewMode ) = 0;
131 * Called after offscreen is posted to onscreen
133 virtual void RenderSync() = 0;
136 * Invoked by render thread before Core::Render
137 * @param[in] egl The Egl interface
138 * @param[in] glAbstraction OpenGLES abstraction interface
139 * @return True if the operation is successful
141 virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction ) = 0;
144 * Invoked by render thread after Core::Render
145 * @param[in] egl The Egl interface
146 * @param[in] glAbstraction OpenGLES abstraction interface
147 * @param[in] deltaTime Time (in microseconds) since PostRender was last called.
148 * @param[in] syncMode Wait for render sync flag.
149 * RenderSync will be skipped if this or SetSyncMode() is set to SYNC_MODE_NONE.
151 virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, unsigned int deltaTime, SyncMode syncMode ) = 0;
154 * Invoked by render thread when the thread should be stop
156 virtual void StopRender() = 0;
159 * Set whether the surface should wait for RenderSync notifications
160 * @param[in] syncMode Wait for render sync flag. A member of SyncMode
162 virtual void SetSyncMode( SyncMode syncMode ) = 0;
165 } // namespace Adaptor
167 } // namespace internal
171 #endif // __DALI_INTERNAL_RENDER_SURFACE_H__