03458cdd5a77a9d7a1dbd2aa43f764e07d9e59cf
[platform/core/uifw/dali-core.git] / dali / integration-api / profiling.cpp
1 /*
2  * Copyright (c) 2020 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/update/nodes/node.h>
40 #include <dali/internal/update/nodes/scene-graph-layer.h>
41
42 #include <dali/internal/update/rendering/scene-graph-renderer.h>
43
44 #include <dali/internal/render/renderers/render-geometry.h>
45 #include <dali/internal/render/renderers/render-vertex-buffer.h>
46 #include <dali/internal/render/renderers/render-renderer.h>
47 #include <dali/internal/render/renderers/render-sampler.h>
48 #include <dali/internal/update/render-tasks/scene-graph-camera.h>
49
50 using Dali::Internal::GestureEventProcessor;
51 using Dali::Internal::ThreadLocalStorage;
52
53 namespace Dali
54 {
55
56 namespace Integration
57 {
58
59 void EnableProfiling( ProfilingType type )
60 {
61   GestureEventProcessor& eventProcessor = ThreadLocalStorage::Get().GetGestureEventProcessor();
62
63   switch( type )
64   {
65     case PROFILING_TYPE_PAN_GESTURE:
66     {
67       eventProcessor.EnablePanGestureProfiling();
68       break;
69     }
70     case PROFILING_TYPE_END:
71     {
72       // nothing to do
73       break;
74     }
75   }
76 }
77
78 namespace Profiling
79 {
80
81 const std::size_t ANIMATION_MEMORY_SIZE(
82   sizeof( Internal::Animation ) +
83   sizeof( Internal::AnimatorConnector<float> ) +
84   sizeof( Internal::SceneGraph::Animation ) );
85 const std::size_t CONSTRAINT_MEMORY_SIZE(
86   sizeof( Internal::Constraint<float> ) +
87   sizeof( Internal::SceneGraph::Constraint<float, Internal::PropertyAccessor<float> > ) );
88 const std::size_t ACTOR_MEMORY_SIZE(
89   sizeof( Internal::Actor ) +
90   sizeof( Internal::SceneGraph::Node ) );
91 const std::size_t CAMERA_ACTOR_MEMORY_SIZE(
92   sizeof( Internal::CameraActor ) +
93   sizeof( Internal::SceneGraph::Node ) +
94   sizeof( Internal::SceneGraph::Camera ) );
95 const std::size_t LAYER_MEMORY_SIZE(
96   sizeof( Internal::Layer ) +
97   sizeof( Internal::SceneGraph::Layer ) );
98 const std::size_t RENDERER_MEMORY_SIZE(
99   sizeof( Internal::Renderer ) +
100   sizeof( Internal::SceneGraph::Renderer ) +
101   sizeof( Internal::Render::Renderer ) );
102 const std::size_t GEOMETRY_MEMORY_SIZE(
103   sizeof( Internal::Geometry ) +
104   sizeof( Internal::Render::Geometry) );
105 const std::size_t PROPERTY_BUFFER_MEMORY_SIZE(
106   sizeof( Internal::VertexBuffer ) +
107   sizeof( Internal::Render::VertexBuffer ) );
108 const std::size_t TEXTURE_SET_MEMORY_SIZE(
109   sizeof( Internal::TextureSet ) +
110   sizeof( Internal::SceneGraph::TextureSet ) );
111 const std::size_t SAMPLER_MEMORY_SIZE(
112   sizeof( Internal::Sampler ) +
113   sizeof( Internal::Render::Sampler ) );
114 const std::size_t SHADER_MEMORY_SIZE(
115   sizeof( Internal::Shader ) +
116   sizeof( Internal::SceneGraph::Shader ) );
117
118 } // namespace Profiling
119
120 } // namespace Integration
121
122 } // namespace Dali