Turn on NVPR 4x MSAA by default when supported in DM and nanobench.
This brings DM and nanobench's default configs in line with GM's.
BUG=skia:
Review URL: https://codereview.chromium.org/704563003
diff --git a/dm/DMGpuGMTask.cpp b/dm/DMGpuGMTask.cpp
index fb170a2..2890483 100644
--- a/dm/DMGpuGMTask.cpp
+++ b/dm/DMGpuGMTask.cpp
@@ -22,6 +22,8 @@
, fSampleCount(sampleCount)
{}
+static bool gAlreadyWarned[GrContextFactory::kGLContextTypeCnt][kGrGLStandardCnt];
+
void GpuGMTask::draw(GrContextFactory* grFactory) {
SkImageInfo info = SkImageInfo::Make(SkScalarCeilToInt(fGM->width()),
SkScalarCeilToInt(fGM->height()),
@@ -30,7 +32,11 @@
SkAutoTUnref<SkSurface> surface(NewGpuSurface(grFactory, fContextType, fGpuAPI, info,
fSampleCount));
if (!surface) {
- this->fail("Could not create context for the config and the api.");
+ if (!gAlreadyWarned[fContextType][fGpuAPI]) {
+ SkDebugf("FYI: couldn't create GPU context, type %d API %d. Will skip.\n",
+ fContextType, fGpuAPI);
+ gAlreadyWarned[fContextType][fGpuAPI] = true;
+ }
return;
}
SkCanvas* canvas = surface->getCanvas();
diff --git a/dm/DMGpuSupport.h b/dm/DMGpuSupport.h
index af6270d..90b0ea5 100644
--- a/dm/DMGpuSupport.h
+++ b/dm/DMGpuSupport.h
@@ -36,6 +36,7 @@
kGL_GrGLStandard,
kGLES_GrGLStandard
};
+static const int kGrGLStandardCnt = 3;
class GrContextFactory {
public:
@@ -47,6 +48,7 @@
kNVPR_GLContextType = 0,
kNative_GLContextType = 0,
kNull_GLContextType = 0;
+ static const int kGLContextTypeCnt = 1;
void destroyContexts() {}
void abandonContexts() {}
diff --git a/include/gpu/gl/GrGLFunctions.h b/include/gpu/gl/GrGLFunctions.h
index dd62085..0b7beb6 100644
--- a/include/gpu/gl/GrGLFunctions.h
+++ b/include/gpu/gl/GrGLFunctions.h
@@ -22,6 +22,7 @@
kGL_GrGLStandard,
kGLES_GrGLStandard,
};
+static const int kGrGLStandardCnt = 3;
///////////////////////////////////////////////////////////////////////////////
diff --git a/tools/flags/SkCommonFlags.cpp b/tools/flags/SkCommonFlags.cpp
index 99d05c1..4d329c5 100644
--- a/tools/flags/SkCommonFlags.cpp
+++ b/tools/flags/SkCommonFlags.cpp
@@ -7,7 +7,7 @@
#include "SkCommonFlags.h"
-DEFINE_string(config, "565 8888 pdf gpu nonrendering angle",
+DEFINE_string(config, "565 8888 pdf gpu nonrendering angle nvprmsaa4",
"Options: 565 8888 pdf gpu nonrendering msaa4 msaa16 nvprmsaa4 nvprmsaa16 "
"gpunull gpudebug angle mesa");