Add post processor
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / visuals / rendering-addon.h
1 #ifndef DALI_RENDERING_ADDON_H
2 #define DALI_RENDERING_ADDON_H
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 #include <dali-toolkit/internal/visuals/npatch/npatch-visual.h>
22 #include <dali/devel-api/common/addon-binder.h>
23
24 namespace Dali
25 {
26 namespace Toolkit
27 {
28 namespace Internal
29 {
30 /**
31  * Interface of Overdrawing AddOn
32  */
33 class RenderingAddOn : public Dali::AddOn::AddOnBinder
34 {
35   using TextureManager = Dali::Toolkit::Internal::TextureManager;
36
37 public:
38   RenderingAddOn()
39   : Dali::AddOn::AddOnBinder("oo-rendering", 0u)
40   {
41   }
42
43   // Bind AddOn functions
44   ADDON_BIND_FUNCTION(
45     GetGeometry,
46     Dali::Geometry(TextureManager::TextureId, uint32_t&, uint32_t&));
47
48   ADDON_BIND_FUNCTION(
49     CreateGeometry,
50     Dali::Geometry(TextureManager::TextureId, const Dali::Devel::PixelBuffer& pixelBuffer));
51
52   ADDON_BIND_FUNCTION(
53     Initialize,
54     void*());
55
56   ADDON_BIND_FUNCTION(
57     CreateGeometryGrid,
58     Dali::Geometry(const void*, const Uint16Pair&, uint32_t*));
59
60   ADDON_BIND_FUNCTION(
61     SubmitRenderTask,
62     void(Renderer&, const void*));
63
64   ADDON_BIND_FUNCTION(
65     BuildNPatch,
66     void*(const Devel::PixelBuffer&, void*));
67
68   ADDON_BIND_FUNCTION(
69     DestroyNPatch,
70     void(void*));
71
72   /**
73    * Single instance of the addon
74    * @return
75    */
76   static RenderingAddOn& Get()
77   {
78     static RenderingAddOn* addon = nullptr;
79     if(!addon)
80     {
81       addon = new RenderingAddOn();
82       if(addon->IsValid())
83       {
84         addon->Initialize();
85       }
86     }
87     return *addon;
88   }
89 };
90
91 } // namespace Internal
92 } // namespace Toolkit
93 } // namespace Dali
94
95 #endif //DALI_CMAKE_RENDERING_ADDON_H