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