display time tracking

pull/3471/head
kallaballa 2 years ago
parent e8ebcb4d3a
commit fc2d09fa97
  1. 6
      modules/v4d/include/opencv2/v4d/v4d.hpp
  2. 11
      modules/v4d/src/detail/imguicontext.cpp
  3. 4
      modules/v4d/src/v4d.cpp

@ -15,7 +15,7 @@
#include "sink.hpp"
#include "util.hpp"
#include "nvg.hpp"
#include "detail/backend.hpp"
#include "detail/transaction.hpp"
#include "detail/threadpool.hpp"
#include "detail/gl.hpp"
#include "detail/framebuffercontext.hpp"
@ -282,10 +282,12 @@ public:
}
if (!(n->tx_->hasCondition()) && isEnabled) {
n->tx_->getContext()->execute([=]() {
n->tx_->getContext()->execute([n]() {
// cout << "run: " << std::this_thread::get_id() << " " << n->name_ << ": " << isEnabled << endl;
TimeTracker::getInstance()->execute(n->name_, [n](){
n->tx_->perform();
});
});
}
}
}

@ -76,7 +76,16 @@ void ImGuiContextImpl::render(bool showFPS) {
ImGui::Text("%.3f ms/frame (%.1f FPS)", (1000.0f / Global::fps()) , Global::fps());
ImGui::End();
ImGui::PopStyleColor(1);
std::stringstream ss;
TimeTracker::getInstance()->print(ss);
std::string line;
ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0.0f, 0.0f, 0.0f, 0.5f));
ImGui::Begin("Time Tracking");
while(getline(ss, line)) {
ImGui::Text("%s", line.c_str());
}
ImGui::End();
ImGui::PopStyleColor(1);
}
if (renderCallback_)
renderCallback_(context_);

@ -160,15 +160,11 @@ size_t V4D::numGlCtx() {
}
void V4D::copyTo(cv::UMat& m) {
TimeTracker::getInstance()->execute("copyTo", [this, &m](){
fbCtx()->copyTo(m);
});
}
void V4D::copyFrom(const cv::UMat& m) {
TimeTracker::getInstance()->execute("copyTo", [this, &m](){
fbCtx()->copyFrom(m);
});
}
void V4D::setSource(cv::Ptr<Source> src) {

Loading…
Cancel
Save