Skip to content

Commit eb5febc

Browse files
committed
More fixes
1 parent 0af9eb9 commit eb5febc

3 files changed

Lines changed: 20 additions & 20 deletions

File tree

modules/yup_gui/profiling/yup_PaintProfiler.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,7 @@ void PaintProfiler::deregisterComponent (const Component& component)
102102

103103
void PaintProfiler::enableSubtree (Component& root, PaintProfileOptions options)
104104
{
105-
#if YUP_ENABLE_COMPONENT_PAINT_PROFILING
106105
root.setPaintProfilingEnabled (true, options);
107-
#endif
108106

109107
for (int i = 0; i < root.getNumChildComponents(); ++i)
110108
{
@@ -115,9 +113,7 @@ void PaintProfiler::enableSubtree (Component& root, PaintProfileOptions options)
115113

116114
void PaintProfiler::disableSubtree (Component& root)
117115
{
118-
#if YUP_ENABLE_COMPONENT_PAINT_PROFILING
119116
root.setPaintProfilingEnabled (false);
120-
#endif
121117

122118
for (int i = 0; i < root.getNumChildComponents(); ++i)
123119
{
@@ -186,11 +182,7 @@ PaintProfiler::Snapshot PaintProfiler::createSnapshot (PaintProfileTimeKind sort
186182
{
187183
ComponentEntry entry;
188184
entry.component = component;
189-
#if YUP_ENABLE_COMPONENT_PAINT_PROFILING
190185
entry.name = component->getPaintProfileName();
191-
#else
192-
entry.name = component->getTitle();
193-
#endif
194186
entry.stats = stats;
195187
entry.self = stats->summarize (PaintProfileTimeKind::self);
196188
entry.children = stats->summarize (PaintProfileTimeKind::children);
@@ -283,13 +275,11 @@ PaintProfiler::ScopedSession::ScopedSession (PaintProfiler& profilerRef,
283275

284276
PaintProfiler::ScopedSession::~ScopedSession()
285277
{
286-
#if YUP_ENABLE_COMPONENT_PAINT_PROFILING
287278
for (auto& weakComponent : enabledComponents)
288279
{
289280
if (auto* component = weakComponent.get())
290281
component->setPaintProfilingEnabled (false);
291282
}
292-
#endif
293283
}
294284

295285
//==============================================================================

modules/yup_gui/yup_gui.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,13 @@
125125

126126
//==============================================================================
127127

128+
#if YUP_ENABLE_COMPONENT_PAINT_PROFILING
129+
#include "profiling/yup_PaintProfileStats.cpp"
130+
#include "profiling/yup_PaintProfiler.cpp"
131+
#endif
132+
133+
//==============================================================================
134+
128135
#include "application/yup_Application.cpp"
129136
#include "desktop/yup_Desktop.cpp"
130137
#include "keyboard/yup_TextInputTarget.cpp"
@@ -133,8 +140,6 @@
133140
#include "clipboard/yup_SystemClipboard.cpp"
134141
#include "component/yup_ComponentNative.cpp"
135142
#include "component/yup_Component.cpp"
136-
#include "profiling/yup_PaintProfileStats.cpp"
137-
#include "profiling/yup_PaintProfiler.cpp"
138143
#include "menus/yup_PopupMenu.cpp"
139144
#include "buttons/yup_Button.cpp"
140145
#include "buttons/yup_TextButton.cpp"

modules/yup_gui/yup_gui.h

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,19 +80,21 @@
8080

8181
//==============================================================================
8282

83+
#include <tuple>
84+
#include <unordered_map>
85+
86+
//==============================================================================
87+
8388
#if YUP_ENABLE_COMPONENT_PAINT_PROFILING
8489
#define YUP_IF_COMPONENT_PAINT_PROFILING_ENABLED(CODE) CODE
90+
#include "profiling/yup_PaintProfileSample.h"
91+
#include "profiling/yup_PaintProfileStats.h"
8592
#else
8693
#define YUP_IF_COMPONENT_PAINT_PROFILING_ENABLED(CODE)
8794
#endif
8895

8996
//==============================================================================
9097

91-
#include <tuple>
92-
#include <unordered_map>
93-
94-
//==============================================================================
95-
9698
#include "application/yup_Application.h"
9799
#include "keyboard/yup_KeyModifiers.h"
98100
#include "keyboard/yup_KeyPress.h"
@@ -104,12 +106,9 @@
104106
#include "clipboard/yup_SystemClipboard.h"
105107
#include "desktop/yup_Screen.h"
106108
#include "desktop/yup_Desktop.h"
107-
#include "profiling/yup_PaintProfileSample.h"
108-
#include "profiling/yup_PaintProfileStats.h"
109109
#include "component/yup_ComponentNative.h"
110110
#include "component/yup_ComponentStyle.h"
111111
#include "component/yup_Component.h"
112-
#include "profiling/yup_PaintProfiler.h"
113112
#include "menus/yup_PopupMenu.h"
114113
#include "buttons/yup_Button.h"
115114
#include "buttons/yup_TextButton.h"
@@ -131,6 +130,12 @@
131130

132131
//==============================================================================
133132

133+
#if YUP_ENABLE_COMPONENT_PAINT_PROFILING
134+
#include "profiling/yup_PaintProfiler.h"
135+
#endif
136+
137+
//==============================================================================
138+
134139
#include "native/yup_WindowingHelpers.h"
135140

136141
//==============================================================================

0 commit comments

Comments
 (0)