本文整理汇总了C++中SkAutoTUnref::setViewport方法的典型用法代码示例。如果您正苦于以下问题:C++ SkAutoTUnref::setViewport方法的具体用法?C++ SkAutoTUnref::setViewport怎么用?C++ SkAutoTUnref::setViewport使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkAutoTUnref
的用法示例。
在下文中一共展示了SkAutoTUnref::setViewport方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseRenderer
//.........这里部分代码省略.........
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));
}
}
if (NULL == renderer) {
renderer.reset(SkNEW(sk_tools::SimplePictureRenderer));
}
if (FLAGS_viewport.count() > 0) {
if (FLAGS_viewport.count() != 2) {
error.printf("--viewport requires a width and a height.\n");
return NULL;
}
SkISize viewport;
viewport.fWidth = atoi(FLAGS_viewport[0]);
viewport.fHeight = atoi(FLAGS_viewport[1]);
renderer->setViewport(viewport);
}
sk_tools::PictureRenderer::SkDeviceTypes deviceType =
sk_tools::PictureRenderer::kBitmap_DeviceType;
#if SK_SUPPORT_GPU
int sampleCount = 0;
#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;
if (FLAGS_multi > 1) {
error.printf("GPU not compatible with multithreaded tiling.\n");
return NULL;
}
}
else if (0 == strcmp(FLAGS_config[0], "msaa4")) {
deviceType = sk_tools::PictureRenderer::kGPU_DeviceType;
if (FLAGS_multi > 1) {
error.printf("GPU not compatible with multithreaded tiling.\n");
return NULL;
}
sampleCount = 4;
}
else if (0 == strcmp(FLAGS_config[0], "msaa16")) {
deviceType = sk_tools::PictureRenderer::kGPU_DeviceType;
if (FLAGS_multi > 1) {
error.printf("GPU not compatible with multithreaded tiling.\n");
return NULL;
示例2: parseRenderer
//.........这里部分代码省略.........
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));
}
if (FLAGS_viewport.count() > 0) {
if (FLAGS_viewport.count() != 2) {
error.printf("--viewport requires a width and a height.\n");
return NULL;
}
SkISize viewport;
viewport.fWidth = atoi(FLAGS_viewport[0]);
viewport.fHeight = atoi(FLAGS_viewport[1]);
renderer->setViewport(viewport);
}
sk_tools::PictureRenderer::SkDeviceTypes deviceType =
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")) {