Browse Source

Additional profiling zones

Michael Ragazzon 6 years ago
parent
commit
b10a47c0c1

+ 2 - 0
Source/Core/BaseXMLParser.cpp

@@ -116,6 +116,8 @@ void BaseXMLParser::ReadHeader()
 
 void BaseXMLParser::ReadBody()
 {
+	RMLUI_ZoneScoped;
+
 	open_tag_depth = 0;
 	line_number_open_tag = 0;
 

+ 2 - 0
Source/Core/Element.cpp

@@ -1252,6 +1252,8 @@ String Element::GetInnerRML() const {
 // Sets the markup and content of the element. All existing children will be replaced.
 void Element::SetInnerRML(const String& rml)
 {
+	RMLUI_ZoneScopedC(0x6495ED);
+
 	// Remove all DOM children.
 	while ((int) children.size() > num_non_dom_children)
 		RemoveChild(children.front().get());

+ 1 - 0
Source/Core/ElementDocument.cpp

@@ -305,6 +305,7 @@ void ElementDocument::UpdateLayout()
 	if(layout_dirty)
 	{
 		RMLUI_ZoneScoped;
+		RMLUI_ZoneText(source_url.c_str(), source_url.size());
 
 		layout_dirty = false;
 

+ 2 - 0
Source/Core/Factory.cpp

@@ -247,6 +247,7 @@ bool Factory::InstanceElementText(Element* parent, const String& text)
 		(system_interface->TranslateString(translated_data, text) > 0 ||
 		 translated_data.find("<") != String::npos))
 	{
+		RMLUI_ZoneScopedNC("InstanceStream", 0xDC143C);
 		auto stream = std::make_unique<StreamMemory>(translated_data.size() + 32);
 		stream->Write("<body>", 6);
 		stream->Write(translated_data);
@@ -257,6 +258,7 @@ bool Factory::InstanceElementText(Element* parent, const String& text)
 	}
 	else
 	{
+		RMLUI_ZoneScopedNC("InstanceText", 0x8FBC8F);
 		// Check if this text node contains only white-space; if so, we don't want to construct it.
 		bool only_white_space = true;
 		for (size_t i = 0; i < translated_data.size(); ++i)

+ 2 - 0
Source/Core/LayoutEngine.cpp

@@ -95,6 +95,8 @@ bool LayoutEngine::FormatElement(Element* element, const Vector2f& containing_bl
 
 		if (content_width < containing_block.x)
 		{
+			RMLUI_ZoneScopedNC("shrink_to_fit", 0xB27222);
+
 			Vector2f shrinked_block_size(content_width, containing_block.y);
 			
 			delete block_box;

+ 4 - 0
Source/Core/XMLNodeHandlerDefault.cpp

@@ -47,6 +47,8 @@ XMLNodeHandlerDefault::~XMLNodeHandlerDefault()
 
 Element* XMLNodeHandlerDefault::ElementStart(XMLParser* parser, const String& name, const XMLAttributes& attributes)
 {	
+	RMLUI_ZoneScopedC(0x556B2F);
+
 	// Determine the parent
 	Element* parent = parser->GetParseFrame()->element;
 
@@ -74,6 +76,8 @@ bool XMLNodeHandlerDefault::ElementEnd(XMLParser* RMLUI_UNUSED_PARAMETER(parser)
 
 bool XMLNodeHandlerDefault::ElementData(XMLParser* parser, const String& data)
 {
+	RMLUI_ZoneScopedC(0x006400);
+
 	// Determine the parent
 	Element* parent = parser->GetParseFrame()->element;
 

+ 3 - 0
Source/Core/XMLParser.cpp

@@ -120,6 +120,7 @@ const XMLParser::ParseFrame* XMLParser::GetParseFrame() const
 /// Called when the parser finds the beginning of an element tag.
 void XMLParser::HandleElementStart(const String& _name, const XMLAttributes& attributes)
 {
+	RMLUI_ZoneScoped;
 	const String name = StringUtilities::ToLower(_name);
 
 	// Check for a specific handler that will override the child handler.
@@ -150,6 +151,7 @@ void XMLParser::HandleElementStart(const String& _name, const XMLAttributes& att
 /// Called when the parser finds the end of an element tag.
 void XMLParser::HandleElementEnd(const String& _name)
 {
+	RMLUI_ZoneScoped;
 	String name = StringUtilities::ToLower(_name);
 
 	// Copy the top of the stack
@@ -175,6 +177,7 @@ void XMLParser::HandleElementEnd(const String& _name)
 /// Called when the parser encounters data.
 void XMLParser::HandleData(const String& data)
 {
+	RMLUI_ZoneScoped;
 	if (stack.top().node_handler)
 		stack.top().node_handler->ElementData(this, data);
 }