diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-11-06 21:13:16 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-11-07 12:46:08 +0300 |
commit | d812d9fac7bae4eff66a5ce8275be19d0ca77a32 (patch) | |
tree | 7f9619d23a44202a76282849bb1284773302309f /src/guichan | |
parent | 1bcaac517036751a8fee9ff3d6561f5866e6969e (diff) | |
download | manaverse-d812d9fac7bae4eff66a5ce8275be19d0ca77a32.tar.gz manaverse-d812d9fac7bae4eff66a5ce8275be19d0ca77a32.tar.bz2 manaverse-d812d9fac7bae4eff66a5ce8275be19d0ca77a32.tar.xz manaverse-d812d9fac7bae4eff66a5ce8275be19d0ca77a32.zip |
Add own profiler and profiler info to some code.
Diffstat (limited to 'src/guichan')
-rw-r--r-- | src/guichan/basiccontainer.cpp | 9 | ||||
-rw-r--r-- | src/guichan/graphics.cpp | 1 | ||||
-rw-r--r-- | src/guichan/gui.cpp | 6 | ||||
-rw-r--r-- | src/guichan/widget.cpp | 2 | ||||
-rw-r--r-- | src/guichan/widgets/container.cpp | 2 | ||||
-rw-r--r-- | src/guichan/widgets/scrollarea.cpp | 2 | ||||
-rw-r--r-- | src/guichan/widgets/textbox.cpp | 2 |
7 files changed, 24 insertions, 0 deletions
diff --git a/src/guichan/basiccontainer.cpp b/src/guichan/basiccontainer.cpp index f3f61b65a..fb69bb53a 100644 --- a/src/guichan/basiccontainer.cpp +++ b/src/guichan/basiccontainer.cpp @@ -257,6 +257,8 @@ namespace gcn void BasicContainer::drawChildren(Graphics* graphics) { + BLOCK_START("BasicContainer::drawChildren") + graphics->pushClipArea(getChildrenArea()); for (WidgetListConstIterator iter = mWidgets.begin(); @@ -274,26 +276,33 @@ namespace gcn rec.width += 2 * (*iter)->getFrameSize(); rec.height += 2 * (*iter)->getFrameSize(); graphics->pushClipArea(rec); + BLOCK_START("BasicContainer::drawChildren 1") (*iter)->drawFrame(graphics); + BLOCK_END("BasicContainer::drawChildren 1") graphics->popClipArea(); } graphics->pushClipArea((*iter)->getDimension()); + BLOCK_START("BasicContainer::drawChildren 2") (*iter)->draw(graphics); + BLOCK_END("BasicContainer::drawChildren 2") graphics->popClipArea(); } } graphics->popClipArea(); + BLOCK_END("BasicContainer::drawChildren") } void BasicContainer::logicChildren() { + BLOCK_START("BasicContainer::logicChildren") for (WidgetListConstIterator iter = mWidgets.begin(); iter != mWidgets.end(); ++ iter) { (*iter)->logic(); } + BLOCK_END("BasicContainer::logicChildren") } void BasicContainer::showWidgetPart(Widget* widget, Rectangle area) diff --git a/src/guichan/graphics.cpp b/src/guichan/graphics.cpp index 52e183591..756b5a9b5 100644 --- a/src/guichan/graphics.cpp +++ b/src/guichan/graphics.cpp @@ -155,6 +155,7 @@ namespace gcn void Graphics::drawText(const std::string& text, int x, int y, Alignment alignment) { + FUNC_BLOCK("Graphics::drawText", 1) if (!mFont) throw GCN_EXCEPTION("No font set."); diff --git a/src/guichan/gui.cpp b/src/guichan/gui.cpp index 41b9fe30f..ed4417650 100644 --- a/src/guichan/gui.cpp +++ b/src/guichan/gui.cpp @@ -161,6 +161,7 @@ namespace gcn void Gui::handleMouseInput() { + BLOCK_START("Gui::handleMouseInput") while (!mInput->isMouseQueueEmpty()) { const MouseInput mouseInput = mInput->dequeueMouseInput(); @@ -192,6 +193,7 @@ namespace gcn break; } } + BLOCK_END("Gui::handleMouseInput") } void Gui::handleKeyInput() @@ -748,6 +750,7 @@ namespace gcn void Gui::handleModalMouseInputFocus() { + BLOCK_START("Gui::handleModalMouseInputFocus") // Check if modal mouse input focus has been gained by a widget. if ((mFocusHandler->getLastWidgetWithModalMouseInputFocus() != mFocusHandler->getModalMouseInputFocused()) @@ -765,10 +768,12 @@ namespace gcn handleModalFocusReleased(); mFocusHandler->setLastWidgetWithModalMouseInputFocus(nullptr); } + BLOCK_END("Gui::handleModalMouseInputFocus") } void Gui::handleModalFocus() { + BLOCK_START("Gui::handleModalFocus") // Check if modal focus has been gained by a widget. if ((mFocusHandler->getLastWidgetWithModalFocus() != mFocusHandler->getModalFocused()) @@ -786,6 +791,7 @@ namespace gcn handleModalFocusReleased(); mFocusHandler->setLastWidgetWithModalFocus(nullptr); } + BLOCK_END("Gui::handleModalFocus") } void Gui::handleModalFocusGained() diff --git a/src/guichan/widget.cpp b/src/guichan/widget.cpp index e9e846e76..fbc0cfef9 100644 --- a/src/guichan/widget.cpp +++ b/src/guichan/widget.cpp @@ -108,6 +108,7 @@ namespace gcn void Widget::drawFrame(Graphics* graphics) { + BLOCK_START("Widget::drawFrame") const Color &faceColor = getBaseColor(); Color highlightColor = faceColor + 0x303030; Color shadowColor = faceColor - 0x303030; @@ -126,6 +127,7 @@ namespace gcn graphics->drawLine(width - i, i + 1, width - i, height - i); graphics->drawLine(i, height - i, width - i - 1, height - i); } + BLOCK_END("Widget::drawFrame") } void Widget::_setParent(Widget* parent) diff --git a/src/guichan/widgets/container.cpp b/src/guichan/widgets/container.cpp index ec61338c8..64f1ee8cb 100644 --- a/src/guichan/widgets/container.cpp +++ b/src/guichan/widgets/container.cpp @@ -69,6 +69,7 @@ namespace gcn void Container::draw(Graphics* graphics) { + BLOCK_START("Container::draw") if (isOpaque()) { graphics->setColor(getBaseColor()); @@ -76,6 +77,7 @@ namespace gcn } drawChildren(graphics); + BLOCK_END("Container::draw") } void Container::setOpaque(bool opaque) diff --git a/src/guichan/widgets/scrollarea.cpp b/src/guichan/widgets/scrollarea.cpp index f79bd32eb..59e909258 100644 --- a/src/guichan/widgets/scrollarea.cpp +++ b/src/guichan/widgets/scrollarea.cpp @@ -455,6 +455,7 @@ namespace gcn void ScrollArea::logic() { + BLOCK_START("ScrollArea::logic") checkPolicies(); setVerticalScrollAmount(getVerticalScrollAmount()); @@ -466,6 +467,7 @@ namespace gcn -mVScroll + getContent()->getFrameSize()); getContent()->logic(); } + BLOCK_END("ScrollArea::logic") } void ScrollArea::checkPolicies() diff --git a/src/guichan/widgets/textbox.cpp b/src/guichan/widgets/textbox.cpp index 0c8f4451a..66441894b 100644 --- a/src/guichan/widgets/textbox.cpp +++ b/src/guichan/widgets/textbox.cpp @@ -120,6 +120,7 @@ namespace gcn void TextBox::draw(Graphics* graphics) { + BLOCK_START("TextBox::draw") if (mOpaque) { graphics->setColor(mBackgroundColor); @@ -142,6 +143,7 @@ namespace gcn graphics->drawText(mTextRows[i], 1, static_cast<int>(i * getFont()->getHeight())); } + BLOCK_END("TextBox::draw") } void TextBox::drawCaret(Graphics* graphics, int x, int y) |