mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-29 22:22:54 +02:00
add LoggingCategory data member to JobContext
This commit is contained in:
parent
342ba5f8aa
commit
cfb64ad693
2 changed files with 9 additions and 2 deletions
|
@ -25,6 +25,7 @@ namespace render {
|
||||||
|
|
||||||
class RenderContext : public task::JobContext {
|
class RenderContext : public task::JobContext {
|
||||||
public:
|
public:
|
||||||
|
RenderContext() : task::JobContext(trace_render()) {}
|
||||||
virtual ~RenderContext() {}
|
virtual ~RenderContext() {}
|
||||||
|
|
||||||
RenderArgs* args;
|
RenderArgs* args;
|
||||||
|
|
|
@ -31,9 +31,13 @@ class JobNoIO {};
|
||||||
|
|
||||||
class JobContext {
|
class JobContext {
|
||||||
public:
|
public:
|
||||||
|
JobContext(const QLoggingCategory& category) : profileCategory(category) {
|
||||||
|
assert(category);
|
||||||
|
}
|
||||||
virtual ~JobContext() {}
|
virtual ~JobContext() {}
|
||||||
|
|
||||||
std::shared_ptr<JobConfig> jobConfig { nullptr };
|
std::shared_ptr<JobConfig> jobConfig { nullptr };
|
||||||
|
const QLoggingCategory& profileCategory;
|
||||||
};
|
};
|
||||||
using JobContextPointer = std::shared_ptr<JobContext>;
|
using JobContextPointer = std::shared_ptr<JobContext>;
|
||||||
|
|
||||||
|
@ -163,7 +167,9 @@ public:
|
||||||
|
|
||||||
virtual void run(const ContextPointer& jobContext) {
|
virtual void run(const ContextPointer& jobContext) {
|
||||||
PerformanceTimer perfTimer(_name.c_str());
|
PerformanceTimer perfTimer(_name.c_str());
|
||||||
//PROFILE_RANGE(render, _name.c_str());
|
//PROFILE_RANGE(foo, _name);
|
||||||
|
//Duration profileRangeThis(trace_foo(), name);
|
||||||
|
Duration profileRange(jobContext->profileCategory, _name.c_str());
|
||||||
auto start = usecTimestampNow();
|
auto start = usecTimestampNow();
|
||||||
|
|
||||||
_concept->run(jobContext);
|
_concept->run(jobContext);
|
||||||
|
|
Loading…
Reference in a new issue