Add a "preferredInternalSampleCount" cap
This new cap tells Ganesh how many samples to use when performing
internal draws with MSAA or mixed samples. The default is always 4x,
but the client can change that with
GrContextOptions::fPreferredInternalMSAASampleCount.
Also adds a command line flag to viewer to control
fPreferredInternalMSAASampleCount.
Bug: skia:
Change-Id: Iba369273e802aa1bee796b576b3c18af347b0494
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221156
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/tools/viewer/Viewer.cpp b/tools/viewer/Viewer.cpp
index eb78473..ee994e5 100644
--- a/tools/viewer/Viewer.cpp
+++ b/tools/viewer/Viewer.cpp
@@ -93,6 +93,9 @@
static DEFINE_int(msaa, 1, "Number of subpixel samples. 0 for no HW antialiasing.");
+static DEFINE_int(internalSamples, 4,
+ "Number of samples for internal draws that use MSAA or mixed samples.");
+
static DEFINE_string(bisect, "", "Path to a .skp or .svg file to bisect.");
static DEFINE_string2(file, f, "", "Open a single file for viewing.");
@@ -295,6 +298,7 @@
displayParams.fGrContextOptions.fDisallowGLSLBinaryCaching = true;
displayParams.fGrContextOptions.fShaderErrorHandler = &gShaderErrorHandler;
displayParams.fGrContextOptions.fSuppressPrints = true;
+ displayParams.fGrContextOptions.fPreferredInternalSampleCount = FLAGS_internalSamples;
fWindow->setRequestedDisplayParams(displayParams);
// Configure timers