1 #ifndef __DALI_INTERNAL_RENDER_HELPER_H__
2 #define __DALI_INTERNAL_RENDER_HELPER_H__
5 * Copyright (c) 2017 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 <egl-interface.h>
23 #include <render-surface.h> // needed for Dali::RenderSurface
29 class DisplayConnection;
41 class AdaptorInternalServices;
42 class EglFactoryInterface;
45 * Helper class for EGL, surface, pre & post rendering
52 * Create a RenderHelper.
53 * @param[in] adaptorInterfaces base adaptor interface
55 RenderHelper( AdaptorInternalServices& adaptorInterfaces );
58 * Non-virtual Destructor
62 /////////////////////////////////////////////////////////////////////////////////////////////////
63 // Called on the Event Thread
64 /////////////////////////////////////////////////////////////////////////////////////////////////
67 * Sets up all render related objects to start rendering.
72 * Sets up all render related objects to stop rendering.
76 /////////////////////////////////////////////////////////////////////////////////////////////////
77 // Called on the Rendering Thread
78 /////////////////////////////////////////////////////////////////////////////////////////////////
81 * Consumes any pending events to avoid memory leaks
83 * @note Called from rendering thread
90 * @note Called from rendering thread
95 * Replaces the rendering surface
97 * Used for replacing pixmaps due to resizing
98 * @param newSurface to use
100 * @note Called from render thread
102 void ReplaceSurface( RenderSurface* newSurface );
105 * Resize the rendering surface.
107 * @note Called from render thread
109 void ResizeSurface();
114 * @note Called from render thread
119 * Called before core renders the scene
121 * @return true if successful and Core::Render should be called.
123 * @note Called from render thread
128 * Called after core has rendered the scene
130 * @note Called from render thread
137 RenderHelper( const RenderHelper& RenderHelper );
140 RenderHelper& operator=( const RenderHelper& RenderHelper );
144 Integration::GlAbstraction& mGLES; ///< GL abstraction reference
145 EglFactoryInterface* mEglFactory; ///< Factory class to create EGL implementation
146 EglInterface* mEGL; ///< Interface to EGL implementation
147 RenderSurface* mSurface; ///< Current surface
148 Dali::DisplayConnection* mDisplayConnection; ///< Display connection
149 bool mSurfaceReplaced; ///< True when new surface has been initialized.
150 bool mSurfaceResized; ///< True when the surface is resized.
153 } // namespace Adaptor
155 } // namespace Internal
159 #endif // __DALI_INTERNAL_RENDER_HELPER_H__