Removed Meshes and Model loading
[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/text-actor-impl.h>
30 #include <dali/internal/event/actors/image-actor-impl.h>
31 #include <dali/internal/event/actors/layer-impl.h>
32
33 #include <dali/internal/event/actor-attachments/actor-attachment-impl.h>
34 #include <dali/internal/event/actor-attachments/camera-attachment-impl.h>
35 #include <dali/internal/event/actor-attachments/text-attachment-impl.h>
36 #include <dali/internal/event/actor-attachments/image-attachment-impl.h>
37
38 #include <dali/internal/event/animation/animation-impl.h>
39 #include <dali/internal/event/animation/animator-connector.h>
40 #include <dali/internal/event/animation/constraint-impl.h>
41 #include <dali/internal/event/animation/active-constraint-impl.h>
42 #include <dali/internal/update/animation/property-accessor.h>
43 #include <dali/internal/update/animation/scene-graph-animation.h>
44 #include <dali/internal/update/animation/scene-graph-constraint.h>
45
46
47 #include <dali/internal/event/images/image-impl.h>
48 #include <dali/internal/event/images/image-factory-cache.h>
49 #include <dali/internal/common/text-parameters.h>
50
51 #include <dali/internal/event/resources/resource-ticket.h>
52 #include <dali/internal/event/resources/image-ticket.h>
53
54 #include <dali/internal/update/nodes/node.h>
55 #include <dali/internal/update/nodes/scene-graph-layer.h>
56
57 #include <dali/internal/update/node-attachments/node-attachment.h>
58 #include <dali/internal/update/node-attachments/scene-graph-camera-attachment.h>
59 #include <dali/internal/update/node-attachments/scene-graph-image-attachment.h>
60 #include <dali/internal/update/node-attachments/scene-graph-text-attachment.h>
61
62 #include <dali/internal/update/resources/bitmap-metadata.h>
63
64 #include <dali/internal/render/gl-resources/bitmap-texture.h>
65 #include <dali/internal/render/renderers/scene-graph-image-renderer.h>
66 #include <dali/internal/render/renderers/scene-graph-text-renderer.h>
67
68 using Dali::Internal::GestureEventProcessor;
69 using Dali::Internal::ThreadLocalStorage;
70
71 namespace Dali
72 {
73
74 namespace Integration
75 {
76
77 void EnableProfiling( ProfilingType type )
78 {
79   GestureEventProcessor& eventProcessor = ThreadLocalStorage::Get().GetGestureEventProcessor();
80
81   switch( type )
82   {
83     case PROFILING_TYPE_PAN_GESTURE:
84     {
85       eventProcessor.EnablePanGestureProfiling();
86     }
87
88     default:
89     {
90       // Do nothing
91       break;
92     }
93   }
94 }
95
96 namespace Profiling
97 {
98
99 const int ANIMATION_MEMORY_SIZE(
100   sizeof( Internal::Animation ) +
101   sizeof( Internal::AnimatorConnector<float> ) +
102   sizeof( Internal::SceneGraph::Animation ) );
103 const int CONSTRAINT_MEMORY_SIZE(
104   sizeof( Internal::Constraint ) +
105   sizeof( Internal::SceneGraph::Constraint<float, Internal::PropertyAccessor<float> > ) +
106   sizeof( Internal::ActiveConstraint<float> ) );
107 const int ACTOR_MEMORY_SIZE(
108   sizeof( Internal::Actor ) +
109   sizeof( Internal::ActorAttachment ) +
110   sizeof( Internal::SceneGraph::Node ) +
111   sizeof( Internal::SceneGraph::NodeAttachment ));
112 const int CAMERA_ACTOR_MEMORY_SIZE(
113   sizeof( Internal::CameraActor ) +
114   sizeof( Internal::CameraAttachment ) +
115   sizeof( Internal::SceneGraph::Node ) +
116   sizeof( Internal::SceneGraph::CameraAttachment ) );
117 const int TEXT_ACTOR_MEMORY_SIZE(
118   sizeof( Internal::TextActor ) +
119   sizeof( Internal::TextAttachment ) +
120   sizeof( Internal::SceneGraph::Node ) +
121   sizeof( Internal::SceneGraph::TextAttachment ) +
122   sizeof( Internal::TextParameters ) +
123   sizeof( Internal::SceneGraph::TextRenderer ) );
124 const int IMAGE_ACTOR_MEMORY_SIZE(
125   sizeof( Internal::ImageActor ) +
126   sizeof( Internal::ImageAttachment ) +
127   sizeof( Internal::SceneGraph::Node ) +
128   sizeof( Internal::SceneGraph::ImageAttachment ) +
129   sizeof( Internal::SceneGraph::ImageRenderer ));
130 const int LAYER_MEMORY_SIZE(
131   sizeof( Internal::Layer ) +
132   sizeof( Internal::ActorAttachment ) +
133   sizeof( Internal::SceneGraph::Layer ) +
134   sizeof( Internal::SceneGraph::NodeAttachment ) );
135 const int IMAGE_MEMORY_SIZE(
136   sizeof( Internal::Image ) +
137   sizeof( Internal::ImageFactoryCache::Request ) +
138   sizeof( Integration::Bitmap ) +
139   sizeof( Internal::BitmapMetadata ) +
140   sizeof( Internal::BitmapTexture ) +
141   sizeof( Internal::ImageTicket ) );
142
143 } // namespace Profiling
144
145 } // namespace Integration
146
147 } // namespace Dali