Use 4x MSAA on Mac/Intel to avoid perf regression

On Mac/Intel, the default 8x MSAA causes huge performance regressions
specifically in WebGL contexts with {alpha:false,antialias:true}.

Add a workaround to fall back to 4x MSAA on Mac/Intel devices.

Adds pixel test suppressions that will be removed, after rebaseline,
in https://crrev.com/c/924310

TBR=kainino@chromium.org

Bug: 812071
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: Ifd2283f6b232371cb63d67a8641236073cb0b4da
Reviewed-on: https://chromium-review.googlesource.com/923103
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#537993}(cherry picked from commit 28cc4cd37aa9c4e27d882c249092098197920133)
Reviewed-on: https://chromium-review.googlesource.com/932007
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Cr-Commit-Position: refs/branch-heads/3325@{#552}
Cr-Branched-From: bc084a8b5afa3744a74927344e304c02ae54189f-refs/heads/master@{#530369}
diff --git a/content/test/gpu/gpu_tests/pixel_test_pages.py b/content/test/gpu/gpu_tests/pixel_test_pages.py
index 3705735..8161b65 100644
--- a/content/test/gpu/gpu_tests/pixel_test_pages.py
+++ b/content/test/gpu/gpu_tests/pixel_test_pages.py
@@ -82,7 +82,7 @@
       'pixel_webgl_aa_noalpha.html',
       base_name + '_WebGLGreenTriangle_AA_NoAlpha',
       test_rect=[0, 0, 300, 300],
-      revision=3),
+      revision=4),
 
     PixelTestPage(
       'pixel_webgl_noaa_noalpha.html',
@@ -129,7 +129,7 @@
       'pixel_canvas2d_webgl.html',
       base_name + '_2DCanvasWebGL',
       test_rect=[0, 0, 300, 300],
-      revision=5),
+      revision=6),
 
     PixelTestPage(
       'pixel_background.html',
@@ -444,14 +444,14 @@
       'pixel_offscreenCanvas_transfer_after_style_resize.html',
       base_name + '_OffscreenCanvasTransferAfterStyleResize',
       test_rect=[0, 0, 350, 350],
-      revision=4,
+      revision=5,
       browser_args=browser_args),
 
     PixelTestPage(
       'pixel_offscreenCanvas_transfer_before_style_resize.html',
       base_name + '_OffscreenCanvasTransferBeforeStyleResize',
       test_rect=[0, 0, 350, 350],
-      revision=4,
+      revision=5,
       browser_args=browser_args),
 
     PixelTestPage(
@@ -472,28 +472,28 @@
       'pixel_offscreenCanvas_webgl_commit_main.html',
       base_name + '_OffscreenCanvasWebGLDefault',
       test_rect=[0, 0, 360, 200],
-      revision=6,
+      revision=7,
       browser_args=browser_args),
 
     PixelTestPage(
       'pixel_offscreenCanvas_webgl_commit_worker.html',
       base_name + '_OffscreenCanvasWebGLDefaultWorker',
       test_rect=[0, 0, 360, 200],
-      revision=6,
+      revision=7,
       browser_args=browser_args),
 
     PixelTestPage(
       'pixel_offscreenCanvas_webgl_commit_main.html',
       base_name + '_OffscreenCanvasWebGLSoftwareCompositing',
       test_rect=[0, 0, 360, 200],
-      revision=6,
+      revision=7,
       browser_args=browser_args + ['--disable-gpu-compositing']),
 
     PixelTestPage(
       'pixel_offscreenCanvas_webgl_commit_worker.html',
       base_name + '_OffscreenCanvasWebGLSoftwareCompositingWorker',
       test_rect=[0, 0, 360, 200],
-      revision=6,
+      revision=7,
       browser_args=browser_args + ['--disable-gpu-compositing']),
 
     PixelTestPage(
@@ -549,7 +549,7 @@
       'pixel_offscreenCanvas_webgl_resize_on_worker.html',
       base_name + '_OffscreenCanvasWebglResizeOnWorker',
       test_rect=[0, 0, 200, 200],
-      revision=4,
+      revision=5,
       browser_args=browser_args),
 
     PixelTestPage(
@@ -612,7 +612,7 @@
       'pixel_webgl_aa_alpha.html',
       base_name + '_WebGLGreenTriangle_AA_Alpha' + suffix,
       test_rect=[0, 0, 300, 300],
-      revision=1,
+      revision=2,
       browser_args=browser_args),
   ]
 
@@ -657,7 +657,7 @@
       'pixel_canvas2d_webgl.html',
       base_name + '_IOSurface2DCanvasWebGL',
       test_rect=[0, 0, 300, 300],
-      revision=3,
+      revision=4,
       browser_args=iosurface_2d_canvas_args),
 
     # On macOS, test WebGL non-Chromium Image compositing path.
@@ -665,7 +665,7 @@
       'pixel_webgl_aa_alpha.html',
       base_name + '_WebGLGreenTriangle_NonChromiumImage_AA_Alpha',
       test_rect=[0, 0, 300, 300],
-      revision=2,
+      revision=3,
       browser_args=non_chromium_image_args),
     PixelTestPage(
       'pixel_webgl_noaa_alpha.html',
@@ -677,7 +677,7 @@
       'pixel_webgl_aa_noalpha.html',
       base_name + '_WebGLGreenTriangle_NonChromiumImage_AA_NoAlpha',
       test_rect=[0, 0, 300, 300],
-      revision=2,
+      revision=3,
       browser_args=non_chromium_image_args),
     PixelTestPage(
       'pixel_webgl_noaa_noalpha.html',
diff --git a/gpu/config/gpu_driver_bug_list.json b/gpu/config/gpu_driver_bug_list.json
index ec00c3a..0b1ed08 100644
--- a/gpu/config/gpu_driver_bug_list.json
+++ b/gpu/config/gpu_driver_bug_list.json
@@ -2819,6 +2819,19 @@
       "features": [
         "dont_use_loops_to_initialize_variables"
       ]
+    },
+    {
+      "id": 259,
+      "description": "8x MSAA is slow for alpha:false WebGL contexts on Mac Intel",
+      "cr_bugs": [812071],
+      "os": {
+        "type": "macosx"
+      },
+      "vendor_id": "0x8086",
+      "multi_gpu_category": "primary",
+      "features": [
+        "max_msaa_sample_count_4"
+      ]
     }
   ]
 }