make options robust

Options used to rely on an external call to SanitizeOptions to
ensure they were correct. Now that defaults are set directly,
make sure that the values coming in make sense.

Change-Id: If6cfc027722b6a7717a920b482ec5be8f7526367
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296040
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
diff --git a/tests/SkRemoteGlyphCacheTest.cpp b/tests/SkRemoteGlyphCacheTest.cpp
index ef0124e..593c5e7 100644
--- a/tests/SkRemoteGlyphCacheTest.cpp
+++ b/tests/SkRemoteGlyphCacheTest.cpp
@@ -21,6 +21,7 @@
 #include "tools/ToolUtils.h"
 #include "tools/fonts/TestEmptyTypeface.h"
 
+#include "src/gpu/GrContextPriv.h"
 #include "src/gpu/GrRecordingContextPriv.h"
 #include "src/gpu/text/GrTextContext.h"
 
@@ -689,8 +690,8 @@
     // A scale transform forces fallback to dft.
     SkMatrix matrix = SkMatrix::Scale(16, 16);
     SkSurfaceProps surfaceProps(0, kUnknown_SkPixelGeometry);
-    GrTextContext::Options options;
-    GrTextContext::SanitizeOptions(&options);
+    GrTextContext::Options options =
+            ctxInfo.grContext()->priv().asRecordingContext()->priv().SDFTOptions();
     REPORTER_ASSERT(reporter, GrTextContext::CanDrawAsDistanceFields(
                                       paint, font, matrix, surfaceProps, true, options));