本文整理汇总了C++中Benchmark::isSuitableFor方法的典型用法代码示例。如果您正苦于以下问题:C++ Benchmark::isSuitableFor方法的具体用法?C++ Benchmark::isSuitableFor怎么用?C++ Benchmark::isSuitableFor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Benchmark
的用法示例。
在下文中一共展示了Benchmark::isSuitableFor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: next
Benchmark* next() {
Benchmark* bench = nullptr;
// skips non matching benches
while ((bench = this->innerNext()) &&
(SkCommandLineFlags::ShouldSkip(FLAGS_match, bench->getUniqueName()) ||
!bench->isSuitableFor(Benchmark::kGPU_Backend))) {
delete bench;
}
return bench;
}
示例2: tool_main
//.........这里部分代码省略.........
size_t bytes;
int count;
context->getResourceCacheLimits(&count, &bytes);
if (-1 != FLAGS_gpuCacheBytes) {
bytes = static_cast<size_t>(FLAGS_gpuCacheBytes);
}
if (-1 != FLAGS_gpuCacheCount) {
count = FLAGS_gpuCacheCount;
}
context->setResourceCacheLimits(count, bytes);
#endif
}
// Run each bench in each configuration it supports and we asked for.
Iter iter;
Benchmark* bench;
while ((bench = iter.next()) != NULL) {
SkAutoTUnref<Benchmark> benchUnref(bench);
if (SkCommandLineFlags::ShouldSkip(FLAGS_match, bench->getName())) {
continue;
}
bench->setForceAlpha(alpha);
bench->setForceAA(FLAGS_forceAA);
bench->setForceFilter(FLAGS_forceFilter);
bench->setDither(dither);
bench->preDraw();
bool loggedBenchName = false;
for (int i = 0; i < configs.count(); ++i) {
const int configIndex = configs[i];
const Config& config = gConfigs[configIndex];
if (!bench->isSuitableFor(config.backend)) {
continue;
}
GrContext* context = NULL;
#if SK_SUPPORT_GPU
SkGLContextHelper* glContext = NULL;
if (Benchmark::kGPU_Backend == config.backend) {
context = gContextFactory.get(config.contextType);
if (NULL == context) {
continue;
}
glContext = gContextFactory.getGLContext(config.contextType);
}
#endif
SkAutoTUnref<SkCanvas> canvas;
SkAutoTUnref<SkPicture> recordFrom;
SkPictureRecorder recorderTo;
const SkIPoint dim = bench->getSize();
SkAutoTUnref<SkSurface> surface;
if (Benchmark::kNonRendering_Backend != config.backend) {
surface.reset(make_surface(config.fColorType,
dim,
config.backend,
config.sampleCount,
context));
if (!surface.get()) {
logger.logError(SkStringPrintf(
"Device creation failure for config %s. Will skip.\n", config.name));
continue;
}