Merge branch 'devel/master' into tizen
[platform/core/uifw/dali-core.git] / dali / integration-api / profiling.cpp
1 /*
2  * Copyright (c) 2017 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/layer-impl.h>
30
31 #include <dali/internal/event/animation/animation-impl.h>
32 #include <dali/internal/event/animation/animator-connector.h>
33 #include <dali/internal/event/animation/constraint-impl.h>
34 #include <dali/internal/update/animation/property-accessor.h>
35 #include <dali/internal/update/animation/scene-graph-animation.h>
36 #include <dali/internal/update/animation/scene-graph-constraint.h>
37
38
39 #include <dali/internal/event/images/image-impl.h>
40
41 #include <dali/internal/event/resources/resource-ticket.h>
42 #include <dali/internal/event/resources/image-ticket.h>
43
44 #include <dali/internal/update/nodes/node.h>
45 #include <dali/internal/update/nodes/scene-graph-layer.h>
46
47 #include <dali/internal/update/rendering/scene-graph-renderer.h>
48 #include <dali/internal/update/resources/texture-metadata.h>
49
50 #include <dali/internal/render/gl-resources/bitmap-texture.h>
51 #include <dali/internal/render/renderers/render-geometry.h>
52 #include <dali/internal/render/renderers/render-property-buffer.h>
53 #include <dali/internal/render/renderers/render-renderer.h>
54 #include <dali/internal/render/renderers/render-sampler.h>
55 #include <dali/internal/update/render-tasks/scene-graph-camera.h>
56
57 using Dali::Internal::GestureEventProcessor;
58 using Dali::Internal::ThreadLocalStorage;
59
60 namespace Dali
61 {
62
63 namespace Integration
64 {
65
66 void EnableProfiling( ProfilingType type )
67 {
68   GestureEventProcessor& eventProcessor = ThreadLocalStorage::Get().GetGestureEventProcessor();
69
70   switch( type )
71   {
72     case PROFILING_TYPE_PAN_GESTURE:
73     {
74       eventProcessor.EnablePanGestureProfiling();
75       break;
76     }
77     case PROFILING_TYPE_END:
78     {
79       // nothing to do
80       break;
81     }
82   }
83 }
84
85 namespace Profiling
86 {
87
88 const int ANIMATION_MEMORY_SIZE(
89   sizeof( Internal::Animation ) +
90   sizeof( Internal::AnimatorConnector<float> ) +
91   sizeof( Internal::SceneGraph::Animation ) );
92 const int CONSTRAINT_MEMORY_SIZE(
93   sizeof( Internal::Constraint<float> ) +
94   sizeof( Internal::SceneGraph::Constraint<float, Internal::PropertyAccessor<float> > ) );
95 const int ACTOR_MEMORY_SIZE(
96   sizeof( Internal::Actor ) +
97   sizeof( Internal::SceneGraph::Node ) );
98 const int CAMERA_ACTOR_MEMORY_SIZE(
99   sizeof( Internal::CameraActor ) +
100   sizeof( Internal::SceneGraph::Node ) +
101   sizeof( Internal::SceneGraph::Camera ) );
102 const int LAYER_MEMORY_SIZE(
103   sizeof( Internal::Layer ) +
104   sizeof( Internal::SceneGraph::Layer ) );
105 const int IMAGE_MEMORY_SIZE(
106   sizeof( Internal::Image ) +
107   sizeof( Integration::Bitmap ) +
108   sizeof( Internal::TextureMetadata ) +
109   sizeof( Internal::BitmapTexture ) +
110   sizeof( Internal::ImageTicket ) );
111 const int RENDERER_MEMORY_SIZE(
112   sizeof( Internal::Renderer ) +
113   sizeof( Internal::SceneGraph::Renderer ) +
114   sizeof( Internal::Render::Renderer ) );
115 const int GEOMETRY_MEMORY_SIZE(
116   sizeof( Internal::Geometry ) +
117   sizeof( Internal::Render::Geometry) );
118 const int PROPERTY_BUFFER_MEMORY_SIZE(
119   sizeof( Internal::PropertyBuffer ) +
120   sizeof( Internal::Render::PropertyBuffer ) );
121 const int TEXTURE_SET_MEMORY_SIZE(
122   sizeof( Internal::TextureSet ) +
123   sizeof( Internal::SceneGraph::TextureSet ) );
124 const int SAMPLER_MEMORY_SIZE(
125   sizeof( Internal::Sampler ) +
126   sizeof( Internal::Render::Sampler ) );
127 const int SHADER_MEMORY_SIZE(
128   sizeof( Internal::Shader ) +
129   sizeof( Internal::SceneGraph::Shader ) );
130
131 } // namespace Profiling
132
133 } // namespace Integration
134
135 } // namespace Dali