mirror of
https://github.com/lubosz/overte.git
synced 2025-04-08 08:22:19 +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 {
|
||||
public:
|
||||
RenderContext() : task::JobContext(trace_render()) {}
|
||||
virtual ~RenderContext() {}
|
||||
|
||||
RenderArgs* args;
|
||||
|
@ -101,7 +102,7 @@ namespace render {
|
|||
|
||||
protected:
|
||||
RenderContextPointer _renderContext;
|
||||
|
||||
|
||||
void run(const RenderContextPointer& context) override { assert(_renderContext); Task::run(_renderContext); }
|
||||
};
|
||||
using EnginePointer = std::shared_ptr<Engine>;
|
||||
|
|
|
@ -31,9 +31,13 @@ class JobNoIO {};
|
|||
|
||||
class JobContext {
|
||||
public:
|
||||
JobContext(const QLoggingCategory& category) : profileCategory(category) {
|
||||
assert(category);
|
||||
}
|
||||
virtual ~JobContext() {}
|
||||
|
||||
std::shared_ptr<JobConfig> jobConfig { nullptr };
|
||||
const QLoggingCategory& profileCategory;
|
||||
};
|
||||
using JobContextPointer = std::shared_ptr<JobContext>;
|
||||
|
||||
|
@ -163,7 +167,9 @@ public:
|
|||
|
||||
virtual void run(const ContextPointer& jobContext) {
|
||||
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();
|
||||
|
||||
_concept->run(jobContext);
|
||||
|
|
Loading…
Reference in a new issue