Merge "Ability to build from different Style folders" into devel/master
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / atlas-manager / atlas-manager.cpp
1 /*
2  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 // CLASS HEADER
18 #include <dali-toolkit/internal/atlas-manager/atlas-manager.h>
19
20  // INTERNAL INCLUDES
21 #include <dali-toolkit/internal/atlas-manager/atlas-manager-impl.h>
22
23 namespace Dali
24 {
25
26 namespace Toolkit
27 {
28
29 AtlasManager::AtlasManager()
30 {
31 }
32
33 AtlasManager::~AtlasManager()
34 {
35 }
36
37 AtlasManager AtlasManager::New()
38 {
39   Internal::AtlasManagerPtr internal = Internal::AtlasManager::New();
40   return AtlasManager(internal.Get());
41 }
42
43 AtlasManager::AtlasManager(Internal::AtlasManager *impl)
44   : BaseHandle(impl)
45 {
46 }
47
48 AtlasManager::AtlasId AtlasManager::CreateAtlas( const AtlasManager::AtlasSize& size, Pixel::Format pixelformat )
49 {
50   return GetImplementation(*this).CreateAtlas( size, pixelformat );
51 }
52
53 void AtlasManager::SetAddPolicy( AddFailPolicy policy )
54 {
55   GetImplementation(*this).SetAddPolicy( policy );
56 }
57
58 void AtlasManager::Add( const BufferImage& image,
59                         AtlasManager::AtlasSlot& slot,
60                         AtlasManager::AtlasId atlas )
61 {
62   GetImplementation(*this).Add( image, slot, atlas );
63 }
64
65 bool AtlasManager::Remove( ImageId id )
66 {
67   return GetImplementation(*this).Remove( id );
68 }
69
70 void AtlasManager::GenerateMeshData( ImageId id,
71                                      const Vector2& position,
72                                      Mesh2D& mesh,
73                                      bool addReference )
74 {
75   GetImplementation(*this).GenerateMeshData( id,
76                                              position,
77                                              mesh,
78                                              addReference );
79 }
80
81 void AtlasManager::StitchMesh( Mesh2D& first,
82                                const Mesh2D& second,
83                                bool optimize )
84 {
85   GetImplementation(*this).StitchMesh( first, second, optimize );
86 }
87
88 Dali::Atlas AtlasManager::GetAtlasContainer( AtlasId atlas ) const
89 {
90   return GetImplementation(*this).GetAtlasContainer( atlas );
91 }
92
93 AtlasManager::AtlasId AtlasManager::GetAtlas( ImageId id )
94 {
95   return GetImplementation(*this).GetAtlas( id );
96 }
97
98 const AtlasManager::AtlasSize& AtlasManager::GetAtlasSize( AtlasId atlas )
99 {
100   return GetImplementation(*this).GetAtlasSize( atlas );
101 }
102
103 AtlasManager::SizeType AtlasManager::GetFreeBlocks( AtlasId atlas )
104 {
105   return GetImplementation(*this).GetFreeBlocks( atlas );
106 }
107
108 void AtlasManager::SetNewAtlasSize( const AtlasSize& size )
109 {
110   GetImplementation(*this).SetNewAtlasSize( size );
111 }
112
113 AtlasManager::SizeType AtlasManager::GetAtlasCount() const
114 {
115   return GetImplementation(*this).GetAtlasCount();
116 }
117
118 Pixel::Format AtlasManager::GetPixelFormat( AtlasId atlas )
119 {
120   return GetImplementation(*this).GetPixelFormat( atlas );
121 }
122
123 void AtlasManager::GetMetrics( Metrics& metrics )
124 {
125   GetImplementation(*this).GetMetrics( metrics );
126 }
127
128 Material AtlasManager::GetMaterial( AtlasId atlas ) const
129 {
130   return GetImplementation(*this).GetMaterial( atlas );
131 }
132
133 Sampler AtlasManager::GetSampler( AtlasId atlas ) const
134 {
135   return GetImplementation(*this).GetSampler( atlas );
136 }
137
138 } // namespace Toolkit
139
140 } // namespace Dali