Added metrics logging to TextAtlasRenderer
[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( SizeType width,
49                                                  SizeType height,
50                                                  SizeType blockWidth,
51                                                  SizeType blockHeight,
52                                                  Pixel::Format pixelformat )
53 {
54   return GetImplementation(*this).CreateAtlas( width, height, blockWidth, blockHeight, pixelformat );
55 }
56
57 void AtlasManager::SetAddPolicy( AddFailPolicy policy )
58 {
59   GetImplementation(*this).SetAddPolicy( policy );
60 }
61
62 void AtlasManager::Add( const BufferImage& image,
63                         AtlasManager::AtlasSlot& slot,
64                         AtlasManager::AtlasId atlas )
65 {
66   GetImplementation(*this).Add( image, slot, atlas );
67 }
68
69 bool AtlasManager::Remove( ImageId id )
70 {
71   return GetImplementation(*this).Remove( id );
72 }
73
74 void AtlasManager::GenerateMeshData( ImageId id,
75                                      const Vector2& position,
76                                      MeshData& meshData)
77 {
78   GetImplementation(*this).GenerateMeshData( id,
79                                              position,
80                                              meshData );
81 }
82
83 void AtlasManager::StitchMesh( MeshData& first,
84                                const MeshData& second,
85                                bool optimize )
86 {
87   GetImplementation(*this).StitchMesh( first, second, optimize );
88 }
89
90 void AtlasManager::StitchMesh( const MeshData& first,
91                                const MeshData& second,
92                                MeshData& out,
93                                bool optimize )
94 {
95   GetImplementation(*this).StitchMesh( first, second, out, optimize );
96 }
97
98 Dali::Atlas AtlasManager::GetAtlasContainer( AtlasId atlas ) const
99 {
100   return GetImplementation(*this).GetAtlasContainer( atlas );
101 }
102
103 AtlasManager::AtlasId AtlasManager::GetAtlas( ImageId id )
104 {
105   return GetImplementation(*this).GetAtlas( id );
106 }
107
108 Vector2 AtlasManager::GetBlockSize( AtlasId atlas )
109 {
110   return GetImplementation(*this).GetBlockSize( atlas );
111 }
112
113 Vector2 AtlasManager::GetAtlasSize( AtlasId atlas )
114 {
115   return GetImplementation(*this).GetAtlasSize( atlas );
116 }
117
118 AtlasManager::SizeType AtlasManager::GetFreeBlocks( AtlasId atlas )
119 {
120   return GetImplementation(*this).GetFreeBlocks( atlas );
121 }
122
123 void AtlasManager::SetNewAtlasSize( const Vector2& size,
124                                     const Vector2& blockSize )
125 {
126   GetImplementation(*this).SetNewAtlasSize( size, blockSize );
127 }
128
129 AtlasManager::SizeType AtlasManager::GetAtlasCount() const
130 {
131   return GetImplementation(*this).GetAtlasCount();
132 }
133
134 Pixel::Format AtlasManager::GetPixelFormat( AtlasId atlas )
135 {
136   return GetImplementation(*this).GetPixelFormat( atlas );
137 }
138
139 void AtlasManager::GetMetrics( Metrics& metrics )
140 {
141   return GetImplementation(*this).GetMetrics( metrics );
142 }
143
144 } // namespace Toolkit
145
146 } // namespace Dali