1 #ifndef __DALI_NATIVE_RENDER_SURFACE_H__
2 #define __DALI_NATIVE_RENDER_SURFACE_H__
5 * Copyright (c) 2014 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.
22 #include <tbm_surface.h>
23 #include <dali/public-api/common/dali-common.h>
26 #ifdef DALI_ADAPTOR_COMPILATION
27 #include <render-surface.h>
28 #include <egl-interface.h>
30 #include <dali/devel-api/adaptor-framework/render-surface.h>
31 #include <dali/integration-api/adaptors/egl-interface.h>
37 class TriggerEventInterface;
40 * Ecore X11 implementation of render surface.
42 class DALI_IMPORT_API NativeRenderSurface : public Dali::RenderSurface
47 * Uses an Wayland surface to render to.
48 * @param [in] positionSize the position and size of the surface
49 * @param [in] name optional name of surface passed in
50 * @param [in] isTransparent if it is true, surface has 32 bit color depth, otherwise, 24 bit
52 NativeRenderSurface( Dali::PositionSize positionSize,
53 const std::string& name,
54 bool isTransparent = false );
57 * @copydoc Dali::RenderSurface::~RenderSurface
59 virtual ~NativeRenderSurface();
64 * @brief Sets the render notification trigger to call when render thread is completed a frame
66 * @param renderNotification to use
68 void SetRenderNotification( TriggerEventInterface* renderNotification );
71 * @brief Gets the tbm surface for offscreen rendering
73 virtual tbm_surface_h GetDrawable();
76 * @brief Get the surface
80 virtual Any GetSurface();
82 public: // from Dali::RenderSurface
85 * @copydoc Dali::RenderSurface::GetPositionSize()
87 virtual PositionSize GetPositionSize() const;
90 * @copydoc Dali::RenderSurface::InitializeEgl()
92 virtual void InitializeEgl( EglInterface& egl );
95 * @copydoc Dali::RenderSurface::CreateEglSurface()
97 virtual void CreateEglSurface( EglInterface& egl );
100 * @copydoc Dali::RenderSurface::DestroyEglSurface()
102 virtual void DestroyEglSurface( EglInterface& egl );
105 * @copydoc Dali::RenderSurface::ReplaceEGLSurface()
107 virtual bool ReplaceEGLSurface( EglInterface& egl );
110 * @copydoc Dali::RenderSurface::MoveResize()
112 virtual void MoveResize( Dali::PositionSize positionSize);
115 * @copydoc Dali::RenderSurface::SetViewMode()
117 void SetViewMode( ViewMode viewMode );
120 * @copydoc Dali::RenderSurface::StartRender()
122 virtual void StartRender();
125 * @copydoc Dali::RenderSurface::PreRender()
127 virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction );
130 * @copydoc Dali::RenderSurface::PostRender()
132 virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface );
135 * @copydoc Dali::RenderSurface::StopRender()
137 virtual void StopRender();
140 * @copydoc Dali::RenderSurface::SetThreadSynchronization
142 virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization );
145 * @copydoc Dali::RenderSurface::GetSurfaceType()
147 virtual RenderSurface::Type GetSurfaceType();
159 virtual void CreateNativeRenderable();
171 #endif // __DALI_NATIVE_RENDER_SURFACE_H__