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 <dali/integration-api/egl-interface.h>
23 #include <dali/integration-api/render-surface.h>
29 class DisplayConnection;
45 class AdaptorInternalServices;
46 class EglFactoryInterface;
49 * Helper class for EGL, surface, pre & post rendering
56 * Create a RenderHelper.
57 * @param[in] adaptorInterfaces base adaptor interface
59 RenderHelper( AdaptorInternalServices& adaptorInterfaces );
62 * Non-virtual Destructor
66 /////////////////////////////////////////////////////////////////////////////////////////////////
67 // Called on the Event Thread
68 /////////////////////////////////////////////////////////////////////////////////////////////////
71 * Sets up all render related objects to start rendering.
76 * Sets up all render related objects to stop rendering.
80 /////////////////////////////////////////////////////////////////////////////////////////////////
81 // Called on the Rendering Thread
82 /////////////////////////////////////////////////////////////////////////////////////////////////
85 * Consumes any pending events to avoid memory leaks
87 * @note Called from rendering thread
94 * @note Called from rendering thread
99 * Replaces the rendering surface
101 * Used for replacing pixmaps due to resizing
102 * @param newSurface to use
104 * @note Called from render thread
106 void ReplaceSurface( RenderSurface* newSurface );
109 * Resize the rendering surface.
111 * @note Called from render thread
113 void ResizeSurface();
118 * @note Called from render thread
123 * Called before core renders the scene
125 * @return true if successful and Core::Render should be called.
127 * @note Called from render thread
132 * Called after core has rendered the scene
134 * @note Called from render thread
136 * @param[in] renderToFbo Whether to render to a Frame Buffer Object.
138 void PostRender( bool renderToFbo );
143 RenderHelper( const RenderHelper& RenderHelper );
146 RenderHelper& operator=( const RenderHelper& RenderHelper );
150 Integration::GlAbstraction& mGLES; ///< GL abstraction reference
151 EglFactoryInterface* mEglFactory; ///< Factory class to create EGL implementation
152 EglInterface* mEGL; ///< Interface to EGL implementation
153 RenderSurface* mSurface; ///< Current surface
154 Dali::DisplayConnection* mDisplayConnection; ///< Display connection
155 Integration::Graphics::Graphics& mGraphics;
156 bool mSurfaceReplaced; ///< True when new surface has been initialized.
157 bool mSurfaceResized; ///< True when the surface is resized.
160 } // namespace Adaptor
162 } // namespace Internal
166 #endif // DALI_INTERNAL_RENDER_HELPER_H