本文整理汇总了C++中Profiler::mark方法的典型用法代码示例。如果您正苦于以下问题:C++ Profiler::mark方法的具体用法?C++ Profiler::mark怎么用?C++ Profiler::mark使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Profiler
的用法示例。
在下文中一共展示了Profiler::mark方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: run_mt
//------------------------------------------------------------------------------
void Process::run_mt(SubFlow *subflow, void *data) {
Process::task_run_t *task = (Process::task_run_t *)data;
const bool is_master = subflow->is_master();
const bool online = !task->is_offline;
const ProcessSource::process process_source = task->photo->process_source;
//--------------------------------------------------------------------------
Profiler *prof = nullptr;
if(subflow->sync_point_pre()) {
quit_lock.lock();
prof = new Profiler("Process");
Mem::state_reset();
task->mutators_mpass = new DataSet();
}
subflow->sync_point_post();
if(to_quit)
return;
ProcessCache_t *process_cache = (ProcessCache_t *)task->photo->cache_process;
//--------------------------------------------------------------------------
// do demosaic
bool to_process_demosaic = false;
if(process_source == ProcessSource::s_process_export || process_source == ProcessSource::s_load || process_source == ProcessSource::s_demosaic)
to_process_demosaic = true;
if(to_process_demosaic) {
// clean up demosaic and WB caches if any
if(is_master) {
if(process_cache->area_demosaic != nullptr) {
delete process_cache->area_demosaic;
process_cache->area_demosaic = nullptr;
}
if(process_cache->area_wb != nullptr) {
delete process_cache->area_wb;
process_cache->area_wb = nullptr;
}
}
// process
if(is_master) {
prof->mark("Demosaic");
task->tiles_receiver->long_wait(true);
}
process_demosaic(subflow, data);
if(is_master) {
task->tiles_receiver->long_wait(false);
}
}
//--------------------------------------------------------------------------
// NOTE WB: reset WB cache if necessary
bool process_wb = (process_source == ProcessSource::s_wb);
process_wb |= to_process_demosaic;
process_wb |= task->is_offline;
if(is_master && process_wb && process_cache->area_wb != nullptr) {
delete process_cache->area_wb;
process_cache->area_wb = nullptr;
}
// create list of enabled filters
list<class filter_record_t> pl_filters[3]; // 0 - thumbnail, 1 - tiles, 2 - tiles & demosaic
for(int fi = 0; fi < 3; ++fi) {
int fr_i = (fi == 0) ? 0 : 1;
// cerr << "filters list, iteration == " << fi << endl;
for(list<filter_record_t>::iterator it = task->filter_records[fr_i].begin(); it != task->filter_records[fr_i].end(); ++it) {
Filter *filter = (*it).filter;
// skip demosaic filter
if(filter != nullptr) {
if(filter->type() == Filter::t_demosaic && fi != 2)
continue;
// NOTE WB: skip f_wb
// if(!process_wb && filter->id() == string("F_WB"))
if(filter->id() == string("F_WB")) {
if(!process_wb) continue;
if(!task->is_offline && fi != 0) continue;
}
}
if((*it).fp->is_enabled((*it).ps_base.get())) {
// check type - 'CP' or '2D'; create wrapper for 'CP'
if((*it).fp->fp_type(fi == 0) == FilterProcess::fp_type_2d) {
pl_filters[fi].push_back(*it);
//cerr << " " << (*it).fp->name() << endl;
} else {
}
} else {
}
}
}
//--------------------------------------------------------------------------
// TODO: use this processing workflow:
// 1. process thumbnail with result size 256x256; in online mode - push result to View;
// 2. - for online processing: ask view about desired size (according to the view scale)
// - for offline processing: process with 1:1 desired scale
// adapt step 2 for tiles usage
// TODO: check process_source == s_view_tiles - dont'd update geometry, scales etc - just ask tiles via get_tiles and process them
Area::t_dimensions d_full_forward; // determine size of processed full-size image; used in View for correct Thumb rescaling
bool process_view_tiles = false; // true for deferred process of tiles that was out of view before signal 's_view_refresh'
if(process_source == ProcessSource::s_view_tiles)
process_view_tiles = true;
// ** call "size_forward()" through all enabled filters; result is geometry of photo as after processing with scale 1:1
// ** then register it at tiles receiver to be able correctly determine desired scaling factor later.
if(process_view_tiles == false) {
if(subflow->sync_point_pre()) {
task->mutators = new DataSet();
task->mutators->set("_p_online", online);
//.........这里部分代码省略.........