Don't use filter-quality

Bug: skia:11235
Change-Id: I184402f1c9d0f707ccfce761e3c5dbc3084e6c14
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362837
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
diff --git a/bench/GrMipmapBench.cpp b/bench/GrMipmapBench.cpp
index b16c23d..1ed5641 100644
--- a/bench/GrMipmapBench.cpp
+++ b/bench/GrMipmapBench.cpp
@@ -47,8 +47,9 @@
         // Clear surface once:
         fSurface->getCanvas()->clear(SK_ColorBLACK);
 
+        SkSamplingOptions sampling(SkFilterMode::kLinear,
+                                   SkMipmapMode::kLinear);
         SkPaint paint;
-        paint.setFilterQuality(kMedium_SkFilterQuality);
         paint.setColor(SK_ColorWHITE);
         for (int i = 0; i < loops; i++) {
             // Touch surface so mips are dirtied
@@ -57,7 +58,7 @@
             // Draw reduced version of surface to original canvas, to trigger mip generation
             canvas->save();
             canvas->scale(0.1f, 0.1f);
-            canvas->drawImage(fSurface->makeImageSnapshot(), 0, 0, SkSamplingOptions(), &paint);
+            canvas->drawImage(fSurface->makeImageSnapshot(), 0, 0, sampling, &paint);
             canvas->restore();
         }
     }
diff --git a/gm/blurquickreject.cpp b/gm/blurquickreject.cpp
index e309be4..022ac70 100644
--- a/gm/blurquickreject.cpp
+++ b/gm/blurquickreject.cpp
@@ -64,7 +64,6 @@
         hairlinePaint.setStrokeWidth(0);
 
         SkPaint blurPaint;
-        blurPaint.setFilterQuality(kLow_SkFilterQuality);
         blurPaint.setMaskFilter(SkMaskFilter::MakeBlur(kNormal_SkBlurStyle,
                                                     SkBlurMask::ConvertRadiusToSigma(kBlurRadius)));
 
diff --git a/gm/compositor_quads.cpp b/gm/compositor_quads.cpp
index 8d6dfbe..01d964a 100644
--- a/gm/compositor_quads.cpp
+++ b/gm/compositor_quads.cpp
@@ -969,7 +969,6 @@
 
         SkPaint paint;
         paint.setAntiAlias(true);
-        paint.setFilterQuality(kLow_SkFilterQuality);
         paint.setBlendMode(SkBlendMode::kSrcOver);
 
         canvas->experimental_DrawEdgeAAImageSet(
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 9f8439f..5e0ca4f 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1889,9 +1889,6 @@
     SkPaint cleaned;
     if (paint) {
         cleaned = *paint;
-        if (paint->getFilterQuality() > kLow_SkFilterQuality) {
-            cleaned.setFilterQuality(kLow_SkFilterQuality);
-        }
         cleaned.setMaskFilter(nullptr);
         cleaned.setAntiAlias(false);
     }
diff --git a/src/effects/SkShaderMaskFilter.cpp b/src/effects/SkShaderMaskFilter.cpp
index 6fd4062..b9a3617 100644
--- a/src/effects/SkShaderMaskFilter.cpp
+++ b/src/effects/SkShaderMaskFilter.cpp
@@ -99,7 +99,6 @@
 
     SkPaint paint;
     paint.setShader(fShader);
-    paint.setFilterQuality(SkFilterQuality::kLow_SkFilterQuality);
     // this blendmode is the trick: we only draw the shader where the mask is
     paint.setBlendMode(SkBlendMode::kSrcIn);
 
diff --git a/tests/PaintTest.cpp b/tests/PaintTest.cpp
index ba43b4d..c37bf1f 100644
--- a/tests/PaintTest.cpp
+++ b/tests/PaintTest.cpp
@@ -20,29 +20,6 @@
 #include "tests/Test.h"
 #undef ASSERT
 
-// temparary api for bicubic, just be sure we can set/clear it
-DEF_TEST(Paint_filterQuality, reporter) {
-    SkPaint p0, p1;
-
-    REPORTER_ASSERT(reporter, kNone_SkFilterQuality == p0.getFilterQuality());
-
-    static const SkFilterQuality gQualitys[] = {
-        kNone_SkFilterQuality,
-        kLow_SkFilterQuality,
-        kMedium_SkFilterQuality,
-        kHigh_SkFilterQuality
-    };
-    for (size_t i = 0; i < SK_ARRAY_COUNT(gQualitys); ++i) {
-        p0.setFilterQuality(gQualitys[i]);
-        REPORTER_ASSERT(reporter, gQualitys[i] == p0.getFilterQuality());
-        p1 = p0;
-        REPORTER_ASSERT(reporter, gQualitys[i] == p1.getFilterQuality());
-
-        p0.reset();
-        REPORTER_ASSERT(reporter, kNone_SkFilterQuality == p0.getFilterQuality());
-    }
-}
-
 DEF_TEST(Paint_copy, reporter) {
     SkPaint paint;
     // set a few member variables
@@ -104,12 +81,6 @@
 }
 
 DEF_TEST(Paint_flattening, reporter) {
-    const SkFilterQuality levels[] = {
-        kNone_SkFilterQuality,
-        kLow_SkFilterQuality,
-        kMedium_SkFilterQuality,
-        kHigh_SkFilterQuality,
-    };
     const SkPaint::Cap caps[] = {
         SkPaint::kButt_Cap,
         SkPaint::kRound_Cap,
@@ -135,7 +106,6 @@
 
     // we don't serialize hinting or encoding -- soon to be removed from paint
 
-    FOR_SETUP(i, levels, setFilterQuality)
     FOR_SETUP(l, caps, setStrokeCap)
     FOR_SETUP(m, joins, setStrokeJoin)
     FOR_SETUP(p, styles, setStyle)
@@ -151,7 +121,7 @@
     SkPaintPriv::Unflatten(&paint2, reader, nullptr);
     REPORTER_ASSERT(reporter, paint2 == paint);
 
-    }}}}
+    }}}
 #undef FOR_SETUP
 
 }
diff --git a/tools/viewer/Viewer.cpp b/tools/viewer/Viewer.cpp
index 7a2dd0c..81746e8 100644
--- a/tools/viewer/Viewer.cpp
+++ b/tools/viewer/Viewer.cpp
@@ -951,22 +951,6 @@
 
     paintFlag(&SkPaintFields::fAntiAlias, &SkPaint::isAntiAlias, "Antialias", "Alias");
     paintFlag(&SkPaintFields::fDither, &SkPaint::isDither, "DITHER", "No Dither");
-    if (fPaintOverrides.fFilterQuality) {
-        switch (fPaint.getFilterQuality()) {
-            case kNone_SkFilterQuality:
-                paintTitle.append("NoFilter");
-                break;
-            case kLow_SkFilterQuality:
-                paintTitle.append("LowFilter");
-                break;
-            case kMedium_SkFilterQuality:
-                paintTitle.append("MediumFilter");
-                break;
-            case kHigh_SkFilterQuality:
-                paintTitle.append("HighFilter");
-                break;
-        }
-    }
 
     fontFlag(&SkFontFields::fForceAutoHinting, &SkFont::isForceAutoHinting,
              "Force Autohint", "No Force Autohint");
@@ -1370,9 +1354,6 @@
         if (fPaintOverrides->fDither) {
             paint.setDither(fPaint->isDither());
         }
-        if (fPaintOverrides->fFilterQuality) {
-            paint.setFilterQuality(fPaint->getFilterQuality());
-        }
         return true;
     }
     SkPaint* fPaint;
@@ -2016,23 +1997,6 @@
                           "Default\0No Dither\0Dither\0\0",
                           &SkPaintFields::fDither,
                           &SkPaint::isDither, &SkPaint::setDither);
-
-                int filterQualityIdx = 0;
-                if (fPaintOverrides.fFilterQuality) {
-                    filterQualityIdx = SkTo<int>(fPaint.getFilterQuality()) + 1;
-                }
-                if (ImGui::Combo("Filter Quality", &filterQualityIdx,
-                                 "Default\0None\0Low\0Medium\0High\0\0"))
-                {
-                    if (filterQualityIdx == 0) {
-                        fPaintOverrides.fFilterQuality = false;
-                        fPaint.setFilterQuality(kNone_SkFilterQuality);
-                    } else {
-                        fPaint.setFilterQuality(SkTo<SkFilterQuality>(filterQualityIdx - 1));
-                        fPaintOverrides.fFilterQuality = true;
-                    }
-                    paramsChanged = true;
-                }
             }
 
             if (ImGui::CollapsingHeader("Font")) {
diff --git a/tools/viewer/Viewer.h b/tools/viewer/Viewer.h
index 52d4493..ae5b8b6 100644
--- a/tools/viewer/Viewer.h
+++ b/tools/viewer/Viewer.h
@@ -90,7 +90,6 @@
         bool fCapType = false;
         bool fJoinType = false;
         bool fStyle = false;
-        bool fFilterQuality = false;
     };
     struct SkSurfacePropsFields {
         bool fFlags = false;