1 #ifndef __DALI_RENDER_SURFACE_H__
2 #define __DALI_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 * @addtogroup CAPI_DALI_ADAPTOR_MODULE
28 #include <dali/public-api/math/rect.h>
29 #include <dali/public-api/object/any.h>
31 namespace Dali DALI_IMPORT_API
35 * @brief The position and size of the render surface.
37 typedef Dali::Rect<int> PositionSize;
40 * @brief Interface for a render surface onto which Dali draws.
42 * Dali::Adaptor requires a render surface to draw on to. This is
43 * usually a window in the native windowing system, or some other
44 * mapped pixel buffer.
46 * Dali::Application will automatically create a render surface using a window.
48 * The implementation of the factory method below should choose an appropriate
49 * implementation of RenderSurface for the given platform
55 * @brief enumeration of surface types
59 NO_SURFACE, ///< not configured
62 NATIVE_BUFFER ///< Native Buffer
66 * @brief When application uses pixmap surface, it can select rendering mode.
68 * RENDER_SYNC : application should call RenderSync() after posting the offscreen to onscreen
69 * RENDER_#FPS : the maximum performance will be limited designated number of frame
83 * Application or Adaptor needs to create the appropriate concrete RenderSurface type.
84 * @see CreateDefaultSurface
89 * @brief Virtual Destructor.
91 virtual ~RenderSurface();
94 * @brief returns the surface type.
95 * @return the surface type
97 virtual SurfaceType GetType() = 0;
100 * @brief Returns the window or pixmap surface.
103 virtual Any GetSurface() = 0;
106 * @brief Returns the display.
109 virtual Any GetDisplay() = 0;
112 * @brief Return the size and position of the surface.
113 * @return The position and size
115 virtual PositionSize GetPositionSize() const = 0;
118 * @brief Set frame update rate for pixmap surface type
120 virtual void SetRenderMode(RenderMode mode) = 0;
123 * @brief Get current fps for pixmap surface type
124 * @return The render mode
126 virtual RenderMode GetRenderMode() const = 0;
131 * @brief Undefined copy constructor. RenderSurface cannot be copied
133 RenderSurface( const RenderSurface& rhs );
136 * @brief Undefined assignment operator. RenderSurface cannot be copied
138 RenderSurface& operator=( const RenderSurface& rhs );
143 * @brief Default surface factory function.
145 * A surface is created with the given type.
147 * @param [in] type the type of surface to create
148 * @param [in] positionSize the position and size of the surface to create
149 * @param [in] name optional name of surface passed in
150 * @return The render surface
152 RenderSurface* CreateDefaultSurface( RenderSurface::SurfaceType type, PositionSize positionSize, const std::string& name = "" );
159 #endif // __DALI_RENDER_SURFACE_H__