Add nvprmsaa4 and nvprmsaa16 configs to bench_pictures
Add nvprmsaa4 and nvprmsaa16 configs to bench_pictures.
R=bsalomon@google.com
Author: kkinnunen@nvidia.com
Review URL: https://codereview.chromium.org/189263012
git-svn-id: http://skia.googlecode.com/svn/trunk@13708 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tools/PictureRenderer.cpp b/tools/PictureRenderer.cpp
index 6d9ce62..35b1b61 100644
--- a/tools/PictureRenderer.cpp
+++ b/tools/PictureRenderer.cpp
@@ -152,7 +152,8 @@
case kMesa_DeviceType:
// fall through
#endif
- case kGPU_DeviceType: {
+ case kGPU_DeviceType:
+ case kNVPR_DeviceType: {
SkAutoTUnref<GrSurface> target;
if (fGrContext) {
// create a render target to back the device
diff --git a/tools/PictureRenderer.h b/tools/PictureRenderer.h
index 6739277..5d30e5b 100644
--- a/tools/PictureRenderer.h
+++ b/tools/PictureRenderer.h
@@ -75,6 +75,7 @@
kBitmap_DeviceType,
#if SK_SUPPORT_GPU
kGPU_DeviceType,
+ kNVPR_DeviceType,
#endif
};
@@ -176,6 +177,9 @@
case kGPU_DeviceType:
// Already set to GrContextFactory::kNative_GLContextType, above.
break;
+ case kNVPR_DeviceType:
+ glContextType = GrContextFactory::kNVPR_GLContextType;
+ break;
#if SK_ANGLE
case kAngle_DeviceType:
glContextType = GrContextFactory::kANGLE_GLContextType;
@@ -262,6 +266,9 @@
config.append("_gpu");
}
break;
+ case kNVPR_DeviceType:
+ config.appendf("_nvprmsaa%d", fSampleCount);
+ break;
#if SK_ANGLE
case kAngle_DeviceType:
config.append("_angle");
@@ -285,6 +292,7 @@
bool isUsingGpuDevice() {
switch (fDeviceType) {
case kGPU_DeviceType:
+ case kNVPR_DeviceType:
// fall through
#if SK_ANGLE
case kAngle_DeviceType:
@@ -306,6 +314,9 @@
case kGPU_DeviceType:
glContextType = GrContextFactory::kNative_GLContextType;
break;
+ case kNVPR_DeviceType:
+ glContextType = GrContextFactory::kNVPR_GLContextType;
+ break;
#if SK_ANGLE
case kAngle_DeviceType:
glContextType = GrContextFactory::kANGLE_GLContextType;
diff --git a/tools/PictureRenderingFlags.cpp b/tools/PictureRenderingFlags.cpp
index c522653..0c4bc75 100644
--- a/tools/PictureRenderingFlags.cpp
+++ b/tools/PictureRenderingFlags.cpp
@@ -26,7 +26,7 @@
#if SK_SUPPORT_GPU
-#define GPU_CONFIG_STRING "|gpu|msaa4|msaa16"
+#define GPU_CONFIG_STRING "|gpu|msaa4|msaa16|nvprmsaa4|nvprmsaa16"
#else
#define GPU_CONFIG_STRING ""
#endif
@@ -289,6 +289,22 @@
}
sampleCount = 16;
}
+ else if (0 == strcmp(FLAGS_config[0], "nvprmsaa4")) {
+ deviceType = sk_tools::PictureRenderer::kNVPR_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], "nvprmsaa16")) {
+ deviceType = sk_tools::PictureRenderer::kNVPR_DeviceType;
+ if (FLAGS_multi > 1) {
+ error.printf("GPU not compatible with multithreaded tiling.\n");
+ return NULL;
+ }
+ sampleCount = 16;
+ }
#if SK_ANGLE
else if (0 == strcmp(FLAGS_config[0], "angle")) {
deviceType = sk_tools::PictureRenderer::kAngle_DeviceType;