本文整理汇总了C++中Benchmark::getSize方法的典型用法代码示例。如果您正苦于以下问题:C++ Benchmark::getSize方法的具体用法?C++ Benchmark::getSize怎么用?C++ Benchmark::getSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Benchmark
的用法示例。
在下文中一共展示了Benchmark::getSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tool_main
//.........这里部分代码省略.........
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;
}
switch(benchMode) {
case kDeferredSilent_BenchMode:
case kDeferred_BenchMode:
canvas.reset(SkDeferredCanvas::Create(surface.get()));
break;
case kRecord_BenchMode:
canvas.reset(SkRef(recorderTo.beginRecording(dim.fX, dim.fY)));
break;
case kPictureRecord_BenchMode: {
SkPictureRecorder recorderFrom;
bench->draw(1, recorderFrom.beginRecording(dim.fX, dim.fY));
recordFrom.reset(recorderFrom.endRecording());
canvas.reset(SkRef(recorderTo.beginRecording(dim.fX, dim.fY)));
break;
}
case kNormal_BenchMode:
canvas.reset(SkRef(surface->getCanvas()));
break;