Don't use MIP filter mode on compressed textures

Add compressed texture image downsample GMs

BUG=chromium:426331

Review URL: https://codereview.chromium.org/672863003
diff --git a/expectations/gm/ignored-tests.txt b/expectations/gm/ignored-tests.txt
index 900f085..976a2a8 100644
--- a/expectations/gm/ignored-tests.txt
+++ b/expectations/gm/ignored-tests.txt
@@ -39,6 +39,9 @@
 # robertphillips - skia:2995
 blurrects
 
+#bsalomon changes after fixing crbug.com/426331
+bitmapfilters
+
 # derekf https://codereview.chromium.org/639523002/
 simpleblurroundrect
 blurrects
diff --git a/gm/downsamplebitmap.cpp b/gm/downsamplebitmap.cpp
index 19faaa0..1d204fc 100644
--- a/gm/downsamplebitmap.cpp
+++ b/gm/downsamplebitmap.cpp
@@ -194,15 +194,23 @@
 DEF_GM( return new DownsampleBitmapTextGM(72, SkPaint::kHigh_FilterLevel); )
 DEF_GM( return new DownsampleBitmapCheckerboardGM(512,256, SkPaint::kHigh_FilterLevel); )
 DEF_GM( return new DownsampleBitmapImageGM("mandrill_512.png", SkPaint::kHigh_FilterLevel); )
+DEF_GM( return new DownsampleBitmapImageGM("mandrill_132x132_12x12.astc",
+                                            SkPaint::kHigh_FilterLevel); )
 
 DEF_GM( return new DownsampleBitmapTextGM(72, SkPaint::kMedium_FilterLevel); )
 DEF_GM( return new DownsampleBitmapCheckerboardGM(512,256, SkPaint::kMedium_FilterLevel); )
 DEF_GM( return new DownsampleBitmapImageGM("mandrill_512.png", SkPaint::kMedium_FilterLevel); )
+DEF_GM( return new DownsampleBitmapImageGM("mandrill_132x132_12x12.astc",
+                                           SkPaint::kMedium_FilterLevel); )
 
 DEF_GM( return new DownsampleBitmapTextGM(72, SkPaint::kLow_FilterLevel); )
 DEF_GM( return new DownsampleBitmapCheckerboardGM(512,256, SkPaint::kLow_FilterLevel); )
 DEF_GM( return new DownsampleBitmapImageGM("mandrill_512.png", SkPaint::kLow_FilterLevel); )
+DEF_GM( return new DownsampleBitmapImageGM("mandrill_132x132_12x12.astc",
+                                           SkPaint::kLow_FilterLevel); )
 
 DEF_GM( return new DownsampleBitmapTextGM(72, SkPaint::kNone_FilterLevel); )
 DEF_GM( return new DownsampleBitmapCheckerboardGM(512,256, SkPaint::kNone_FilterLevel); )
 DEF_GM( return new DownsampleBitmapImageGM("mandrill_512.png", SkPaint::kNone_FilterLevel); )
+DEF_GM( return new DownsampleBitmapImageGM("mandrill_132x132_12x12.astc",
+                                           SkPaint::kNone_FilterLevel); )
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp
index 209edaa..c83a668 100644
--- a/src/gpu/gl/GrGpuGL.cpp
+++ b/src/gpu/gl/GrGpuGL.cpp
@@ -2053,14 +2053,18 @@
         GR_GL_LINEAR
     };
     GrTextureParams::FilterMode filterMode = params.filterMode();
-    if (!this->caps()->mipMapSupport() && GrTextureParams::kMipMap_FilterMode == filterMode) {
-        filterMode = GrTextureParams::kBilerp_FilterMode;
+
+    if (GrTextureParams::kMipMap_FilterMode == filterMode) {
+        if (!this->caps()->mipMapSupport() || GrPixelConfigIsCompressed(texture->config())) {
+            filterMode = GrTextureParams::kBilerp_FilterMode;
+        }
     }
+
     newTexParams.fMinFilter = glMinFilterModes[filterMode];
     newTexParams.fMagFilter = glMagFilterModes[filterMode];
 
     if (GrTextureParams::kMipMap_FilterMode == filterMode &&
-        texture->texturePriv().mipMapsAreDirty() && !GrPixelConfigIsCompressed(texture->config())) {
+        texture->texturePriv().mipMapsAreDirty()) {
         GL_CALL(GenerateMipmap(GR_GL_TEXTURE_2D));
         texture->texturePriv().dirtyMipMaps(false);
     }