本文整理汇总了C++中GrContext::getMaxSampleCount方法的典型用法代码示例。如果您正苦于以下问题:C++ GrContext::getMaxSampleCount方法的具体用法?C++ GrContext::getMaxSampleCount怎么用?C++ GrContext::getMaxSampleCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GrContext
的用法示例。
在下文中一共展示了GrContext::getMaxSampleCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tool_main
int tool_main(int argc, char** argv) {
SetupCrashHandler();
SkCommandLineFlags::Parse(argc, argv);
#if SK_ENABLE_INST_COUNT
if (FLAGS_leaks) {
gPrintInstCount = true;
}
#endif
SkAutoGraphics ag;
// First, parse some flags.
BenchLogger logger;
if (FLAGS_logFile.count()) {
logger.SetLogFile(FLAGS_logFile[0]);
}
LoggerResultsWriter logWriter(logger, FLAGS_timeFormat[0]);
MultiResultsWriter writer;
writer.add(&logWriter);
SkAutoTDelete<JSONResultsWriter> jsonWriter;
if (FLAGS_outResultsFile.count()) {
jsonWriter.reset(SkNEW(JSONResultsWriter(FLAGS_outResultsFile[0])));
writer.add(jsonWriter.get());
}
// Instantiate after all the writers have been added to writer so that we
// call close() before their destructors are called on the way out.
CallEnd<MultiResultsWriter> ender(writer);
const uint8_t alpha = FLAGS_forceBlend ? 0x80 : 0xFF;
SkTriState::State dither = SkTriState::kDefault;
for (size_t i = 0; i < 3; i++) {
if (strcmp(SkTriState::Name[i], FLAGS_forceDither[0]) == 0) {
dither = static_cast<SkTriState::State>(i);
}
}
BenchMode benchMode = kNormal_BenchMode;
for (size_t i = 0; i < SK_ARRAY_COUNT(BenchMode_Name); i++) {
if (strcmp(FLAGS_mode[0], BenchMode_Name[i]) == 0) {
benchMode = static_cast<BenchMode>(i);
}
}
SkTDArray<int> configs;
bool runDefaultConfigs = false;
// Try user-given configs first.
for (int i = 0; i < FLAGS_config.count(); i++) {
for (int j = 0; j < static_cast<int>(SK_ARRAY_COUNT(gConfigs)); ++j) {
if (0 == strcmp(FLAGS_config[i], gConfigs[j].name)) {
*configs.append() = j;
} else if (0 == strcmp(FLAGS_config[i], kDefaultsConfigStr)) {
runDefaultConfigs = true;
}
}
}
// If there weren't any, fill in with defaults.
if (runDefaultConfigs) {
for (int i = 0; i < static_cast<int>(SK_ARRAY_COUNT(gConfigs)); ++i) {
if (gConfigs[i].runByDefault) {
*configs.append() = i;
}
}
}
// Filter out things we can't run.
if (kNormal_BenchMode != benchMode) {
// Non-rendering configs only run in normal mode
for (int i = 0; i < configs.count(); ++i) {
const Config& config = gConfigs[configs[i]];
if (Benchmark::kNonRendering_Backend == config.backend) {
configs.remove(i, 1);
--i;
}
}
}
#if SK_SUPPORT_GPU
for (int i = 0; i < configs.count(); ++i) {
const Config& config = gConfigs[configs[i]];
if (Benchmark::kGPU_Backend == config.backend) {
GrContext* context = gContextFactory.get(config.contextType);
if (NULL == context) {
SkDebugf("GrContext could not be created for config %s. Config will be skipped.\n",
config.name);
configs.remove(i);
--i;
continue;
}
if (config.sampleCount > context->getMaxSampleCount()){
SkDebugf(
"Sample count (%d) for config %s is not supported. Config will be skipped.\n",
config.sampleCount, config.name);
configs.remove(i);
--i;
continue;
}
}
}
//.........这里部分代码省略.........