1 #ifndef __DALI_RENDER_SURFACE_H__
2 #define __DALI_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 * @addtogroup CAPI_DALI_ADAPTOR_MODULE
27 #include <dali/public-api/math/rect.h>
28 #include <dali/public-api/object/any.h>
30 namespace Dali DALI_IMPORT_API
34 * @brief The position and size of the render surface.
36 typedef Dali::Rect<int> PositionSize;
39 * @brief Interface for a render surface onto which Dali draws.
41 * Dali::Adaptor requires a render surface to draw on to. This is
42 * usually a window in the native windowing system, or some other
43 * mapped pixel buffer.
45 * Dali::Application will automatically create a render surface using a window.
47 * The implementation of the factory method below should choose an appropriate
48 * implementation of RenderSurface for the given platform
54 * @brief enumeration of surface types
58 NO_SURFACE, ///< not configured
61 NATIVE_BUFFER ///< Native Buffer
65 * @brief When application uses pixmap surface, it can select rendering mode.
67 * RENDER_SYNC : application should call RenderSync() after posting the offscreen to onscreen
68 * RENDER_#FPS : the maximum performance will be limited designated number of frame
82 * Application or Adaptor needs to create the appropriate concrete RenderSurface type.
83 * @see CreateDefaultSurface
88 * @brief Virtual Destructor.
90 virtual ~RenderSurface();
93 * @brief returns the surface type.
94 * @return the surface type
96 virtual SurfaceType GetType() = 0;
99 * @brief Returns the window or pixmap surface.
102 virtual Any GetSurface() = 0;
105 * @brief Returns the display.
108 virtual Any GetDisplay() = 0;
111 * @brief Return the size and position of the surface.
112 * @return The position and size
114 virtual PositionSize GetPositionSize() const = 0;
117 * @brief Set frame update rate for pixmap surface type
119 virtual void SetRenderMode(RenderMode mode) = 0;
122 * @brief Get current fps for pixmap surface type
123 * @return The render mode
125 virtual RenderMode GetRenderMode() const = 0;
130 * @brief Undefined copy constructor. RenderSurface cannot be copied
132 RenderSurface( const RenderSurface& rhs );
135 * @brief Undefined assignment operator. RenderSurface cannot be copied
137 RenderSurface& operator=( const RenderSurface& rhs );
142 * @brief Default surface factory function.
144 * A surface is created with the given type.
146 * @param [in] type the type of surface to create
147 * @param [in] positionSize the position and size of the surface to create
148 * @param [in] name optional name of surface passed in
149 * @return The render surface
151 RenderSurface* CreateDefaultSurface( RenderSurface::SurfaceType type, PositionSize positionSize, const std::string& name = "" );
158 #endif // __DALI_RENDER_SURFACE_H__