Add Post Constraint that works after transform
[platform/core/uifw/dali-core.git] / dali / graphics-api / graphics-render-target-create-info.h
1 #ifndef DALI_GRAPHICS_RENDER_TARGET_CREATE_INFO
2 #define DALI_GRAPHICS_RENDER_TARGET_CREATE_INFO
3
4 /*
5  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <memory>
23
24 // INTERNAL INCLUDES
25 #include "graphics-render-target.h"
26 #include "graphics-types.h"
27
28 namespace Dali
29 {
30 namespace Graphics
31 {
32 /**
33  * @brief Describes specification of new render target.
34  *
35  * RenderTarget represents any presentable graphics output.
36  */
37 struct RenderTargetCreateInfo
38 {
39   /**
40    * @brief Sets pointer to the extension
41    *
42    * The pointer to the extension must be set either to nullptr
43    * or to the valid structure. The structures may create
44    * a chain. The last structure in a chain must point at
45    * nullptr.
46    *
47    * @param[in] value pointer to the valid extension structure
48    * @return reference to this structure
49    */
50   auto& SetNextExtension(ExtensionCreateInfo* value)
51   {
52     nextExtension = value;
53     return *this;
54   }
55
56   /**
57    * @brief Sets surface associated with the RenderTarget
58    *
59    * The surface is a a pointer to any native surface object.
60    *
61    * @param[in] value Pointer to the native surface
62    * @return reference to this structure
63    */
64   auto& SetSurface( Surface* value )
65   {
66     surface = value;
67     return *this;
68   }
69
70   /**
71    * @brief Sets framebuffer associated with the RenderTarget
72    *
73    * The framebuffer and surface must not be set together.
74    *
75    * @param[in] value Pointer to the Framebuffer object
76    * @return reference to this structure
77    */
78   auto& SetFramebuffer( Framebuffer* value )
79   {
80     framebuffer = value;
81     return *this;
82   }
83
84   /**
85    * @brief Sets render target size
86    *
87    * @param[in] value Size of render target
88    * @return reference to this structure
89    */
90   auto& SetExtent( Extent2D value )
91   {
92     extent = value;
93     return *this;
94   }
95
96   /**
97    * @brief Sets pre-transform of the render target
98    *
99    * @param[in] value transform flags
100    * @return reference to this structure
101    */
102   auto& SetPreTransform( RenderTargetTransformFlags value )
103   {
104     preTransform = value;
105     return *this;
106   }
107
108   /**
109    * @brief Sets allocation callbacks which will be used when object is created
110    * and destroyed.
111    *
112    * @param[in] value Valid reference to AllocationCallbacksStructure
113    * @return reference to this structure
114    */
115   auto& SetAllocationCallbacks(const AllocationCallbacks& value)
116   {
117     allocationCallbacks = &value;
118     return *this;
119   }
120
121   GraphicsStructureType         type{GraphicsStructureType::RENDER_TARGET_CREATE_INFO_STRUCT};
122   Surface*                      surface{nullptr};
123   Framebuffer*                  framebuffer{nullptr};
124   Extent2D                      extent{};
125   RenderTargetTransformFlags    preTransform{0u};
126   ExtensionCreateInfo*          nextExtension{nullptr};
127
128   const AllocationCallbacks* allocationCallbacks{nullptr};
129 };
130
131 } // namespace Graphics
132 } // namespace Dali
133 #endif //DALI_GRAPHICS_RENDER_TARGET_CREATE_INFO