本文整理汇总了C++中SkAutoTUnref::setTileHeightPercentage方法的典型用法代码示例。如果您正苦于以下问题:C++ SkAutoTUnref::setTileHeightPercentage方法的具体用法?C++ SkAutoTUnref::setTileHeightPercentage怎么用?C++ SkAutoTUnref::setTileHeightPercentage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkAutoTUnref
的用法示例。
在下文中一共展示了SkAutoTUnref::setTileHeightPercentage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseRenderer
//.........这里部分代码省略.........
if (isPowerOf2Mode) {
int minWidth = atoi(widthString);
if (!SkIsPow2(minWidth) || minWidth < 0) {
SkString err;
error.printf("-mode %s must be given a width"
" value that is a power of two\n", mode);
return NULL;
}
tiledRenderer->setTileMinPowerOf2Width(minWidth);
} else if (sk_tools::is_percentage(widthString)) {
if (isCopyMode) {
error.printf("--mode %s does not support percentages.\n", mode);
return NULL;
}
tiledRenderer->setTileWidthPercentage(atof(widthString));
if (!(tiledRenderer->getTileWidthPercentage() > 0)) {
error.printf("--mode %s must be given a width percentage > 0\n", mode);
return NULL;
}
} else {
tiledRenderer->setTileWidth(atoi(widthString));
if (!(tiledRenderer->getTileWidth() > 0)) {
error.printf("--mode %s must be given a width > 0\n", mode);
return NULL;
}
}
if (sk_tools::is_percentage(heightString)) {
if (isCopyMode) {
error.printf("--mode %s does not support percentages.\n", mode);
return NULL;
}
tiledRenderer->setTileHeightPercentage(atof(heightString));
if (!(tiledRenderer->getTileHeightPercentage() > 0)) {
error.printf("--mode %s must be given a height percentage > 0\n", mode);
return NULL;
}
} else {
tiledRenderer->setTileHeight(atoi(heightString));
if (!(tiledRenderer->getTileHeight() > 0)) {
SkString err;
error.printf("--mode %s must be given a height > 0\n", mode);
return NULL;
}
}
renderer.reset(tiledRenderer.detach());
if (FLAGS_pipe) {
error.printf("Pipe rendering is currently not compatible with tiling.\n"
"Turning off pipe.\n");
}
} else { // useTiles
if (FLAGS_multi > 1) {
error.printf("Multithreaded drawing requires tiled rendering.\n");
return NULL;
}
if (FLAGS_pipe) {
if (renderer != NULL) {
error.printf("Pipe is incompatible with other modes.\n");
return NULL;
}
renderer.reset(SkNEW(sk_tools::PipePictureRenderer));
}
}
示例2: parseRenderer
//.........这里部分代码省略.........
if (isPowerOf2Mode) {
int minWidth = atoi(widthString);
if (!SkIsPow2(minWidth) || minWidth < 0) {
SkString err;
error.printf("-mode %s must be given a width"
" value that is a power of two\n", mode);
return NULL;
}
tiledRenderer->setTileMinPowerOf2Width(minWidth);
} else if (sk_tools::is_percentage(widthString)) {
if (isCopyMode) {
error.printf("--mode %s does not support percentages.\n", mode);
return NULL;
}
tiledRenderer->setTileWidthPercentage(atof(widthString));
if (!(tiledRenderer->getTileWidthPercentage() > 0)) {
error.printf("--mode %s must be given a width percentage > 0\n", mode);
return NULL;
}
} else {
tiledRenderer->setTileWidth(atoi(widthString));
if (!(tiledRenderer->getTileWidth() > 0)) {
error.printf("--mode %s must be given a width > 0\n", mode);
return NULL;
}
}
if (sk_tools::is_percentage(heightString)) {
if (isCopyMode) {
error.printf("--mode %s does not support percentages.\n", mode);
return NULL;
}
tiledRenderer->setTileHeightPercentage(atof(heightString));
if (!(tiledRenderer->getTileHeightPercentage() > 0)) {
error.printf("--mode %s must be given a height percentage > 0\n", mode);
return NULL;
}
} else {
tiledRenderer->setTileHeight(atoi(heightString));
if (!(tiledRenderer->getTileHeight() > 0)) {
SkString err;
error.printf("--mode %s must be given a height > 0\n", mode);
return NULL;
}
}
renderer.reset(tiledRenderer.detach());
if (FLAGS_pipe) {
error.printf("Pipe rendering is currently not compatible with tiling.\n"
"Turning off pipe.\n");
}
} else { // useTiles
if (FLAGS_pipe) {
if (renderer != NULL) {
error.printf("Pipe is incompatible with other modes.\n");
return NULL;
}
renderer.reset(SkNEW_ARGS(sk_tools::PipePictureRenderer, RENDERER_ARGS));
}
}
if (NULL == renderer) {
renderer.reset(SkNEW_ARGS(sk_tools::SimplePictureRenderer, RENDERER_ARGS));
}