Merge "Merge branch 'devel/new_mesh' into devel/master" into devel/master
[platform/core/uifw/dali-core.git] / dali / integration-api / profiling.cpp
1 /*
2  * Copyright (c) 2014 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
18 // CLASS HEADER
19 #include <dali/integration-api/profiling.h>
20
21 // INTERNAL INCLUDES
22 #include <dali/integration-api/bitmap.h>
23
24 #include <dali/internal/event/common/thread-local-storage.h>
25 #include <dali/internal/event/events/gesture-event-processor.h>
26
27 #include <dali/internal/event/actors/actor-impl.h>
28 #include <dali/internal/event/actors/camera-actor-impl.h>
29 #include <dali/internal/event/actors/image-actor-impl.h>
30 #include <dali/internal/event/actors/layer-impl.h>
31
32 #include <dali/internal/event/actor-attachments/actor-attachment-impl.h>
33 #include <dali/internal/event/actor-attachments/camera-attachment-impl.h>
34 #include <dali/internal/event/actor-attachments/image-attachment-impl.h>
35 #include <dali/internal/event/actor-attachments/renderer-attachment-impl.h>
36
37 #include <dali/internal/event/animation/animation-impl.h>
38 #include <dali/internal/event/animation/animator-connector.h>
39 #include <dali/internal/event/animation/constraint-impl.h>
40 #include <dali/internal/update/animation/property-accessor.h>
41 #include <dali/internal/update/animation/scene-graph-animation.h>
42 #include <dali/internal/update/animation/scene-graph-constraint.h>
43
44
45 #include <dali/internal/event/images/image-impl.h>
46 #include <dali/internal/event/images/image-factory-cache.h>
47
48 #include <dali/internal/event/resources/resource-ticket.h>
49 #include <dali/internal/event/resources/image-ticket.h>
50
51 #include <dali/internal/update/nodes/node.h>
52 #include <dali/internal/update/nodes/scene-graph-layer.h>
53
54 #include <dali/internal/update/node-attachments/node-attachment.h>
55 #include <dali/internal/update/node-attachments/scene-graph-camera-attachment.h>
56 #include <dali/internal/update/node-attachments/scene-graph-image-attachment.h>
57 #include <dali/internal/update/node-attachments/scene-graph-renderer-attachment.h>
58
59 #include <dali/internal/update/resources/bitmap-metadata.h>
60
61 #include <dali/internal/render/gl-resources/bitmap-texture.h>
62 #include <dali/internal/render/renderers/scene-graph-image-renderer.h>
63 #include <dali/internal/render/renderers/render-renderer.h>
64
65 using Dali::Internal::GestureEventProcessor;
66 using Dali::Internal::ThreadLocalStorage;
67
68 namespace Dali
69 {
70
71 namespace Integration
72 {
73
74 void EnableProfiling( ProfilingType type )
75 {
76   GestureEventProcessor& eventProcessor = ThreadLocalStorage::Get().GetGestureEventProcessor();
77
78   switch( type )
79   {
80     case PROFILING_TYPE_PAN_GESTURE:
81     {
82       eventProcessor.EnablePanGestureProfiling();
83       break;
84     }
85     case PROFILING_TYPE_END:
86     {
87       // nothing to do
88       break;
89     }
90   }
91 }
92
93 namespace Profiling
94 {
95
96 const int ANIMATION_MEMORY_SIZE(
97   sizeof( Internal::Animation ) +
98   sizeof( Internal::AnimatorConnector<float> ) +
99   sizeof( Internal::SceneGraph::Animation ) );
100 const int CONSTRAINT_MEMORY_SIZE(
101   sizeof( Internal::Constraint<float> ) +
102   sizeof( Internal::SceneGraph::Constraint<float, Internal::PropertyAccessor<float> > ) );
103 const int ACTOR_MEMORY_SIZE(
104   sizeof( Internal::Actor ) +
105   sizeof( Internal::ActorAttachment ) +
106   sizeof( Internal::SceneGraph::Node ) +
107   sizeof( Internal::SceneGraph::NodeAttachment ));
108 const int CAMERA_ACTOR_MEMORY_SIZE(
109   sizeof( Internal::CameraActor ) +
110   sizeof( Internal::CameraAttachment ) +
111   sizeof( Internal::SceneGraph::Node ) +
112   sizeof( Internal::SceneGraph::CameraAttachment ) );
113 const int IMAGE_ACTOR_MEMORY_SIZE(
114   sizeof( Internal::ImageActor ) +
115   sizeof( Internal::ImageAttachment ) +
116   sizeof( Internal::SceneGraph::Node ) +
117   sizeof( Internal::SceneGraph::ImageAttachment ) +
118   sizeof( Internal::SceneGraph::ImageRenderer ));
119 const int LAYER_MEMORY_SIZE(
120   sizeof( Internal::Layer ) +
121   sizeof( Internal::ActorAttachment ) +
122   sizeof( Internal::SceneGraph::Layer ) +
123   sizeof( Internal::SceneGraph::NodeAttachment ) );
124 const int IMAGE_MEMORY_SIZE(
125   sizeof( Internal::Image ) +
126   sizeof( Internal::ImageFactoryCache::Request ) +
127   sizeof( Integration::Bitmap ) +
128   sizeof( Internal::BitmapMetadata ) +
129   sizeof( Internal::BitmapTexture ) +
130   sizeof( Internal::ImageTicket ) );
131 const int RENDERER_MEMORY_SIZE(
132   sizeof( Internal::Renderer ) +
133   sizeof( Internal::RendererAttachment ) +
134   sizeof( Internal::SceneGraph::RendererAttachment ) +
135   sizeof( Internal::SceneGraph::Renderer ) +
136   sizeof( Internal::SceneGraph::NewRenderer ) );
137 const int GEOMETRY_MEMORY_SIZE(
138   sizeof( Internal::Geometry ) +
139   sizeof( Internal::SceneGraph::Geometry ) );
140 const int PROPERTY_BUFFER_MEMORY_SIZE(
141   sizeof( Internal::PropertyBuffer ) +
142   sizeof( Internal::SceneGraph::PropertyBuffer ) );
143 const int MATERIAL_MEMORY_SIZE(
144   sizeof( Internal::Material ) +
145   sizeof( Internal::SceneGraph::Material ) );
146 const int SAMPLER_MEMORY_SIZE(
147   sizeof( Internal::Sampler ) +
148   sizeof( Internal::SceneGraph::Sampler ) );
149 const int SHADER_MEMORY_SIZE(
150   sizeof( Internal::Shader ) +
151   sizeof( Internal::SceneGraph::Shader ) );
152
153 } // namespace Profiling
154
155 } // namespace Integration
156
157 } // namespace Dali