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