本文整理汇总了C++中SkAutoTUnref::setUseDFText方法的典型用法代码示例。如果您正苦于以下问题:C++ SkAutoTUnref::setUseDFText方法的具体用法?C++ SkAutoTUnref::setUseDFText怎么用?C++ SkAutoTUnref::setUseDFText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkAutoTUnref
的用法示例。
在下文中一共展示了SkAutoTUnref::setUseDFText方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseRenderer
//.........这里部分代码省略.........
sk_tools::PictureRenderer::kBitmap_DeviceType;
#if SK_SUPPORT_GPU
GrGLStandard gpuAPI = kNone_GrGLStandard;
if (1 == FLAGS_gpuAPI.count()) {
if (FLAGS_gpuAPI.contains(kGpuAPINameGL)) {
gpuAPI = kGL_GrGLStandard;
} else if (FLAGS_gpuAPI.contains(kGpuAPINameGLES)) {
gpuAPI = kGLES_GrGLStandard;
} else {
error.printf("--gpuAPI invalid api value.\n");
return NULL;
}
} else if (FLAGS_gpuAPI.count() > 1) {
error.printf("--gpuAPI invalid api value.\n");
return NULL;
}
int sampleCount = 0;
bool useDFText = false;
#endif
if (FLAGS_config.count() > 0) {
if (0 == strcmp(FLAGS_config[0], "8888")) {
deviceType = sk_tools::PictureRenderer::kBitmap_DeviceType;
}
#if SK_SUPPORT_GPU
else if (0 == strcmp(FLAGS_config[0], "gpu")) {
deviceType = sk_tools::PictureRenderer::kGPU_DeviceType;
}
else if (0 == strcmp(FLAGS_config[0], "msaa4")) {
deviceType = sk_tools::PictureRenderer::kGPU_DeviceType;
sampleCount = 4;
}
else if (0 == strcmp(FLAGS_config[0], "msaa16")) {
deviceType = sk_tools::PictureRenderer::kGPU_DeviceType;
sampleCount = 16;
}
else if (0 == strcmp(FLAGS_config[0], "nvprmsaa4")) {
deviceType = sk_tools::PictureRenderer::kNVPR_DeviceType;
sampleCount = 4;
}
else if (0 == strcmp(FLAGS_config[0], "nvprmsaa16")) {
deviceType = sk_tools::PictureRenderer::kNVPR_DeviceType;
sampleCount = 16;
}
else if (0 == strcmp(FLAGS_config[0], "gpudft")) {
deviceType = sk_tools::PictureRenderer::kGPU_DeviceType;
useDFText = true;
}
#if SK_ANGLE
else if (0 == strcmp(FLAGS_config[0], "angle")) {
deviceType = sk_tools::PictureRenderer::kAngle_DeviceType;
}
#endif
#if SK_MESA
else if (0 == strcmp(FLAGS_config[0], "mesa")) {
deviceType = sk_tools::PictureRenderer::kMesa_DeviceType;
}
#endif
#endif
else {
error.printf("%s is not a valid mode for --config\n", FLAGS_config[0]);
return NULL;
}
#if SK_SUPPORT_GPU
if (!renderer->setDeviceType(deviceType, gpuAPI)) {
#else
if (!renderer->setDeviceType(deviceType)) {
#endif
error.printf("Could not create backend for --config %s\n", FLAGS_config[0]);
return NULL;
}
#if SK_SUPPORT_GPU
renderer->setSampleCount(sampleCount);
renderer->setUseDFText(useDFText);
#endif
}
sk_tools::PictureRenderer::BBoxHierarchyType bbhType
= sk_tools::PictureRenderer::kNone_BBoxHierarchyType;
if (FLAGS_bbh.count() > 0) {
const char* type = FLAGS_bbh[0];
if (0 == strcmp(type, "none")) {
bbhType = sk_tools::PictureRenderer::kNone_BBoxHierarchyType;
} else if (0 == strcmp(type, "rtree")) {
bbhType = sk_tools::PictureRenderer::kRTree_BBoxHierarchyType;
} else {
error.printf("%s is not a valid value for --bbhType\n", type);
return NULL;
}
if (FLAGS_pipe && sk_tools::PictureRenderer::kNone_BBoxHierarchyType != bbhType) {
error.printf("--pipe and --bbh cannot be used together\n");
return NULL;
}
}
renderer->setBBoxHierarchyType(bbhType);
renderer->setScaleFactor(SkDoubleToScalar(FLAGS_scale));
return renderer.detach();
}