1 #ifndef __DALI_INTERNAL_NATIVE_BUFFER_RENDER_SURFACE_H__
2 #define __DALI_INTERNAL_NATIVE_BUFFER_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 <native-buffer-pool.h>
23 #include <dali/public-api/common/vector-wrapper.h>
26 #include <ecore-x-render-surface.h>
43 * NativeBuffer API compatible implementation of RenderSurface.
45 class NativeBufferRenderSurface : public RenderSurface
52 NativeBufferRenderSurface( native_buffer_provider* provider,
53 native_buffer_pool* pool,
54 unsigned int maxBufferCount,
55 Dali::PositionSize positionSize,
58 const std::string& name,
64 virtual ~NativeBufferRenderSurface();
69 * @copydoc Dali::Internal::Adaptor::ECore::RenderSurface::GetDrawable()
71 virtual Ecore_X_Drawable GetDrawable();
73 public: // from Dali::RenderSurface
76 * @copydoc Dali::RenderSurface::GetType()
78 virtual Dali::RenderSurface::SurfaceType GetType();
81 * @copydoc Dali::RenderSurface::GetSurface()
83 virtual Any GetSurface();
85 public: // from Internal::Adaptor::RenderSurface
87 /// @copydoc Dali::Internal::Adaptor::RenderSurface::InitializeEgl
88 virtual void InitializeEgl( EglInterface& egl );
90 /// @copydoc Dali::Internal::Adaptor::RenderSurface::CreateEglSurface
91 virtual void CreateEglSurface( EglInterface& egl );
93 /// @copydoc Dali::Internal::Adaptor::RenderSurface::DestroyEglSurface
94 virtual void DestroyEglSurface( EglInterface& egl );
96 /// @copydoc Dali::Internal::Adaptor::RenderSurface::ReplaceEGLSurface
97 virtual bool ReplaceEGLSurface( EglInterface& egl );
99 /// @copydoc Dali::RenderSurface::PreRender
100 virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction );
102 /// @copydoc Dali::RenderSurface::PostRender
103 virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, unsigned int timeDelta, SyncMode syncMode );
110 virtual void CreateXRenderable();
113 * @copydoc Dali::Internal::Adaptor::ECore::RenderSurface::UseExistingRenderable
115 virtual void UseExistingRenderable( unsigned int surfaceId );
119 * Create native buffer
121 native_buffer* CreateNativeBuffer();
124 native_buffer_provider* mProvider;
125 native_buffer_pool* mPool;
127 typedef std::vector<native_buffer*> NativeBufferContainer;
128 NativeBufferContainer mBuffers;
130 unsigned int mMaxBufferCount;
132 }; // class NativeBufferRenderSurface
136 } // namespace Adaptor
138 } // namespace internal
142 #endif // __DALI_INTERNAL_NATIVE_BUFFER_RENDER_SURFACE_H__