Browse Source

Add some more zones for tracy profiler.

Michael Ragazzon 5 years ago
parent
commit
0a3aea6b70

+ 3 - 0
Source/Core/PropertySpecification.cpp

@@ -31,6 +31,7 @@
 #include "../../Include/RmlUi/Core/Log.h"
 #include "../../Include/RmlUi/Core/PropertyDefinition.h"
 #include "../../Include/RmlUi/Core/PropertyDictionary.h"
+#include "../../Include/RmlUi/Core/Profiling.h"
 #include "PropertyShorthandDefinition.h"
 #include "IdNameMap.h"
 #include <limits.h>
@@ -223,6 +224,8 @@ const ShorthandDefinition* PropertySpecification::GetShorthand(const String& sho
 
 bool PropertySpecification::ParsePropertyDeclaration(PropertyDictionary& dictionary, const String& property_name, const String& property_value) const
 {
+	RMLUI_ZoneScoped;
+
 	// Try as a property first
 	PropertyId property_id = property_map->GetId(property_name);
 	if (property_id != PropertyId::Invalid)

+ 6 - 2
Source/Core/StyleSheet.cpp

@@ -145,11 +145,12 @@ DecoratorsPtr StyleSheet::InstanceDecoratorsFromString(const String& decorator_s
 	//   decorator: invader-theme-background, ...;
 	// or is an anonymous decorator with inline properties
 	//   decorator: tiled-box( <shorthand properties> ), ...;
-	
-	Decorators decorators;
+
 	if (decorator_string_value.empty() || decorator_string_value == "none")
 		return nullptr;
 
+	RMLUI_ZoneScoped;
+	Decorators decorators;
 	const char* source_path = (source ? source->path.c_str() : "");
 	const int source_line_number = (source ? source->line_number : 0);
 
@@ -205,6 +206,7 @@ DecoratorsPtr StyleSheet::InstanceDecoratorsFromString(const String& decorator_s
 			
 			properties.SetSourceOfAllProperties(source);
 
+			RMLUI_ZoneScopedN("InstanceDecorator");
 			SharedPtr<Decorator> decorator = instancer->InstanceDecorator(type, properties, DecoratorInstancerInterface(*this));
 
 			if (decorator)
@@ -230,6 +232,7 @@ FontEffectsPtr StyleSheet::InstanceFontEffectsFromString(const String& font_effe
 	if (font_effect_string_value.empty() || font_effect_string_value == "none")
 		return nullptr;
 
+	RMLUI_ZoneScoped;
 	const char* source_path = (source ? source->path.c_str() : "");
 	const int source_line_number = (source ? source->line_number : 0);
 
@@ -283,6 +286,7 @@ FontEffectsPtr StyleSheet::InstanceFontEffectsFromString(const String& font_effe
 
 			properties.SetSourceOfAllProperties(source);
 
+			RMLUI_ZoneScopedN("InstanceFontEffect");
 			SharedPtr<FontEffect> font_effect = instancer->InstanceFontEffect(type, properties);
 			if (font_effect)
 			{

+ 2 - 0
Source/Core/StyleSheetParser.cpp

@@ -530,6 +530,8 @@ StyleSheetNodeListRaw StyleSheetParser::ConstructNodes(StyleSheetNode& root_node
 
 bool StyleSheetParser::ReadProperties(AbstractPropertyParser& property_parser)
 {
+	RMLUI_ZoneScoped;
+
 	String name;
 	String value;