Firefox 93.0 firefox93
authorWolfgang Rosenauer <wr@rosenauer.org>
Sun, 17 Oct 2021 20:19:48 +0200
branchfirefox93
changeset 1164 bb219fd0d646
parent 1163 849d6343405b
child 1165 e009fde1282b
Firefox 93.0
MozillaFirefox/MozillaFirefox.changes
MozillaFirefox/MozillaFirefox.spec
MozillaFirefox/mozilla-bmo1708709.patch
MozillaFirefox/mozilla-bmo531915.patch
MozillaFirefox/mozilla-disable-wasm-emulate-arm-unaligned-fp-access.patch
MozillaFirefox/tar_stamps
firefox-branded-icons.patch
mozilla-bmo1708709.patch
mozilla-bmo1725828.patch
mozilla-bmo531915.patch
mozilla-disable-wasm-emulate-arm-unaligned-fp-access.patch
mozilla-kde.patch
mozilla-s390-context.patch
mozilla-sandbox-fips.patch
mozilla-silence-no-return-type.patch
series
--- a/MozillaFirefox/MozillaFirefox.changes	Fri Oct 01 12:00:20 2021 +0200
+++ b/MozillaFirefox/MozillaFirefox.changes	Sun Oct 17 20:19:48 2021 +0200
@@ -1,10 +1,42 @@
 -------------------------------------------------------------------
-Thu Sep 30 10:23:09 UTC 2021 - Wolfgang Rosenauer <wr@rosenauer.org>
-
+Fri Oct  1 18:33:33 UTC 2021 - Wolfgang Rosenauer <wr@rosenauer.org>
+
+- Mozilla Firefox 93.0
+  * supports the new AVIF image format
+  * PDF viewer now supports filling more forms (XFA-based forms)
+  * now blocks downloads that rely on insecure connections,
+    protecting against potentially malicious or unsafe downloads
+  * Improved web compatibility for privacy protections with SmartBlock 3.0
+  * Introducing a new referrer tracking protection in Strict Tracking
+    Protection and Private Browsing
+  * TLS ciphersuites that use 3DES have been disabled. Such
+    ciphersuites can only be enabled when deprecated versions of
+    TLS are also enabled
+  * The download panel now follows the Firefox visual styles
+  MFSA 2021-43 (bsc#1191332)
+  * CVE-2021-38496 (bmo#1725335)
+    Use-after-free in MessageTask
+  * CVE-2021-38497 (bmo#1726621)
+    Validation message could have been overlaid on another origin
+  * CVE-2021-38498 (bmo#1729642)
+    Use-after-free of nsLanguageAtomService object
+  * CVE-2021-32810 (bmo#1729813)
+    https://github.com/crossbeam-rs/crossbeam/security/advisories/GHSA-pqqp-xmhj-wgcw)
+    Data race in crossbeam-deque
+  * CVE-2021-38500 (bmo#1725854, bmo#1728321)
+    Memory safety bugs fixed in Firefox 93, Firefox ESR 78.15,
+    and Firefox ESR 91.2
+  * CVE-2021-38501 (bmo#1685354, bmo#1715755, bmo#1723176)
+    Memory safety bugs fixed in Firefox 93 and Firefox ESR 91.2
+  * CVE-2021-38499 (bmo#1667102, bmo#1723170, bmo#1725356, bmo#1727364)
+    Memory safety bugs fixed in Firefox 93
+- removed obsolete mozilla-bmo1708709.patch
+- require NSS >= 3.70
 - allow to override wayland detection by defining MOZ_ENABLE_WAYLAND
   explicitely as 0 or 1
 - fix aarch64 build by updating constraints
 - add mozilla-bmo1725828.patch to fix widevine (bsc#1190842)
+- add mozilla-bmo531915.patch to fix build for i586
 
 -------------------------------------------------------------------
 Sat Sep 25 10:10:56 UTC 2021 - Andreas Stieger <andreas.stieger@gmx.de>
--- a/MozillaFirefox/MozillaFirefox.spec	Fri Oct 01 12:00:20 2021 +0200
+++ b/MozillaFirefox/MozillaFirefox.spec	Sun Oct 17 20:19:48 2021 +0200
@@ -28,9 +28,9 @@
 # orig_suffix b3
 # major 69
 # mainver %major.99
-%define major          92
-%define mainver        %major.0.1
-%define orig_version   92.0.1
+%define major          93
+%define mainver        %major.0
+%define orig_version   93.0
 %define orig_suffix    %{nil}
 %define update_channel release
 %define branding       1
@@ -118,7 +118,7 @@
 BuildRequires:  libproxy-devel
 BuildRequires:  makeinfo
 BuildRequires:  mozilla-nspr-devel >= 4.32
-BuildRequires:  mozilla-nss-devel >= 3.69.1
+BuildRequires:  mozilla-nss-devel >= 3.70
 BuildRequires:  nasm >= 2.14
 BuildRequires:  nodejs >= 10.22.1
 %if 0%{?sle_version} >= 120000 && 0%{?sle_version} < 150000
@@ -224,9 +224,9 @@
 Patch26:        mozilla-bmo1626236.patch
 Patch27:        mozilla-s390x-skia-gradient.patch
 Patch28:        mozilla-libavcodec58_91.patch
-Patch29:        mozilla-bmo1708709.patch
-Patch30:        mozilla-silence-no-return-type.patch
-Patch31:        mozilla-bmo1725828.patch
+Patch29:        mozilla-silence-no-return-type.patch
+Patch30:        mozilla-bmo1725828.patch
+Patch31:        mozilla-bmo531915.patch
 # Firefox/browser
 Patch101:       firefox-kde.patch
 Patch102:       firefox-branded-icons.patch
--- a/MozillaFirefox/mozilla-bmo1708709.patch	Fri Oct 01 12:00:20 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-../mozilla-bmo1708709.patch
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MozillaFirefox/mozilla-bmo531915.patch	Sun Oct 17 20:19:48 2021 +0200
@@ -0,0 +1,1 @@
+../mozilla-bmo531915.patch
\ No newline at end of file
--- a/MozillaFirefox/mozilla-disable-wasm-emulate-arm-unaligned-fp-access.patch	Fri Oct 01 12:00:20 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-../mozilla-disable-wasm-emulate-arm-unaligned-fp-access.patch
\ No newline at end of file
--- a/MozillaFirefox/tar_stamps	Fri Oct 01 12:00:20 2021 +0200
+++ b/MozillaFirefox/tar_stamps	Sun Oct 17 20:19:48 2021 +0200
@@ -1,10 +1,10 @@
 PRODUCT="firefox"
 CHANNEL="release"
-VERSION="92.0.1"
+VERSION="93.0"
 VERSION_SUFFIX=""
-PREV_VERSION="92.0"
+PREV_VERSION="92.0.1"
 PREV_VERSION_SUFFIX=""
 #SKIP_LOCALES="" # Uncomment to skip l10n and compare-locales-generation
 RELEASE_REPO="https://hg.mozilla.org/releases/mozilla-release"
-RELEASE_TAG="d7bbc5812f7f36a9378165fffd7a058ddb0118ec"
-RELEASE_TIMESTAMP="20210922161155"
+RELEASE_TAG="08b69dc588fbdd88334ebcb6fa303eec95176cd6"
+RELEASE_TIMESTAMP="20210927210923"
--- a/firefox-branded-icons.patch	Fri Oct 01 12:00:20 2021 +0200
+++ b/firefox-branded-icons.patch	Sun Oct 17 20:19:48 2021 +0200
@@ -1,6 +1,6 @@
 # HG changeset patch
 # Parent e0751ad74e835e80041a61ea00c2a63bf6fbe2de
-# Parent  fe8ed2b997914bef9446d854a4c189fb69394bac
+# Parent  30e1a232528000620a3874de06ea515e5ef8e77f
 
 diff --git a/browser/branding/branding-common.mozbuild b/browser/branding/branding-common.mozbuild
 --- a/browser/branding/branding-common.mozbuild
@@ -24,13 +24,13 @@
 diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in
 --- a/browser/installer/package-manifest.in
 +++ b/browser/installer/package-manifest.in
-@@ -252,20 +252,23 @@
+@@ -236,20 +236,23 @@
+ @RESPATH@/browser/chrome/browser@JAREXT@
+ @RESPATH@/browser/chrome/browser.manifest
  @RESPATH@/chrome/pdfjs.manifest
  @RESPATH@/chrome/pdfjs/*
  @RESPATH@/chrome/toolkit@JAREXT@
  @RESPATH@/chrome/toolkit.manifest
- @RESPATH@/chrome/recording.manifest
- @RESPATH@/chrome/recording/*
  #ifdef MOZ_GTK
  @RESPATH@/browser/chrome/icons/default/default16.png
 +@RESPATH@/browser/chrome/icons/default/default22.png
--- a/mozilla-bmo1708709.patch	Fri Oct 01 12:00:20 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,201 +0,0 @@
-Index: firefox-91.0.2/dom/xul/XULPopupElement.cpp
-===================================================================
---- firefox-91.0.2.orig/dom/xul/XULPopupElement.cpp
-+++ firefox-91.0.2/dom/xul/XULPopupElement.cpp
-@@ -271,8 +271,7 @@ already_AddRefed<DOMRect> XULPopupElemen
-     // For native menus we can't query the true size. Use the anchor rect
-     // instead, which at least has the position at which we were intending to
-     // open the menu.
--    screenRect = Some(CSSRect(
--        CSSIntRect::FromUnknownRect(menuPopupFrame->GetScreenAnchorRect())));
-+    screenRect = Some(CSSRect(menuPopupFrame->GetScreenAnchorRect()));
-   } else {
-     // For non-native menus, query the bounds from the widget.
-     if (nsView* view = menuPopupFrame->GetView()) {
-Index: firefox-91.0.2/layout/xul/nsMenuPopupFrame.h
-===================================================================
---- firefox-91.0.2.orig/layout/xul/nsMenuPopupFrame.h
-+++ firefox-91.0.2/layout/xul/nsMenuPopupFrame.h
-@@ -321,7 +321,7 @@ class nsMenuPopupFrame final : public ns
-   // If aUpdateAttrs is true, and the popup already has left or top attributes,
-   // then those attributes are updated to the new location.
-   // The frame may be destroyed by this method.
--  void MoveTo(const mozilla::CSSIntPoint& aPos, bool aUpdateAttrs);
-+  void MoveTo(const mozilla::CSSPoint& aPos, bool aUpdateAttrs);
- 
-   void MoveToAnchor(nsIContent* aAnchorContent, const nsAString& aPosition,
-                     int32_t aXPos, int32_t aYPos, bool aAttributesOverride);
-@@ -370,7 +370,9 @@ class nsMenuPopupFrame final : public ns
- 
-   // Return the screen coordinates in CSS pixels of the popup,
-   // or (-1, -1, 0, 0) if anchored.
--  nsIntRect GetScreenAnchorRect() const { return mScreenRect; }
-+  mozilla::CSSIntRect GetScreenAnchorRect() const {
-+    return mozilla::CSSRect::FromAppUnitsRounded(mScreenRect);
-+  }
- 
-   mozilla::LayoutDeviceIntPoint GetLastClientOffset() const {
-     return mLastClientOffset;
-@@ -557,7 +559,7 @@ class nsMenuPopupFrame final : public ns
-   // override mXPos and mYPos.
-   int32_t mXPos;
-   int32_t mYPos;
--  nsIntRect mScreenRect;
-+  nsRect mScreenRect;
-   // Used for store rectangle which the popup is going to be anchored to,
-   // we need that for Wayland
- #ifdef MOZ_WAYLAND
-Index: firefox-91.0.2/layout/xul/nsMenuPopupFrame.cpp
-===================================================================
---- firefox-91.0.2.orig/layout/xul/nsMenuPopupFrame.cpp
-+++ firefox-91.0.2/layout/xul/nsMenuPopupFrame.cpp
-@@ -868,8 +868,9 @@ void nsMenuPopupFrame::InitializePopup(n
-       InitPositionFromAnchorAlign(anchor, align);
-     }
-   }
--
--  mScreenRect = nsIntRect(-1, -1, 0, 0);
-+  // When converted back to CSSIntRect it is (-1, -1, 0, 0) - as expected in
-+  // nsXULPopupManager::Rollup
-+  mScreenRect = nsRect(-AppUnitsPerCSSPixel(), -AppUnitsPerCSSPixel(), 0, 0);
- 
-   if (aAttributesOverride) {
-     // Use |left| and |top| dimension attributes to position the popup if
-@@ -881,11 +882,13 @@ void nsMenuPopupFrame::InitializePopup(n
-     nsresult err;
-     if (!left.IsEmpty()) {
-       int32_t x = left.ToInteger(&err);
--      if (NS_SUCCEEDED(err)) mScreenRect.x = x;
-+      if (NS_SUCCEEDED(err))
-+        mScreenRect.x = nsPresContext::CSSPixelsToAppUnits(x);
-     }
-     if (!top.IsEmpty()) {
-       int32_t y = top.ToInteger(&err);
--      if (NS_SUCCEEDED(err)) mScreenRect.y = y;
-+      if (NS_SUCCEEDED(err))
-+        mScreenRect.y = nsPresContext::CSSPixelsToAppUnits(y);
-     }
-   }
- }
-@@ -900,7 +903,8 @@ void nsMenuPopupFrame::InitializePopupAt
-   mPopupState = ePopupShowing;
-   mAnchorContent = nullptr;
-   mTriggerContent = aTriggerContent;
--  mScreenRect = nsIntRect(aXPos, aYPos, 0, 0);
-+  mScreenRect = nsRect(nsPresContext::CSSPixelsToAppUnits(aXPos),
-+                       nsPresContext::CSSPixelsToAppUnits(aYPos), 0, 0);
-   mXPos = 0;
-   mYPos = 0;
-   mFlip = FlipType_Default;
-@@ -920,7 +924,8 @@ void nsMenuPopupFrame::InitializePopupAs
-   mTriggerContent = aTriggerContent;
-   mPopupState = ePopupShowing;
-   mAnchorContent = nullptr;
--  mScreenRect = nsIntRect(aXPos, aYPos, 0, 0);
-+  mScreenRect = nsRect(nsPresContext::CSSPixelsToAppUnits(aXPos),
-+                       nsPresContext::CSSPixelsToAppUnits(aYPos), 0, 0);
-   mXPos = 0;
-   mYPos = 0;
-   mFlip = FlipType_Default;
-@@ -941,7 +946,7 @@ void nsMenuPopupFrame::InitializePopupAt
-                                              bool aAttributesOverride) {
-   InitializePopup(nullptr, aTriggerContent, aPosition, 0, 0,
-                   MenuPopupAnchorType_Rect, aAttributesOverride);
--  mScreenRect = aRect;
-+  mScreenRect = ToAppUnits(aRect, AppUnitsPerCSSPixel());
- }
- 
- void nsMenuPopupFrame::ShowPopup(bool aIsContextMenu) {
-@@ -1430,7 +1435,7 @@ nsresult nsMenuPopupFrame::SetPopupPosit
-     // If anchored to a rectangle, use that rectangle. Otherwise, determine the
-     // rectangle from the anchor.
-     if (mAnchorType == MenuPopupAnchorType_Rect) {
--      anchorRect = ToAppUnits(mScreenRect, AppUnitsPerCSSPixel());
-+      anchorRect = mScreenRect;
-     } else {
-       // if the frame is not specified, use the anchor node passed to OpenPopup.
-       // If that wasn't specified either, use the root frame. Note that
-@@ -1539,10 +1544,8 @@ nsresult nsMenuPopupFrame::SetPopupPosit
-       // Account for the margin that will end up being added to the screen
-       // coordinate the next time SetPopupPosition is called.
-       mAnchorType = MenuPopupAnchorType_Point;
--      mScreenRect.x =
--          nsPresContext::AppUnitsToIntCSSPixels(screenPoint.x - margin.left);
--      mScreenRect.y =
--          nsPresContext::AppUnitsToIntCSSPixels(screenPoint.y - margin.top);
-+      mScreenRect.x = screenPoint.x - margin.left;
-+      mScreenRect.y = screenPoint.y - margin.top;
-     }
-   } else {
-     // The popup is positioned at a screen coordinate.
-@@ -1571,10 +1574,8 @@ nsresult nsMenuPopupFrame::SetPopupPosit
-     }
- 
-     // next, convert into app units accounting for the zoom
--    screenPoint.x = presContext->DevPixelsToAppUnits(
--        nsPresContext::CSSPixelsToAppUnits(mScreenRect.x) / factor);
--    screenPoint.y = presContext->DevPixelsToAppUnits(
--        nsPresContext::CSSPixelsToAppUnits(mScreenRect.y) / factor);
-+    screenPoint.x = presContext->DevPixelsToAppUnits(mScreenRect.x / factor);
-+    screenPoint.y = presContext->DevPixelsToAppUnits(mScreenRect.y / factor);
-     anchorRect = nsRect(screenPoint, nsSize(0, 0));
- 
-     // add the margins on the popup
-@@ -2377,9 +2378,10 @@ void nsMenuPopupFrame::DestroyFrom(nsIFr
-   nsBoxFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
- }
- 
--void nsMenuPopupFrame::MoveTo(const CSSIntPoint& aPos, bool aUpdateAttrs) {
-+void nsMenuPopupFrame::MoveTo(const CSSPoint& aPos, bool aUpdateAttrs) {
-   nsIWidget* widget = GetWidget();
--  if ((mScreenRect.x == aPos.x && mScreenRect.y == aPos.y) &&
-+  nsPoint appUnitsPos = mozilla::CSSPixel::ToAppUnits(aPos);
-+  if ((mScreenRect.x == appUnitsPos.x && mScreenRect.y == appUnitsPos.y) &&
-       (!widget || widget->GetClientOffset() == mLastClientOffset)) {
-     return;
-   }
-@@ -2400,8 +2402,8 @@ void nsMenuPopupFrame::MoveTo(const CSSI
-   }
- 
-   mAnchorType = MenuPopupAnchorType_Point;
--  mScreenRect.x = aPos.x - nsPresContext::AppUnitsToIntCSSPixels(margin.left);
--  mScreenRect.y = aPos.y - nsPresContext::AppUnitsToIntCSSPixels(margin.top);
-+  mScreenRect.x = appUnitsPos.x - margin.left;
-+  mScreenRect.y = appUnitsPos.y - margin.top;
- 
-   SetPopupPosition(nullptr, true, false);
- 
-@@ -2409,8 +2411,8 @@ void nsMenuPopupFrame::MoveTo(const CSSI
-   if (aUpdateAttrs && (popup->HasAttr(kNameSpaceID_None, nsGkAtoms::left) ||
-                        popup->HasAttr(kNameSpaceID_None, nsGkAtoms::top))) {
-     nsAutoString left, top;
--    left.AppendInt(aPos.x);
--    top.AppendInt(aPos.y);
-+    left.AppendInt(RoundedToInt(aPos).x);
-+    top.AppendInt(RoundedToInt(aPos).y);
-     popup->SetAttr(kNameSpaceID_None, nsGkAtoms::left, left, false);
-     popup->SetAttr(kNameSpaceID_None, nsGkAtoms::top, top, false);
-   }
-Index: firefox-91.0.2/layout/xul/nsXULPopupManager.cpp
-===================================================================
---- firefox-91.0.2.orig/layout/xul/nsXULPopupManager.cpp
-+++ firefox-91.0.2/layout/xul/nsXULPopupManager.cpp
-@@ -269,8 +269,7 @@ bool nsXULPopupManager::Rollup(uint32_t
-       if (popupFrame->IsAnchored()) {
-         // Check if the popup has a screen anchor rectangle. If not, get the
-         // rectangle from the anchor element.
--        anchorRect =
--            CSSIntRect::FromUnknownRect(popupFrame->GetScreenAnchorRect());
-+        anchorRect = popupFrame->GetScreenAnchorRect();
-         if (anchorRect.x == -1 || anchorRect.y == -1) {
-           nsCOMPtr<nsIContent> anchor = popupFrame->GetAnchor();
- 
-@@ -507,7 +506,7 @@ void nsXULPopupManager::PopupMoved(nsIFr
-   } else {
-     CSSPoint cssPos = LayoutDeviceIntPoint::FromUnknownPoint(aPnt) /
-                       menuPopupFrame->PresContext()->CSSToDevPixelScale();
--    menuPopupFrame->MoveTo(RoundedToInt(cssPos), false);
-+    menuPopupFrame->MoveTo(cssPos, false);
-   }
- }
- 
--- a/mozilla-bmo1725828.patch	Fri Oct 01 12:00:20 2021 +0200
+++ b/mozilla-bmo1725828.patch	Sun Oct 17 20:19:48 2021 +0200
@@ -1,5 +1,5 @@
 # HG changeset patch
-# Parent  95d077d47f452a241c5826b5aea762b549bb24ff
+# Parent  fbca0d2a522cd1ab78001476293d3d79bfabb4cf
 
 <!DOCTYPE html>
 <html lang='en'>
@@ -520,7 +520,7 @@
 diff --git a/dom/media/gmp/GMPParent.cpp b/dom/media/gmp/GMPParent.cpp
 --- a/dom/media/gmp/GMPParent.cpp
 +++ b/dom/media/gmp/GMPParent.cpp
-@@ -868,18 +868,31 @@ RefPtr<GenericPromise> GMPParent::ParseC
+@@ -871,16 +871,30 @@ RefPtr<GenericPromise> GMPParent::ParseC
      mLibs = "dxva2.dll"_ns;
  #endif
    } else {
@@ -543,8 +543,6 @@
 +  }
 +#endif
 +
-   GMPCapability video;
--
    nsCString codecsString = NS_ConvertUTF16toUTF8(m.mX_cdm_codecs);
    nsTArray<nsCString> codecs;
    SplitAt(",", codecsString, codecs);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mozilla-bmo531915.patch	Sun Oct 17 20:19:48 2021 +0200
@@ -0,0 +1,29 @@
+# HG changeset patch
+# User Wolfgang Rosenauer <wr@rosenauer.org>
+# Parent  7332dfc4c47d73f1b88850b7727d33096d68e329
+
+diff --git a/modules/fdlibm/src/math_private.h b/modules/fdlibm/src/math_private.h
+--- a/modules/fdlibm/src/math_private.h
++++ b/modules/fdlibm/src/math_private.h
+@@ -25,17 +25,21 @@
+ 
+ #include "mozilla/EndianUtils.h"
+ 
+ /*
+  * Emulate FreeBSD internal double types.
+  * Adapted from https://github.com/freebsd/freebsd-src/search?q=__double_t
+  */
+ 
++#ifdef __i386__
++typedef long double __double_t;
++#else
+ typedef double      __double_t;
++#endif
+ typedef __double_t  double_t;
+ 
+ /*
+  * The original fdlibm code used statements like:
+  *	n0 = ((*(int*)&one)>>29)^1;		* index of high word *
+  *	ix0 = *(n0+(int*)&x);			* high word of x *
+  *	ix1 = *((1-n0)+(int*)&x);		* low word of x *
+  * to dig two 32 bit words out of the 64 bit IEEE floating point
--- a/mozilla-disable-wasm-emulate-arm-unaligned-fp-access.patch	Fri Oct 01 12:00:20 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-# HG changeset patch
-# Parent  9bc02ee6567ae3f1dad1f8578e650c0a1faa0179
-
-diff --git a/js/src/wasm/WasmSignalHandlers.cpp b/js/src/wasm/WasmSignalHandlers.cpp
---- a/js/src/wasm/WasmSignalHandlers.cpp
-+++ b/js/src/wasm/WasmSignalHandlers.cpp
-@@ -240,17 +240,17 @@ using mozilla::DebugOnly;
- // Those definitions are however not present in the headers of every Linux
- // distro - Raspbian is known to be a problem, for example.  However those
- // distros are tier-3 platforms.
- //
- // If you run into compile problems on a tier-3 platform, you can disable the
- // emulation here.
- 
- #if defined(__linux__) && defined(__arm__)
--#  define WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS
-+// #  define WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS
- #endif
- 
- #ifdef WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS
- #  include <sys/user.h>
- #endif
- 
- #if defined(ANDROID)
- // Not all versions of the Android NDK define ucontext_t or mcontext_t.
--- a/mozilla-kde.patch	Fri Oct 01 12:00:20 2021 +0200
+++ b/mozilla-kde.patch	Sun Oct 17 20:19:48 2021 +0200
@@ -3,7 +3,7 @@
 # Date 1559294891 -7200
 #      Fri May 31 11:28:11 2019 +0200
 # Node ID c2aa7198fb925e7fde96abf65b6f68b9b755f112
-# Parent  c8bc6be5267f16016d506973a2d6a7c58a1cd441
+# Parent  0dd1b6436342922d434e7c818875b2a02a73b5ed
 Description: Add KDE integration to Firefox (toolkit parts)
 Author: Wolfgang Rosenauer <wolfgang@rosenauer.org>
 Author: Lubos Lunak <lunak@suse.com>
@@ -31,22 +31,12 @@
  #ifdef MOZ_MEMORY
  #  include "mozmemory.h"
  #endif
-@@ -4635,25 +4636,37 @@ nsresult Preferences::InitInitialObjects
-   // application pref files for backwards compatibility.
-   static const char* specialFiles[] = {
- #if defined(XP_MACOSX)
-     "macprefs.js"
- #elif defined(XP_WIN)
-     "winpref.js"
- #elif defined(XP_UNIX)
+@@ -4634,16 +4635,27 @@ nsresult Preferences::InitInitialObjects
      "unix.js"
-+    , "" // placeholder for KDE  (empty is otherwise harmless)
  #  if defined(_AIX)
      ,
      "aix.js"
  #  endif
- #elif defined(XP_BEOS)
-     "beos.js"
  #endif
    };
  
@@ -69,7 +59,7 @@
  
    // Load jar:$app/omni.jar!/defaults/preferences/*.js
    // or jar:$gre/omni.jar!/defaults/preferences/*.js.
-@@ -4718,17 +4731,17 @@ nsresult Preferences::InitInitialObjects
+@@ -4708,17 +4720,17 @@ nsresult Preferences::InitInitialObjects
        }
  
        nsCOMPtr<nsIFile> path = do_QueryInterface(elem);
@@ -91,7 +81,7 @@
 diff --git a/modules/libpref/moz.build b/modules/libpref/moz.build
 --- a/modules/libpref/moz.build
 +++ b/modules/libpref/moz.build
-@@ -117,16 +117,20 @@ EXPORTS.mozilla += [
+@@ -118,16 +118,20 @@ EXPORTS.mozilla += [
  ]
  EXPORTS.mozilla += sorted(["!" + g for g in gen_h])
  
@@ -356,7 +346,7 @@
 diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build
 --- a/toolkit/xre/moz.build
 +++ b/toolkit/xre/moz.build
-@@ -93,17 +93,19 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "co
+@@ -91,17 +91,19 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "co
          "../components/printingui",
      ]
  elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "uikit":
@@ -1214,7 +1204,7 @@
  #include "nsISupports.h"
  #include "nsString.h"
  #include "nsReadableUtils.h"
-@@ -1024,17 +1024,17 @@ nsresult nsOSHelperAppService::GetHandle
+@@ -1025,17 +1025,17 @@ nsresult nsOSHelperAppService::GetHandle
  
  nsresult nsOSHelperAppService::OSProtocolHandlerExists(
      const char* aProtocolScheme, bool* aHandlerExists) {
@@ -1233,7 +1223,7 @@
      nsCOMPtr<nsIHandlerService> handlerSvc =
          do_GetService(NS_HANDLERSERVICE_CONTRACTID, &rv);
      if (NS_SUCCEEDED(rv) && handlerSvc) {
-@@ -1044,17 +1044,17 @@ nsresult nsOSHelperAppService::OSProtoco
+@@ -1045,17 +1045,17 @@ nsresult nsOSHelperAppService::OSProtoco
    }
  
    return rv;
@@ -1252,7 +1242,7 @@
  
  NS_IMETHODIMP nsOSHelperAppService::IsCurrentAppOSDefaultForProtocol(
      const nsACString& aScheme, bool* _retval) {
-@@ -1147,17 +1147,17 @@ already_AddRefed<nsMIMEInfoBase> nsOSHel
+@@ -1148,17 +1148,17 @@ already_AddRefed<nsMIMEInfoBase> nsOSHel
    nsresult rv =
        LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt), majorType,
                                 minorType, mime_types_description, true);
@@ -1271,7 +1261,7 @@
  
      rv = LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt), majorType,
                                    minorType, mime_types_description, false);
-@@ -1258,17 +1258,17 @@ already_AddRefed<nsMIMEInfoBase> nsOSHel
+@@ -1261,17 +1261,17 @@ already_AddRefed<nsMIMEInfoBase> nsOSHel
  
    // Now look up our extensions
    nsAutoString extensions, mime_types_description;
@@ -1293,7 +1283,7 @@
 diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build
 --- a/widget/gtk/moz.build
 +++ b/widget/gtk/moz.build
-@@ -136,16 +136,17 @@ FINAL_LIBRARY = "xul"
+@@ -137,16 +137,17 @@ FINAL_LIBRARY = "xul"
  
  LOCAL_INCLUDES += [
      "/layout/base",
@@ -1855,7 +1845,7 @@
  #  include "prmem.h"
  #  include "plbase64.h"
  
-@@ -2021,62 +2022,77 @@ nsLocalFile::SetPersistentDescriptor(con
+@@ -2023,62 +2024,77 @@ nsLocalFile::SetPersistentDescriptor(con
  
  NS_IMETHODIMP
  nsLocalFile::Reveal() {
--- a/mozilla-s390-context.patch	Fri Oct 01 12:00:20 2021 +0200
+++ b/mozilla-s390-context.patch	Sun Oct 17 20:19:48 2021 +0200
@@ -3,54 +3,51 @@
 # Date 1558452408 -7200
 #      Tue May 21 17:26:48 2019 +0200
 # Node ID 602e92722e765a3c238d3b96b26c0c8063b5eeb4
-# Parent  cb0089687ab899846b8229c3741261d50101340e
+# Parent  60715122a04aad06b33ad7259f1bde19803230da
 [mq]: mozilla-s390-context.patch
 
 diff --git a/js/src/wasm/WasmSignalHandlers.cpp b/js/src/wasm/WasmSignalHandlers.cpp
 --- a/js/src/wasm/WasmSignalHandlers.cpp
 +++ b/js/src/wasm/WasmSignalHandlers.cpp
-@@ -150,16 +150,20 @@ using mozilla::DebugOnly;
- #    define FP_sig(p) ((p)->uc_mcontext.mc_fp)
- #    define SP_sig(p) ((p)->uc_mcontext.mc_i7)
- #  endif
- #  if defined(__linux__) && (defined(__ppc64__) || defined(__PPC64__) || \
-                              defined(__ppc64le__) || defined(__PPC64LE__))
- #    define R01_sig(p) ((p)->uc_mcontext.gp_regs[1])
- #    define R32_sig(p) ((p)->uc_mcontext.gp_regs[32])
- #  endif
+@@ -151,16 +151,20 @@ using mozilla::DebugOnly;
+ #      define FP_sig(p) ((p)->uc_mcontext.mc_fp)
+ #      define SP_sig(p) ((p)->uc_mcontext.mc_i7)
+ #    endif
+ #    if defined(__linux__) && (defined(__ppc64__) || defined(__PPC64__) || \
+                                defined(__ppc64le__) || defined(__PPC64LE__))
+ #      define R01_sig(p) ((p)->uc_mcontext.gp_regs[1])
+ #      define R32_sig(p) ((p)->uc_mcontext.gp_regs[32])
+ #    endif
 +#  if defined(__linux__) && defined(__s390x__)
 +#    define GR_sig(p,x) ((p)->uc_mcontext.gregs[x])
 +#    define PSWa_sig(p) ((p)->uc_mcontext.psw.addr)
 +#  endif
- #elif defined(__NetBSD__)
- #  define EIP_sig(p) ((p)->uc_mcontext.__gregs[_REG_EIP])
- #  define EBP_sig(p) ((p)->uc_mcontext.__gregs[_REG_EBP])
- #  define ESP_sig(p) ((p)->uc_mcontext.__gregs[_REG_ESP])
- #  define RIP_sig(p) ((p)->uc_mcontext.__gregs[_REG_RIP])
- #  define RSP_sig(p) ((p)->uc_mcontext.__gregs[_REG_RSP])
- #  define RBP_sig(p) ((p)->uc_mcontext.__gregs[_REG_RBP])
- #  define R11_sig(p) ((p)->uc_mcontext.__gregs[_REG_R11])
-@@ -381,18 +385,23 @@ struct macos_arm_context {
- #  define FP_sig(p) RFP_sig(p)
- #  define SP_sig(p) RSP_sig(p)
- #  define LR_sig(p) R31_sig(p)
- #elif defined(__ppc64__) || defined(__PPC64__) || defined(__ppc64le__) || \
-     defined(__PPC64LE__)
- #  define PC_sig(p) R32_sig(p)
- #  define SP_sig(p) R01_sig(p)
- #  define FP_sig(p) R01_sig(p)
-+#elif defined(__s390x__)
-+# define PC_sig(p) PSWa_sig(p)
-+# define SP_sig(p) GR_sig(p, 15)
-+# define FP_sig(p) GR_sig(p, 11)
- #endif
+ #  elif defined(__NetBSD__)
+ #    define EIP_sig(p) ((p)->uc_mcontext.__gregs[_REG_EIP])
+ #    define EBP_sig(p) ((p)->uc_mcontext.__gregs[_REG_EBP])
+ #    define ESP_sig(p) ((p)->uc_mcontext.__gregs[_REG_ESP])
+ #    define RIP_sig(p) ((p)->uc_mcontext.__gregs[_REG_RIP])
+ #    define RSP_sig(p) ((p)->uc_mcontext.__gregs[_REG_RSP])
+ #    define RBP_sig(p) ((p)->uc_mcontext.__gregs[_REG_RBP])
+ #    define R11_sig(p) ((p)->uc_mcontext.__gregs[_REG_R11])
+@@ -371,16 +375,20 @@ struct macos_aarch64_context {
+ #    define FP_sig(p) RFP_sig(p)
+ #    define SP_sig(p) RSP_sig(p)
+ #    define LR_sig(p) R31_sig(p)
+ #  elif defined(__ppc64__) || defined(__PPC64__) || defined(__ppc64le__) || \
+       defined(__PPC64LE__)
+ #    define PC_sig(p) R32_sig(p)
+ #    define SP_sig(p) R01_sig(p)
+ #    define FP_sig(p) R01_sig(p)
++#  elif defined(__s390x__)
++#    define PC_sig(p) PSWa_sig(p)
++#    define SP_sig(p) GR_sig(p, 15)
++#    define FP_sig(p) GR_sig(p, 11)
+ #  endif
  
-+
  static void SetContextPC(CONTEXT* context, uint8_t* pc) {
- #ifdef PC_sig
+ #  ifdef PC_sig
    *reinterpret_cast<uint8_t**>(&PC_sig(context)) = pc;
- #else
+ #  else
    MOZ_CRASH();
- #endif
- }
- 
+ #  endif
--- a/mozilla-sandbox-fips.patch	Fri Oct 01 12:00:20 2021 +0200
+++ b/mozilla-sandbox-fips.patch	Sun Oct 17 20:19:48 2021 +0200
@@ -7,7 +7,7 @@
 diff --git a/security/sandbox/linux/Sandbox.cpp b/security/sandbox/linux/Sandbox.cpp
 --- a/security/sandbox/linux/Sandbox.cpp
 +++ b/security/sandbox/linux/Sandbox.cpp
-@@ -647,16 +647,17 @@ void SetMediaPluginSandbox(const char* a
+@@ -650,16 +650,17 @@ void SetMediaPluginSandbox(const char* a
      SANDBOX_LOG_ERROR("failed to open plugin file %s: %s", aFilePath,
                        strerror(errno));
      MOZ_CRASH("failed while trying to open the plugin file ");
@@ -15,8 +15,8 @@
  
    auto files = new SandboxOpenedFiles();
    files->Add(std::move(plugin));
-   files->Add("/dev/urandom", true);
-+  files->Add("/dev/random", true);
+   files->Add("/dev/urandom", SandboxOpenedFile::Dup::YES);
++  files->Add("/dev/random", SandboxOpenedFile::Dup::YES);
    files->Add("/etc/ld.so.cache");  // Needed for NSS in clearkey.
    files->Add("/sys/devices/system/cpu/cpu0/tsc_freq_khz");
    files->Add("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq");
@@ -28,7 +28,7 @@
 diff --git a/security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp b/security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp
 --- a/security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp
 +++ b/security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp
-@@ -308,16 +308,18 @@ void SandboxBrokerPolicyFactory::InitCon
+@@ -315,16 +315,18 @@ void SandboxBrokerPolicyFactory::InitCon
      policy->AddDir(rdwr, "/dev/dri");
    }
  
--- a/mozilla-silence-no-return-type.patch	Fri Oct 01 12:00:20 2021 +0200
+++ b/mozilla-silence-no-return-type.patch	Sun Oct 17 20:19:48 2021 +0200
@@ -1,8 +1,15 @@
+# HG changeset patch
+# Parent  45a1eadbae67aa05c6fa271d3dec5ac1cb0cfae8
+
 diff --git a/Cargo.lock b/Cargo.lock
-index 6f54a9380d..09911c0273 100644
 --- a/Cargo.lock
 +++ b/Cargo.lock
-@@ -2063,8 +2063,6 @@ dependencies = [
+@@ -2039,18 +2039,16 @@ name = "glsl-to-cxx"
+ version = "0.1.0"
+ dependencies = [
+  "glsl",
+ ]
+ 
  [[package]]
  name = "glslopt"
  version = "0.1.9"
@@ -11,30 +18,41 @@
  dependencies = [
   "cc",
  ]
+ 
+ [[package]]
+ name = "goblin"
+ version = "0.1.3"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
 diff --git a/Cargo.toml b/Cargo.toml
-index 09f3e7292f..3581baf2aa 100644
 --- a/Cargo.toml
 +++ b/Cargo.toml
-@@ -83,6 +83,7 @@ rlbox_lucet_sandbox = { git = "https://github.com/PLSysSec/rlbox_lucet_sandbox/"
- nix = { git = "https://github.com/shravanrn/nix/", rev="4af6c367603869a30fddb5ffb0aba2b9477ba92e" }
- spirv_cross = { git = "https://github.com/kvark/spirv_cross", branch = "wgpu5" }
- minidump_writer_linux = { git = "https://github.com/msirringhaus/minidump_writer_linux.git", rev = "85551909b95a5cf553a85dbcddfa5f117cfbbe0e" }
+@@ -78,16 +78,17 @@ opt-level = 2
+ opt-level = 2
+ 
+ [patch.crates-io]
+ chardetng = { git = "https://github.com/hsivonen/chardetng", rev="302c995f91f44cf26e77dc4758ad56c3ff0153ad" }
+ chardetng_c = { git = "https://github.com/hsivonen/chardetng_c", rev="ed8a4c6f900a90d4dbc1d64b856e61490a1c3570" }
+ libudev-sys = { path = "dom/webauthn/libudev-sys" }
+ packed_simd = { git = "https://github.com/hsivonen/packed_simd", rev="6a16f954950401b92b4e220fbf2dfaf6f00e1fb2" }
+ minidump_writer_linux = { git = "https://github.com/msirringhaus/minidump_writer_linux.git", rev = "029ac0d54b237f27dc7d8d4e51bc0fb076e5e852" }
 +glslopt = { path = "third_party/rust/glslopt/" }
- 
+ # The following overrides point to dummy projects, as a temporary measure until this is resolved:
+ # https://github.com/rust-lang/cargo/issues/6179
+ js-sys = { git = "https://github.com/kvark/dummy-web" }
+ slotmap = { git = "https://github.com/kvark/dummy-web" }
+ wasm-bindgen = { git = "https://github.com/kvark/dummy-web" }
+ web-sys = { git = "https://github.com/kvark/dummy-web" }
  
  [patch.crates-io.cranelift-codegen]
-@@ -105,4 +106,4 @@ path = "third_party/rust/mio"
- 
- # Patch failure 0.1.8 to disable the backtrace feature by default. See bug 1608157.
- [patch.crates-io.failure]
--path = "third_party/rust/failure"
-\ No newline at end of file
-+path = "third_party/rust/failure"
 diff --git a/gfx/skia/skia/include/codec/SkEncodedOrigin.h b/gfx/skia/skia/include/codec/SkEncodedOrigin.h
-index 2eed1c6ac6..49d0309034 100644
 --- a/gfx/skia/skia/include/codec/SkEncodedOrigin.h
 +++ b/gfx/skia/skia/include/codec/SkEncodedOrigin.h
-@@ -41,6 +41,7 @@ static inline SkMatrix SkEncodedOriginToMatrix(SkEncodedOrigin origin, int w, in
+@@ -36,12 +36,13 @@ static inline SkMatrix SkEncodedOriginTo
+         case kBottomRight_SkEncodedOrigin: return SkMatrix::MakeAll(-1,  0, w,  0, -1, h, 0, 0, 1);
+         case  kBottomLeft_SkEncodedOrigin: return SkMatrix::MakeAll( 1,  0, 0,  0, -1, h, 0, 0, 1);
+         case     kLeftTop_SkEncodedOrigin: return SkMatrix::MakeAll( 0,  1, 0,  1,  0, 0, 0, 0, 1);
+         case    kRightTop_SkEncodedOrigin: return SkMatrix::MakeAll( 0, -1, h,  1,  0, 0, 0, 0, 1);
+         case kRightBottom_SkEncodedOrigin: return SkMatrix::MakeAll( 0, -1, h, -1,  0, w, 0, 0, 1);
          case  kLeftBottom_SkEncodedOrigin: return SkMatrix::MakeAll( 0,  1, 0, -1,  0, w, 0, 0, 1);
      }
      SK_ABORT("Unexpected origin");
@@ -42,11 +60,16 @@
  }
  
  
+ #endif // SkEncodedOrigin_DEFINED
 diff --git a/gfx/skia/skia/include/private/GrTypesPriv.h b/gfx/skia/skia/include/private/GrTypesPriv.h
-index 90718038e0..4ec7729ab8 100644
 --- a/gfx/skia/skia/include/private/GrTypesPriv.h
 +++ b/gfx/skia/skia/include/private/GrTypesPriv.h
-@@ -540,6 +540,7 @@ static inline GrSLType GrSLCombinedSamplerTypeForTextureType(GrTextureType type)
+@@ -535,32 +535,34 @@ static inline GrSLType GrSLCombinedSampl
+             return kTexture2DSampler_GrSLType;
+         case GrTextureType::kRectangle:
+             return kTexture2DRectSampler_GrSLType;
+         case GrTextureType::kExternal:
+             return kTextureExternalSampler_GrSLType;
          default:
              SK_ABORT("Unexpected texture type");
      }
@@ -54,7 +77,16 @@
  }
  
  /** Rectangle and external textures only support the clamp wrap mode and do not support
-@@ -556,6 +557,7 @@ static inline bool GrTextureTypeHasRestrictedSampling(GrTextureType type) {
+  *  MIP maps.
+  */
+ static inline bool GrTextureTypeHasRestrictedSampling(GrTextureType type) {
+     switch (type) {
+         case GrTextureType::k2D:
+             return false;
+         case GrTextureType::kRectangle:
+             return true;
+         case GrTextureType::kExternal:
+             return true;
          default:
              SK_ABORT("Unexpected texture type");
      }
@@ -62,7 +94,17 @@
  }
  
  static constexpr bool GrSLTypeIsCombinedSamplerType(GrSLType type) {
-@@ -858,6 +860,7 @@ static inline size_t GrCompressedFormatDataSize(SkImage::CompressionType compres
+     switch (type) {
+         case kTexture2DSampler_GrSLType:
+         case kTextureExternalSampler_GrSLType:
+         case kTexture2DRectSampler_GrSLType:
+             return true;
+@@ -853,16 +855,17 @@ static inline size_t GrCompressedFormatD
+     switch (compressionType) {
+         case SkImage::kETC1_CompressionType:
+             SkASSERT((width & 3) == 0);
+             SkASSERT((height & 3) == 0);
+             return (width >> 2) * (height >> 2) * 8;
      }
  
      SK_ABORT("Invalid pixel config");
@@ -70,11 +112,20 @@
  }
  
  /**
+  * Like SkColorType this describes a layout of pixel data in CPU memory. It specifies the channels,
+  * their type, and width. This exists so that the GPU backend can have private types that have no
+  * analog in the public facing SkColorType enum and omit types not implemented in the GPU backend.
+  * It does not refer to a texture format and the mapping to texture formats may be many-to-many.
+  * It does not specify the sRGB encoding of the stored values. The components are listed in order of
 diff --git a/gfx/skia/skia/src/core/SkGeometry.h b/gfx/skia/skia/src/core/SkGeometry.h
-index 23bdbc1c42..ea2d23f6e8 100644
 --- a/gfx/skia/skia/src/core/SkGeometry.h
 +++ b/gfx/skia/skia/src/core/SkGeometry.h
-@@ -182,6 +182,7 @@ static inline bool SkCubicIsDegenerate(SkCubicType type) {
+@@ -177,28 +177,30 @@ static inline bool SkCubicIsDegenerate(S
+         case SkCubicType::kLocalCusp:
+         case SkCubicType::kCuspAtInfinity:
+             return false;
+         case SkCubicType::kQuadratic:
+         case SkCubicType::kLineOrPoint:
              return true;
      }
      SK_ABORT("Invalid SkCubicType");
@@ -82,7 +133,12 @@
  }
  
  static inline const char* SkCubicTypeName(SkCubicType type) {
-@@ -194,6 +195,7 @@ static inline const char* SkCubicTypeName(SkCubicType type) {
+     switch (type) {
+         case SkCubicType::kSerpentine: return "kSerpentine";
+         case SkCubicType::kLoop: return "kLoop";
+         case SkCubicType::kLocalCusp: return "kLocalCusp";
+         case SkCubicType::kCuspAtInfinity: return "kCuspAtInfinity";
+         case SkCubicType::kQuadratic: return "kQuadratic";
          case SkCubicType::kLineOrPoint: return "kLineOrPoint";
      }
      SK_ABORT("Invalid SkCubicType");
@@ -90,11 +146,20 @@
  }
  
  /** Returns the cubic classification.
+ 
+     t[],s[] are set to the two homogeneous parameter values at which points the lines L & M
+     intersect with K, sorted from smallest to largest and oriented so positive values of the
+     implicit are on the "left" side. For a serpentine curve they are the inflection points. For a
+     loop they are the double point. For a local cusp, they are both equal and denote the cusp point.
 diff --git a/gfx/skia/skia/src/core/SkTextBlob.cpp b/gfx/skia/skia/src/core/SkTextBlob.cpp
-index 3c84bda6f8..e2fba375cc 100644
 --- a/gfx/skia/skia/src/core/SkTextBlob.cpp
 +++ b/gfx/skia/skia/src/core/SkTextBlob.cpp
-@@ -201,6 +201,7 @@ void SkTextBlob::operator delete(void* p) {
+@@ -196,16 +196,17 @@ unsigned SkTextBlob::ScalarsPerGlyph(Gly
+ }
+ 
+ void SkTextBlob::operator delete(void* p) {
+     sk_free(p);
+ }
  
  void* SkTextBlob::operator new(size_t) {
      SK_ABORT("All blobs are created by placement new.");
@@ -102,11 +167,20 @@
  }
  
  void* SkTextBlob::operator new(size_t, void* p) {
+     return p;
+ }
+ 
+ SkTextBlobRunIterator::SkTextBlobRunIterator(const SkTextBlob* blob)
+     : fCurrentRun(SkTextBlob::RunRecord::First(blob)) {
 diff --git a/gfx/skia/skia/src/core/SkTypeface_remote.cpp b/gfx/skia/skia/src/core/SkTypeface_remote.cpp
-index 838a783313..d878fadc08 100644
 --- a/gfx/skia/skia/src/core/SkTypeface_remote.cpp
 +++ b/gfx/skia/skia/src/core/SkTypeface_remote.cpp
-@@ -29,6 +29,7 @@ void SkScalerContextProxy::initCache(SkStrike* cache, SkStrikeCache* strikeCache
+@@ -24,16 +24,17 @@ void SkScalerContextProxy::initCache(SkS
+     SkASSERT(cache != nullptr);
+ 
+     fCache = cache;
+     fStrikeCache = strikeCache;
+ }
  
  unsigned SkScalerContextProxy::generateGlyphCount()  {
      SK_ABORT("Should never be called.");
@@ -114,11 +188,20 @@
  }
  
  bool SkScalerContextProxy::generateAdvance(SkGlyph* glyph) {
+     return false;
+ }
+ 
+ void SkScalerContextProxy::generateMetrics(SkGlyph* glyph) {
+     TRACE_EVENT1("skia", "generateMetrics", "rec", TRACE_STR_COPY(this->getRec().dump().c_str()));
 diff --git a/gfx/skia/skia/src/core/SkTypeface_remote.h b/gfx/skia/skia/src/core/SkTypeface_remote.h
-index 3d454cf760..554f7c0617 100644
 --- a/gfx/skia/skia/src/core/SkTypeface_remote.h
 +++ b/gfx/skia/skia/src/core/SkTypeface_remote.h
-@@ -63,23 +63,28 @@ public:
+@@ -58,46 +58,54 @@ public:
+             , fGlyphCount{glyphCount}
+             , fIsLogging{isLogging}
+             , fDiscardableManager{std::move(manager)} {}
+     SkFontID remoteTypefaceID() const {return fFontId;}
+     int glyphCount() const {return fGlyphCount;}
      bool isLogging() const {return fIsLogging;}
  
  protected:
@@ -148,7 +231,7 @@
      }
      void onGetFamilyName(SkString* familyName) const override {
          // Used by SkStrikeCache::DumpMemoryStatistics.
-@@ -87,12 +92,15 @@ protected:
+         *familyName = "";
      }
      SkTypeface::LocalizedStrings* onCreateFamilyNameIterator() const override {
          SK_ABORT("Should never be called.");
@@ -164,7 +247,17 @@
      }
      SkScalerContext* onCreateScalerContext(const SkScalerContextEffects& effects,
                                             const SkDescriptor* desc) const override {
-@@ -116,6 +124,7 @@ protected:
+         return new SkScalerContextProxy(sk_ref_sp(const_cast<SkTypefaceProxy*>(this)), effects,
+                                         desc, fDiscardableManager);
+     }
+     void onFilterRec(SkScalerContextRec* rec) const override {
+         // The rec filtering is already applied by the server when generating
+@@ -111,26 +119,28 @@ protected:
+     }
+ 
+     void getPostScriptGlyphNames(SkString*) const override {
+         SK_ABORT("Should never be called.");
+     }
  
      std::unique_ptr<SkAdvancedTypefaceMetrics> onGetAdvancedMetrics() const override {
          SK_ABORT("Should never be called.");
@@ -172,7 +265,10 @@
      }
      void onCharsToGlyphs(const SkUnichar* chars, int count, SkGlyphID glyphs[]) const override {
          SK_ABORT("Should never be called.");
-@@ -126,6 +135,7 @@ protected:
+     }
+     int onCountGlyphs() const override {
+         return this->glyphCount();
+     }
  
      void* onGetCTFontRef() const override {
          SK_ABORT("Should never be called.");
@@ -180,11 +276,20 @@
      }
  
  private:
+     const SkFontID                                  fFontId;
+     const int                                       fGlyphCount;
+     const bool                                      fIsLogging;
+     sk_sp<SkStrikeClient::DiscardableHandleManager> fDiscardableManager;
+ 
 diff --git a/gfx/skia/skia/src/effects/imagefilters/SkBlurImageFilter.cpp b/gfx/skia/skia/src/effects/imagefilters/SkBlurImageFilter.cpp
-index 2dde5e2be7..dd8550dfad 100644
 --- a/gfx/skia/skia/src/effects/imagefilters/SkBlurImageFilter.cpp
 +++ b/gfx/skia/skia/src/effects/imagefilters/SkBlurImageFilter.cpp
-@@ -144,6 +144,7 @@ static GrTextureDomain::Mode to_texture_domain_mode(SkTileMode tileMode) {
+@@ -139,16 +139,17 @@ static GrTextureDomain::Mode to_texture_
+         case SkTileMode::kDecal:
+             return GrTextureDomain::kDecal_Mode;
+         case SkTileMode::kMirror:
+             // TODO (michaelludwig) - Support mirror mode, treat as repeat for now
+         case SkTileMode::kRepeat:
              return GrTextureDomain::kRepeat_Mode;
          default:
              SK_ABORT("Unsupported tile mode.");
@@ -192,11 +297,20 @@
      }
  }
  #endif
+ 
+ // This is defined by the SVG spec:
+ // https://drafts.fxtf.org/filter-effects/#feGaussianBlurElement
+ static int calculate_window(double sigma) {
+     // NB 136 is the largest sigma that will not cause a buffer full of 255 mask values to overflow
 diff --git a/gfx/skia/skia/src/effects/imagefilters/SkLightingImageFilter.cpp b/gfx/skia/skia/src/effects/imagefilters/SkLightingImageFilter.cpp
-index 43d32dcc91..4a8143e2e2 100644
 --- a/gfx/skia/skia/src/effects/imagefilters/SkLightingImageFilter.cpp
 +++ b/gfx/skia/skia/src/effects/imagefilters/SkLightingImageFilter.cpp
-@@ -1701,6 +1701,7 @@ static SkImageFilterLight* create_random_light(SkRandom* random) {
+@@ -1696,16 +1696,17 @@ static SkImageFilterLight* create_random
+             return new SkPointLight(random_point3(random), random->nextU());
+         }
+         case 2: {
+             return new SkSpotLight(random_point3(random), random_point3(random),
+                                    random->nextUScalar1(), random->nextUScalar1(), random->nextU());
          }
          default:
              SK_ABORT("Unexpected value.");
@@ -204,11 +318,20 @@
      }
  }
  
+ std::unique_ptr<GrFragmentProcessor> GrDiffuseLightingEffect::TestCreate(GrProcessorTestData* d) {
+     int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx
+                                         : GrProcessorUnitTest::kAlphaTextureIdx;
+     sk_sp<GrTextureProxy> proxy = d->textureProxy(texIdx);
+     SkScalar surfaceScale = d->fRandom->nextSScalar1();
 diff --git a/gfx/skia/skia/src/fonts/SkFontMgr_indirect.cpp b/gfx/skia/skia/src/fonts/SkFontMgr_indirect.cpp
-index da7678a725..63330e58c2 100644
 --- a/gfx/skia/skia/src/fonts/SkFontMgr_indirect.cpp
 +++ b/gfx/skia/skia/src/fonts/SkFontMgr_indirect.cpp
-@@ -69,6 +69,7 @@ void SkFontMgr_Indirect::onGetFamilyName(int index, SkString* familyName) const
+@@ -64,16 +64,17 @@ int SkFontMgr_Indirect::onCountFamilies(
+ }
+ 
+ void SkFontMgr_Indirect::onGetFamilyName(int index, SkString* familyName) const {
+     SK_ABORT("Not implemented");
+ }
  
  SkFontStyleSet* SkFontMgr_Indirect::onCreateStyleSet(int index) const {
      SK_ABORT("Not implemented");
@@ -216,11 +339,20 @@
  }
  
  SkFontStyleSet* SkFontMgr_Indirect::onMatchFamily(const char familyName[]) const {
+     return new SkStyleSet_Indirect(this, -1, fProxy->matchName(familyName));
+ }
+ 
+ SkTypeface* SkFontMgr_Indirect::createTypefaceFromFontId(const SkFontIdentity& id) const {
+     if (id.fDataId == SkFontIdentity::kInvalidDataId) {
 diff --git a/gfx/skia/skia/src/gpu/GrDataUtils.cpp b/gfx/skia/skia/src/gpu/GrDataUtils.cpp
-index 6265aaec28..0da5190e4a 100644
 --- a/gfx/skia/skia/src/gpu/GrDataUtils.cpp
 +++ b/gfx/skia/skia/src/gpu/GrDataUtils.cpp
-@@ -128,6 +128,7 @@ size_t GrCompressedDataSize(SkImage::CompressionType type, int width, int height
+@@ -123,25 +123,27 @@ static int num_ETC1_blocks(int w, int h)
+ 
+ size_t GrCompressedDataSize(SkImage::CompressionType type, int width, int height) {
+     switch (type) {
+         case SkImage::kETC1_CompressionType:
+             int numBlocks = num_ETC1_blocks(width, height);
              return numBlocks * sizeof(ETC1Block);
      }
      SK_ABORT("Unexpected compression type");
@@ -228,7 +360,9 @@
  }
  
  size_t GrCompressedRowBytes(SkImage::CompressionType type, int width) {
-@@ -137,6 +138,7 @@ size_t GrCompressedRowBytes(SkImage::CompressionType type, int width) {
+     switch (type) {
+         case SkImage::kETC1_CompressionType:
+             int numBlocksWidth = num_ETC1_blocks_w(width);
              return numBlocksWidth * sizeof(ETC1Block);
      }
      SK_ABORT("Unexpected compression type");
@@ -236,11 +370,20 @@
  }
  
  // Fill in 'dest' with ETC1 blocks derived from 'colorf'
+ static void fillin_ETC1_with_color(int width, int height, const SkColor4f& colorf, void* dest) {
+     SkColor color = colorf.toSkColor();
+ 
+     ETC1Block block;
+     create_etc1_block(color, &block);
 diff --git a/gfx/skia/skia/src/gpu/GrFragmentProcessor.h b/gfx/skia/skia/src/gpu/GrFragmentProcessor.h
-index 21e27b868b..5b96868075 100644
 --- a/gfx/skia/skia/src/gpu/GrFragmentProcessor.h
 +++ b/gfx/skia/skia/src/gpu/GrFragmentProcessor.h
-@@ -375,6 +375,7 @@ protected:
+@@ -370,16 +370,17 @@ protected:
+                                                    const Args&... samps) {
+         return (0 == i) ? samp0 : IthTextureSampler(i - 1, samps...);
+     }
+     inline static const TextureSampler& IthTextureSampler(int i);
+ 
  private:
      virtual SkPMColor4f constantOutputForConstantInput(const SkPMColor4f& /* inputColor */) const {
          SK_ABORT("Subclass must override this if advertising this optimization.");
@@ -248,11 +391,20 @@
      }
  
      /** Returns a new instance of the appropriate *GL* implementation class
+         for the given GrFragmentProcessor; caller is responsible for deleting
+         the object. */
+     virtual GrGLSLFragmentProcessor* onCreateGLSLInstance() const = 0;
+ 
+     /** Implemented using GLFragmentProcessor::GenKey as described in this class's comment. */
 diff --git a/gfx/skia/skia/src/gpu/GrPathRendering.cpp b/gfx/skia/skia/src/gpu/GrPathRendering.cpp
-index 5e44531d2e..a6bd5e4cbc 100644
 --- a/gfx/skia/skia/src/gpu/GrPathRendering.cpp
 +++ b/gfx/skia/skia/src/gpu/GrPathRendering.cpp
-@@ -19,6 +19,7 @@ const GrUserStencilSettings& GrPathRendering::GetStencilPassSettings(FillType fi
+@@ -14,16 +14,17 @@
+ #include "src/gpu/GrPathRendering.h"
+ #include "src/gpu/GrProgramInfo.h"
+ #include "src/gpu/GrRenderTarget.h"
+ 
+ const GrUserStencilSettings& GrPathRendering::GetStencilPassSettings(FillType fill) {
      switch (fill) {
          default:
              SK_ABORT("Unexpected path fill.");
@@ -260,11 +412,20 @@
          case GrPathRendering::kWinding_FillType: {
              constexpr static GrUserStencilSettings kWindingStencilPass(
                  GrUserStencilSettings::StaticInit<
+                     0xffff,
+                     GrUserStencilTest::kAlwaysIfInClip,
+                     0xffff,
+                     GrUserStencilOp::kIncWrap,
+                     GrUserStencilOp::kIncWrap,
 diff --git a/gfx/skia/skia/src/gpu/GrPathRendering.h b/gfx/skia/skia/src/gpu/GrPathRendering.h
-index 3e143e4d0f..3a672fabc6 100644
 --- a/gfx/skia/skia/src/gpu/GrPathRendering.h
 +++ b/gfx/skia/skia/src/gpu/GrPathRendering.h
-@@ -63,6 +63,7 @@ public:
+@@ -58,16 +58,17 @@ public:
+                 return 1;
+             case kTranslate_PathTransformType:
+                 return 2;
+             case kAffine_PathTransformType:
+                 return 6;
  
              default:
                  SK_ABORT("Unknown path transform type");
@@ -272,11 +433,20 @@
          }
      }
  
+     // No native support for inverse at this time
+     enum FillType {
+         /** Specifies that "inside" is computed by a non-zero sum of signed
+             edge crossings
+         */
 diff --git a/gfx/skia/skia/src/gpu/GrProcessorUnitTest.cpp b/gfx/skia/skia/src/gpu/GrProcessorUnitTest.cpp
-index 8d8efa7685..2d56d2cb09 100644
 --- a/gfx/skia/skia/src/gpu/GrProcessorUnitTest.cpp
 +++ b/gfx/skia/skia/src/gpu/GrProcessorUnitTest.cpp
-@@ -20,6 +20,7 @@ std::unique_ptr<GrFragmentProcessor> GrProcessorUnitTest::MakeChildFP(GrProcesso
+@@ -15,11 +15,12 @@ std::unique_ptr<GrFragmentProcessor> GrP
+     std::unique_ptr<GrFragmentProcessor> fp;
+     do {
+         fp = GrFragmentProcessorTestFactory::Make(data);
+         SkASSERT(fp);
+     } while (fp->numChildProcessors() != 0);
      return fp;
  #else
      SK_ABORT("Should not be called if !SK_ALLOW_STATIC_GLOBAL_INITIALIZERS");
@@ -285,10 +455,14 @@
  }
  #endif
 diff --git a/gfx/skia/skia/src/gpu/GrReducedClip.cpp b/gfx/skia/skia/src/gpu/GrReducedClip.cpp
-index 9224e005c6..5c1d44b613 100644
 --- a/gfx/skia/skia/src/gpu/GrReducedClip.cpp
 +++ b/gfx/skia/skia/src/gpu/GrReducedClip.cpp
-@@ -525,6 +525,7 @@ GrReducedClip::ClipResult GrReducedClip::clipInsideElement(const Element* elemen
+@@ -520,16 +520,17 @@ GrReducedClip::ClipResult GrReducedClip:
+                                        GrAA(element->isAA()));
+ 
+         case Element::DeviceSpaceType::kPath:
+             return this->addAnalyticFP(element->getDeviceSpacePath(),
+                                        Invert(element->isInverseFilled()), GrAA(element->isAA()));
      }
  
      SK_ABORT("Unexpected DeviceSpaceType");
@@ -296,7 +470,17 @@
  }
  
  GrReducedClip::ClipResult GrReducedClip::clipOutsideElement(const Element* element) {
-@@ -591,6 +592,7 @@ GrReducedClip::ClipResult GrReducedClip::clipOutsideElement(const Element* eleme
+     switch (element->getDeviceSpaceType()) {
+         case Element::DeviceSpaceType::kEmpty:
+             return ClipResult::kMadeEmpty;
+ 
+         case Element::DeviceSpaceType::kRect:
+@@ -586,16 +587,17 @@ GrReducedClip::ClipResult GrReducedClip:
+         }
+ 
+         case Element::DeviceSpaceType::kPath:
+             return this->addAnalyticFP(element->getDeviceSpacePath(),
+                                        Invert(!element->isInverseFilled()), GrAA(element->isAA()));
      }
  
      SK_ABORT("Unexpected DeviceSpaceType");
@@ -304,11 +488,20 @@
  }
  
  inline void GrReducedClip::addWindowRectangle(const SkRect& elementInteriorRect, bool elementIsAA) {
+     SkIRect window;
+     if (!elementIsAA) {
+         elementInteriorRect.round(&window);
+     } else {
+         elementInteriorRect.roundIn(&window);
 diff --git a/gfx/skia/skia/src/gpu/GrResourceCache.cpp b/gfx/skia/skia/src/gpu/GrResourceCache.cpp
-index 6d9a961886..5f2e68dd7b 100644
 --- a/gfx/skia/skia/src/gpu/GrResourceCache.cpp
 +++ b/gfx/skia/skia/src/gpu/GrResourceCache.cpp
-@@ -40,6 +40,7 @@ GrScratchKey::ResourceType GrScratchKey::GenerateResourceType() {
+@@ -35,27 +35,29 @@ DECLARE_SKMESSAGEBUS_MESSAGE(GrTextureFr
+ //////////////////////////////////////////////////////////////////////////////
+ 
+ GrScratchKey::ResourceType GrScratchKey::GenerateResourceType() {
+     static std::atomic<int32_t> nextType{INHERITED::kInvalidDomain + 1};
+ 
      int32_t type = nextType++;
      if (type > SkTo<int32_t>(UINT16_MAX)) {
          SK_ABORT("Too many Resource Types");
@@ -316,7 +509,11 @@
      }
  
      return static_cast<ResourceType>(type);
-@@ -51,6 +52,7 @@ GrUniqueKey::Domain GrUniqueKey::GenerateDomain() {
+ }
+ 
+ GrUniqueKey::Domain GrUniqueKey::GenerateDomain() {
+     static std::atomic<int32_t> nextDomain{INHERITED::kInvalidDomain + 1};
+ 
      int32_t domain = nextDomain++;
      if (domain > SkTo<int32_t>(UINT16_MAX)) {
          SK_ABORT("Too many GrUniqueKey Domains");
@@ -324,11 +521,20 @@
      }
  
      return static_cast<Domain>(domain);
+ }
+ 
+ uint32_t GrResourceKeyHash(const uint32_t* data, size_t size) {
+     return SkOpts::hash(data, size);
+ }
 diff --git a/gfx/skia/skia/src/gpu/GrShaderVar.cpp b/gfx/skia/skia/src/gpu/GrShaderVar.cpp
-index 6f7ccccd60..67156a74bc 100644
 --- a/gfx/skia/skia/src/gpu/GrShaderVar.cpp
 +++ b/gfx/skia/skia/src/gpu/GrShaderVar.cpp
-@@ -18,6 +18,7 @@ static const char* type_modifier_string(GrShaderVar::TypeModifier t) {
+@@ -13,30 +13,32 @@ static const char* type_modifier_string(
+     switch (t) {
+         case GrShaderVar::kNone_TypeModifier: return "";
+         case GrShaderVar::kIn_TypeModifier: return "in";
+         case GrShaderVar::kInOut_TypeModifier: return "inout";
+         case GrShaderVar::kOut_TypeModifier: return "out";
          case GrShaderVar::kUniform_TypeModifier: return "uniform";
      }
      SK_ABORT("Unknown shader variable type modifier.");
@@ -336,7 +542,14 @@
  }
  
  void GrShaderVar::setIOType(GrIOType ioType) {
-@@ -32,6 +33,7 @@ void GrShaderVar::setIOType(GrIOType ioType) {
+     switch (ioType) {
+         case kRW_GrIOType:
+             return;
+         case kRead_GrIOType:
+             this->addModifier("readonly");
+             return;
+         case kWrite_GrIOType:
+             this->addModifier("writeonly");
              return;
      }
      SK_ABORT("Unknown io type.");
@@ -344,11 +557,20 @@
  }
  
  void GrShaderVar::appendDecl(const GrShaderCaps* shaderCaps, SkString* out) const {
+     SkString layout = fLayoutQualifier;
+     if (!fLayoutQualifier.isEmpty()) {
+         out->appendf("layout(%s) ", fLayoutQualifier.c_str());
+     }
+     out->append(fExtraModifiers);
 diff --git a/gfx/skia/skia/src/gpu/SkGpuDevice.cpp b/gfx/skia/skia/src/gpu/SkGpuDevice.cpp
-index 77b9963ba5..f6d7ca05dd 100644
 --- a/gfx/skia/skia/src/gpu/SkGpuDevice.cpp
 +++ b/gfx/skia/skia/src/gpu/SkGpuDevice.cpp
-@@ -283,6 +283,7 @@ static inline GrPrimitiveType point_mode_to_primitive_type(SkCanvas::PointMode m
+@@ -278,16 +278,17 @@ static inline GrPrimitiveType point_mode
+         case SkCanvas::kPoints_PointMode:
+             return GrPrimitiveType::kPoints;
+         case SkCanvas::kLines_PointMode:
+             return GrPrimitiveType::kLines;
+         case SkCanvas::kPolygon_PointMode:
              return GrPrimitiveType::kLineStrip;
      }
      SK_ABORT("Unexpected mode");
@@ -356,11 +578,20 @@
  }
  
  void SkGpuDevice::drawPoints(SkCanvas::PointMode mode,
+                              size_t count, const SkPoint pts[], const SkPaint& paint) {
+     ASSERT_SINGLE_OWNER
+     GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawPoints", fContext.get());
+     SkScalar width = paint.getStrokeWidth();
+     if (width < 0) {
 diff --git a/gfx/skia/skia/src/gpu/SkGr.h b/gfx/skia/skia/src/gpu/SkGr.h
-index 79a68822b9..716f59d7e6 100644
 --- a/gfx/skia/skia/src/gpu/SkGr.h
 +++ b/gfx/skia/skia/src/gpu/SkGr.h
-@@ -159,6 +159,7 @@ static inline GrPrimitiveType SkVertexModeToGrPrimitiveType(SkVertices::VertexMo
+@@ -154,16 +154,17 @@ static inline GrPrimitiveType SkVertexMo
+         case SkVertices::kTriangles_VertexMode:
+             return GrPrimitiveType::kTriangles;
+         case SkVertices::kTriangleStrip_VertexMode:
+             return GrPrimitiveType::kTriangleStrip;
+         case SkVertices::kTriangleFan_VertexMode:
              break;
      }
      SK_ABORT("Invalid mode");
@@ -368,11 +599,20 @@
  }
  
  //////////////////////////////////////////////////////////////////////////////
+ 
+ GR_STATIC_ASSERT((int)kZero_GrBlendCoeff == (int)SkBlendModeCoeff::kZero);
+ GR_STATIC_ASSERT((int)kOne_GrBlendCoeff == (int)SkBlendModeCoeff::kOne);
+ GR_STATIC_ASSERT((int)kSC_GrBlendCoeff == (int)SkBlendModeCoeff::kSC);
+ GR_STATIC_ASSERT((int)kISC_GrBlendCoeff == (int)SkBlendModeCoeff::kISC);
 diff --git a/gfx/skia/skia/src/gpu/ccpr/GrCCCoverageProcessor.h b/gfx/skia/skia/src/gpu/ccpr/GrCCCoverageProcessor.h
-index 5fdb488ea5..eb81f47ba6 100644
 --- a/gfx/skia/skia/src/gpu/ccpr/GrCCCoverageProcessor.h
 +++ b/gfx/skia/skia/src/gpu/ccpr/GrCCCoverageProcessor.h
-@@ -240,6 +240,7 @@ inline const char* GrCCCoverageProcessor::PrimitiveTypeName(PrimitiveType type)
+@@ -235,16 +235,17 @@ inline const char* GrCCCoverageProcessor
+     switch (type) {
+         case PrimitiveType::kTriangles: return "kTriangles";
+         case PrimitiveType::kWeightedTriangles: return "kWeightedTriangles";
+         case PrimitiveType::kQuadratics: return "kQuadratics";
+         case PrimitiveType::kCubics: return "kCubics";
          case PrimitiveType::kConics: return "kConics";
      }
      SK_ABORT("Invalid PrimitiveType");
@@ -380,11 +620,20 @@
  }
  
  inline void GrCCCoverageProcessor::TriPointInstance::set(
+         const SkPoint p[3], const Sk2f& translate, Ordering ordering) {
+     this->set(p[0], p[1], p[2], translate, ordering);
+ }
+ 
+ inline void GrCCCoverageProcessor::TriPointInstance::set(
 diff --git a/gfx/skia/skia/src/gpu/ccpr/GrCCStrokeGeometry.cpp b/gfx/skia/skia/src/gpu/ccpr/GrCCStrokeGeometry.cpp
-index 40884d7d8f..c920365f50 100644
 --- a/gfx/skia/skia/src/gpu/ccpr/GrCCStrokeGeometry.cpp
 +++ b/gfx/skia/skia/src/gpu/ccpr/GrCCStrokeGeometry.cpp
-@@ -60,6 +60,7 @@ static GrCCStrokeGeometry::Verb join_verb_from_join(SkPaint::Join join) {
+@@ -55,16 +55,17 @@ static GrCCStrokeGeometry::Verb join_ver
+         case SkPaint::kBevel_Join:
+             return Verb::kBevelJoin;
+         case SkPaint::kMiter_Join:
+             return Verb::kMiterJoin;
+         case SkPaint::kRound_Join:
              return Verb::kRoundJoin;
      }
      SK_ABORT("Invalid SkPaint::Join.");
@@ -392,11 +641,20 @@
  }
  
  void GrCCStrokeGeometry::beginPath(const SkStrokeRec& stroke, float strokeDevWidth,
+                                    InstanceTallies* tallies) {
+     SkASSERT(!fInsideContour);
+     // Client should have already converted the stroke to device space (i.e. width=1 for hairline).
+     SkASSERT(strokeDevWidth > 0);
+ 
 diff --git a/gfx/skia/skia/src/gpu/ccpr/GrCCStrokeGeometry.h b/gfx/skia/skia/src/gpu/ccpr/GrCCStrokeGeometry.h
-index 24569accc4..d105836141 100644
 --- a/gfx/skia/skia/src/gpu/ccpr/GrCCStrokeGeometry.h
 +++ b/gfx/skia/skia/src/gpu/ccpr/GrCCStrokeGeometry.h
-@@ -175,5 +175,6 @@ inline bool GrCCStrokeGeometry::IsInternalJoinVerb(Verb verb) {
+@@ -170,10 +170,11 @@ inline bool GrCCStrokeGeometry::IsIntern
+         case Verb::kMiterJoin:
+         case Verb::kRoundJoin:
+         case Verb::kSquareCap:
+         case Verb::kRoundCap:
+         case Verb::kEndContour:
              return false;
      }
      SK_ABORT("Invalid GrCCStrokeGeometry::Verb.");
@@ -404,10 +662,14 @@
  }
  #endif
 diff --git a/gfx/skia/skia/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp b/gfx/skia/skia/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp
-index 4e86d7e071..0376cf40c3 100644
 --- a/gfx/skia/skia/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp
 +++ b/gfx/skia/skia/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp
-@@ -164,6 +164,7 @@ GrPathRenderer::CanDrawPath GrCoverageCountingPathRenderer::onCanDrawPath(
+@@ -159,16 +159,17 @@ GrPathRenderer::CanDrawPath GrCoverageCo
+             return CanDrawPath::kYes;
+         }
+ 
+         case SkStrokeRec::kStrokeAndFill_Style:
+             return CanDrawPath::kNo;
      }
  
      SK_ABORT("Invalid stroke style.");
@@ -415,21 +677,34 @@
  }
  
  bool GrCoverageCountingPathRenderer::onDrawPath(const DrawPathArgs& args) {
+     SkASSERT(!fFlushing);
+ 
+     SkIRect clipIBounds;
+     GrRenderTargetContext* rtc = args.fRenderTargetContext;
+     args.fClip->getConservativeBounds(rtc->width(), rtc->height(), &clipIBounds, nullptr);
 diff --git a/gfx/skia/skia/src/gpu/ccpr/GrVSCoverageProcessor.cpp b/gfx/skia/skia/src/gpu/ccpr/GrVSCoverageProcessor.cpp
-index ae5cfca504..89beff076a 100644
 --- a/gfx/skia/skia/src/gpu/ccpr/GrVSCoverageProcessor.cpp
 +++ b/gfx/skia/skia/src/gpu/ccpr/GrVSCoverageProcessor.cpp
-@@ -550,4 +550,5 @@ GrGLSLPrimitiveProcessor* GrVSCoverageProcessor::onCreateGLSLInstance(
+@@ -545,9 +545,10 @@ GrGLSLPrimitiveProcessor* GrVSCoveragePr
+         case PrimitiveType::kWeightedTriangles:
+             return new Impl(std::move(shader), 3);
+         case PrimitiveType::kQuadratics:
+         case PrimitiveType::kCubics:
+         case PrimitiveType::kConics:
              return new Impl(std::move(shader), 4);
      }
      SK_ABORT("Invalid PrimitiveType");
 +    SkUNREACHABLE;
  }
 diff --git a/gfx/skia/skia/src/gpu/dawn/GrDawnOpsRenderPass.cpp b/gfx/skia/skia/src/gpu/dawn/GrDawnOpsRenderPass.cpp
-index 48fc8a7f48..9321f43b7e 100644
 --- a/gfx/skia/skia/src/gpu/dawn/GrDawnOpsRenderPass.cpp
 +++ b/gfx/skia/skia/src/gpu/dawn/GrDawnOpsRenderPass.cpp
-@@ -39,7 +39,9 @@ static dawn::LoadOp to_dawn_load_op(GrLoadOp loadOp) {
+@@ -34,17 +34,19 @@ static dawn::LoadOp to_dawn_load_op(GrLo
+             // Load should be equivalent to DontCare for desktop; Clear would
+             // probably be better for tilers. If Dawn does add DontCare
+             // as an extension, use it here.
+             return dawn::LoadOp::Load;
+         case GrLoadOp::kClear:
              return dawn::LoadOp::Clear;
          default:
              SK_ABORT("Invalid LoadOp");
@@ -439,11 +714,20 @@
  }
  
  GrDawnOpsRenderPass::GrDawnOpsRenderPass(GrDawnGpu* gpu, GrRenderTarget* rt, GrSurfaceOrigin origin,
+                                          const LoadAndStoreInfo& colorInfo,
+                                          const StencilLoadAndStoreInfo& stencilInfo)
+         : INHERITED(rt, origin)
+         , fGpu(gpu)
+         , fColorInfo(colorInfo) {
 diff --git a/gfx/skia/skia/src/gpu/dawn/GrDawnUniformHandler.cpp b/gfx/skia/skia/src/gpu/dawn/GrDawnUniformHandler.cpp
-index 74fd1e31a4..2546126406 100644
 --- a/gfx/skia/skia/src/gpu/dawn/GrDawnUniformHandler.cpp
 +++ b/gfx/skia/skia/src/gpu/dawn/GrDawnUniformHandler.cpp
-@@ -95,6 +95,7 @@ uint32_t grsltype_to_alignment_mask(GrSLType type) {
+@@ -90,16 +90,17 @@ uint32_t grsltype_to_alignment_mask(GrSL
+         case kTexture2DSampler_GrSLType:
+         case kTextureExternalSampler_GrSLType:
+         case kTexture2DRectSampler_GrSLType:
+         case kTexture2D_GrSLType:
+         case kSampler_GrSLType:
              break;
      }
      SK_ABORT("Unexpected type");
@@ -451,7 +735,17 @@
  }
  
  static inline uint32_t grsltype_to_size(GrSLType type) {
-@@ -173,6 +174,7 @@ static inline uint32_t grsltype_to_size(GrSLType type) {
+     switch(type) {
+         case kByte_GrSLType:
+         case kUByte_GrSLType:
+             return 1;
+         case kByte2_GrSLType:
+@@ -168,16 +169,17 @@ static inline uint32_t grsltype_to_size(
+         case kTexture2DSampler_GrSLType:
+         case kTextureExternalSampler_GrSLType:
+         case kTexture2DRectSampler_GrSLType:
+         case kTexture2D_GrSLType:
+         case kSampler_GrSLType:
              break;
      }
      SK_ABORT("Unexpected type");
@@ -459,11 +753,20 @@
  }
  
  uint32_t get_ubo_offset(uint32_t* currentOffset,
+                         GrSLType type,
+                         int arrayCount) {
+     uint32_t alignmentMask = grsltype_to_alignment_mask(type);
+     // We want to use the std140 layout here, so we must make arrays align to 16 bytes.
+     if (arrayCount || type == kFloat2x2_GrSLType) {
 diff --git a/gfx/skia/skia/src/gpu/dawn/GrDawnVaryingHandler.cpp b/gfx/skia/skia/src/gpu/dawn/GrDawnVaryingHandler.cpp
-index b3885d20c9..0d2bac39de 100644
 --- a/gfx/skia/skia/src/gpu/dawn/GrDawnVaryingHandler.cpp
 +++ b/gfx/skia/skia/src/gpu/dawn/GrDawnVaryingHandler.cpp
-@@ -76,6 +76,7 @@ static inline int grsltype_to_location_size(GrSLType type) {
+@@ -71,16 +71,17 @@ static inline int grsltype_to_location_s
+         case kUByte_GrSLType:
+              return 1;
+         case kTexture2D_GrSLType:
+              return 0;
+         case kSampler_GrSLType:
               return 0;
      }
      SK_ABORT("Unexpected type");
@@ -471,11 +774,20 @@
  }
  
  static void finalize_helper(GrDawnVaryingHandler::VarArray& vars) {
+     int locationIndex = 0;
+     for (int i = 0; i < vars.count(); ++i) {
+         GrShaderVar& var = vars[i];
+         SkString location;
+         location.appendf("location = %d", locationIndex);
 diff --git a/gfx/skia/skia/src/gpu/effects/GrConstColorProcessor.fp b/gfx/skia/skia/src/gpu/effects/GrConstColorProcessor.fp
-index 18cc91a4b1..fd6694bb76 100644
 --- a/gfx/skia/skia/src/gpu/effects/GrConstColorProcessor.fp
 +++ b/gfx/skia/skia/src/gpu/effects/GrConstColorProcessor.fp
-@@ -58,6 +58,7 @@ void main() {
+@@ -53,16 +53,17 @@ void main() {
+             case InputMode::kIgnore:
+                 return color;
+             case InputMode::kModulateA:
+                 return color * input.fA;
+             case InputMode::kModulateRGBA:
                  return color * input;
          }
          SK_ABORT("Unexpected mode");
@@ -483,11 +795,20 @@
      }
  }
  
+ @test(d) {
+     SkPMColor4f color;
+     int colorPicker = d->fRandom->nextULessThan(3);
+     switch (colorPicker) {
+         case 0: {
 diff --git a/gfx/skia/skia/src/gpu/effects/GrCoverageSetOpXP.cpp b/gfx/skia/skia/src/gpu/effects/GrCoverageSetOpXP.cpp
-index b75842c94a..714fc350d5 100644
 --- a/gfx/skia/skia/src/gpu/effects/GrCoverageSetOpXP.cpp
 +++ b/gfx/skia/skia/src/gpu/effects/GrCoverageSetOpXP.cpp
-@@ -204,6 +204,7 @@ const GrXPFactory* GrCoverageSetOpXPFactory::Get(SkRegion::Op regionOp, bool inv
+@@ -199,16 +199,17 @@ const GrXPFactory* GrCoverageSetOpXPFact
+                 static _CONSTEXPR_ const GrCoverageSetOpXPFactory gRevDiffCDXPF(
+                         SkRegion::kReverseDifference_Op, false);
+                 return &gRevDiffCDXPF;
+             }
+         }
      }
  #undef _CONSTEXPR_
      SK_ABORT("Unknown region op.");
@@ -495,11 +816,20 @@
  }
  
  sk_sp<const GrXferProcessor> GrCoverageSetOpXPFactory::makeXferProcessor(
+         const GrProcessorAnalysisColor&,
+         GrProcessorAnalysisCoverage,
+         bool hasMixedSamples,
+         const GrCaps& caps,
+         GrClampType) const {
 diff --git a/gfx/skia/skia/src/gpu/effects/GrPorterDuffXferProcessor.cpp b/gfx/skia/skia/src/gpu/effects/GrPorterDuffXferProcessor.cpp
-index 47d92dbde4..1d44d9ad82 100644
 --- a/gfx/skia/skia/src/gpu/effects/GrPorterDuffXferProcessor.cpp
 +++ b/gfx/skia/skia/src/gpu/effects/GrPorterDuffXferProcessor.cpp
-@@ -753,6 +753,7 @@ const GrXPFactory* GrPorterDuffXPFactory::Get(SkBlendMode blendMode) {
+@@ -748,16 +748,17 @@ const GrXPFactory* GrPorterDuffXPFactory
+         case SkBlendMode::kPlus:
+             return &gPlusPDXPF;
+         case SkBlendMode::kModulate:
+             return &gModulatePDXPF;
+         case SkBlendMode::kScreen:
              return &gScreenPDXPF;
          default:
              SK_ABORT("Unexpected blend mode.");
@@ -507,11 +837,20 @@
      }
  }
  
+ sk_sp<const GrXferProcessor> GrPorterDuffXPFactory::makeXferProcessor(
+         const GrProcessorAnalysisColor& color, GrProcessorAnalysisCoverage coverage,
+         bool hasMixedSamples, const GrCaps& caps, GrClampType clampType) const {
+     BlendFormula blendFormula;
+     bool isLCD = coverage == GrProcessorAnalysisCoverage::kLCD;
 diff --git a/gfx/skia/skia/src/gpu/effects/GrSkSLFP.cpp b/gfx/skia/skia/src/gpu/effects/GrSkSLFP.cpp
-index 9269ebf668..3169ab6e3f 100644
 --- a/gfx/skia/skia/src/gpu/effects/GrSkSLFP.cpp
 +++ b/gfx/skia/skia/src/gpu/effects/GrSkSLFP.cpp
-@@ -154,6 +154,7 @@ public:
+@@ -149,16 +149,17 @@ public:
+             return kHalf4x4_GrSLType;
+         } else if (type == *fContext.fBool_Type) {
+             return kBool_GrSLType;
+         } else if (type == *fContext.fInt_Type) {
+             return kInt_GrSLType;
          }
          printf("%s\n", SkSL::String(type.fName).c_str());
          SK_ABORT("unsupported uniform type");
@@ -519,7 +858,17 @@
      }
  
      void emitCode(EmitArgs& args) override {
-@@ -568,6 +569,7 @@ std::unique_ptr<GrFragmentProcessor> GrSkSLFP::TestCreate(GrProcessorTestData* d
+         for (const auto& v : fInAndUniformVars) {
+             if (v->fModifiers.fFlags & SkSL::Modifiers::kUniform_Flag && v->fType !=
+                                                                 *fContext.fFragmentProcessor_Type) {
+                 fUniformHandles.push_back(args.fUniformHandler->addUniform(
+                                                                    kFragment_GrShaderFlag,
+@@ -563,11 +564,12 @@ std::unique_ptr<GrFragmentProcessor> GrS
+             }
+             std::unique_ptr<GrSkSLFP> result = GrSkSLFP::Make(d->context(), overdrawIndex,
+                                                               "Overdraw", SKSL_OVERDRAW_SRC,
+                                                               &inputs, sizeof(inputs));
+             return std::unique_ptr<GrFragmentProcessor>(result.release());
          }
      }
      SK_ABORT("unreachable");
@@ -528,10 +877,14 @@
  
  #endif
 diff --git a/gfx/skia/skia/src/gpu/effects/generated/GrConstColorProcessor.h b/gfx/skia/skia/src/gpu/effects/generated/GrConstColorProcessor.h
-index df64bce9b7..bc9024cb07 100644
 --- a/gfx/skia/skia/src/gpu/effects/generated/GrConstColorProcessor.h
 +++ b/gfx/skia/skia/src/gpu/effects/generated/GrConstColorProcessor.h
-@@ -41,6 +41,7 @@ public:
+@@ -36,16 +36,17 @@ public:
+             case InputMode::kIgnore:
+                 return color;
+             case InputMode::kModulateA:
+                 return color * input.fA;
+             case InputMode::kModulateRGBA:
                  return color * input;
          }
          SK_ABORT("Unexpected mode");
@@ -539,11 +892,20 @@
      }
      static std::unique_ptr<GrFragmentProcessor> Make(SkPMColor4f color, InputMode mode) {
          return std::unique_ptr<GrFragmentProcessor>(new GrConstColorProcessor(color, mode));
+     }
+     GrConstColorProcessor(const GrConstColorProcessor& src);
+     std::unique_ptr<GrFragmentProcessor> clone() const override;
+     const char* name() const override { return "ConstColorProcessor"; }
+     SkPMColor4f color;
 diff --git a/gfx/skia/skia/src/gpu/geometry/GrShape.cpp b/gfx/skia/skia/src/gpu/geometry/GrShape.cpp
-index 4fc3472ffb..f16a2c536e 100644
 --- a/gfx/skia/skia/src/gpu/geometry/GrShape.cpp
 +++ b/gfx/skia/skia/src/gpu/geometry/GrShape.cpp
-@@ -164,6 +164,7 @@ SkRect GrShape::bounds() const {
+@@ -159,16 +159,17 @@ SkRect GrShape::bounds() const {
+             return fRRectData.fRRect.getBounds();
+         case Type::kArc:
+             // Could make this less conservative by looking at angles.
+             return fArcData.fOval;
+         case Type::kPath:
              return this->path().getBounds();
      }
      SK_ABORT("Unknown shape type");
@@ -551,7 +913,17 @@
  }
  
  SkRect GrShape::styledBounds() const {
-@@ -254,6 +255,7 @@ int GrShape::unstyledKeySize() const {
+     if (this->isEmpty() && !fStyle.hasNonDashPathEffect()) {
+         return SkRect::MakeEmpty();
+     }
+ 
+     SkRect bounds;
+@@ -249,16 +250,17 @@ int GrShape::unstyledKeySize() const {
+             if (dataKeySize >= 0) {
+                 return dataKeySize;
+             }
+             // The key is the path ID and fill type.
+             return 2;
          }
      }
      SK_ABORT("Should never get here.");
@@ -559,11 +931,20 @@
  }
  
  void GrShape::writeUnstyledKey(uint32_t* key) const {
+     SkASSERT(this->unstyledKeySize());
+     SkDEBUGCODE(uint32_t* origKey = key;)
+     if (fInheritedKey.count()) {
+         memcpy(key, fInheritedKey.get(), sizeof(uint32_t) * fInheritedKey.count());
+         SkDEBUGCODE(key += fInheritedKey.count();)
 diff --git a/gfx/skia/skia/src/gpu/gl/GrGLCaps.cpp b/gfx/skia/skia/src/gpu/gl/GrGLCaps.cpp
-index 3142399c58..2dab83639a 100644
 --- a/gfx/skia/skia/src/gpu/gl/GrGLCaps.cpp
 +++ b/gfx/skia/skia/src/gpu/gl/GrGLCaps.cpp
-@@ -4159,6 +4159,7 @@ GrBackendFormat GrGLCaps::getBackendFormatFromCompressionType(
+@@ -4154,16 +4154,17 @@ GrBackendFormat GrGLCaps::getBackendForm
+         case SkImage::kETC1_CompressionType:
+             // if ETC2 is available default to that format
+             if (this->isFormatTexturable(GrGLFormat::kCOMPRESSED_RGB8_ETC2)) {
+                 return GrBackendFormat::MakeGL(GR_GL_COMPRESSED_RGB8_ETC2, GR_GL_TEXTURE_2D);
+             }
              return GrBackendFormat::MakeGL(GR_GL_COMPRESSED_ETC1_RGB8, GR_GL_TEXTURE_2D);
      }
      SK_ABORT("Invalid compression type");
@@ -571,21 +952,34 @@
  }
  
  GrSwizzle GrGLCaps::getTextureSwizzle(const GrBackendFormat& format, GrColorType colorType) const {
+     const auto& info = this->getFormatInfo(format.asGLFormat());
+     for (int i = 0; i < info.fColorTypeInfoCount; ++i) {
+         const auto& ctInfo = info.fColorTypeInfos[i];
+         if (ctInfo.fColorType == colorType) {
+             return ctInfo.fTextureSwizzle;
 diff --git a/gfx/skia/skia/src/gpu/gl/GrGLGLSL.cpp b/gfx/skia/skia/src/gpu/gl/GrGLGLSL.cpp
-index 2ad38bc35e..8dc730f1b7 100644
 --- a/gfx/skia/skia/src/gpu/gl/GrGLGLSL.cpp
 +++ b/gfx/skia/skia/src/gpu/gl/GrGLGLSL.cpp
-@@ -68,4 +68,5 @@ bool GrGLGetGLSLGeneration(const GrGLInterface* gl, GrGLSLGeneration* generation
+@@ -63,9 +63,10 @@ bool GrGLGetGLSLGeneration(const GrGLInt
+         if (ver >= GR_GLSL_VER(2,0)) {
+             *generation = k330_GrGLSLGeneration;  // ES 3.0
+         } else {
+             *generation = k110_GrGLSLGeneration;
+         }
          return true;
      }
      SK_ABORT("Unknown GL Standard");
 +    SkUNREACHABLE;
  }
 diff --git a/gfx/skia/skia/src/gpu/gl/GrGLGpu.cpp b/gfx/skia/skia/src/gpu/gl/GrGLGpu.cpp
-index 937e168db5..da66902895 100644
 --- a/gfx/skia/skia/src/gpu/gl/GrGLGpu.cpp
 +++ b/gfx/skia/skia/src/gpu/gl/GrGLGpu.cpp
-@@ -196,6 +196,7 @@ static int gl_target_to_binding_index(GrGLenum target) {
+@@ -191,16 +191,17 @@ static int gl_target_to_binding_index(Gr
+         case GR_GL_TEXTURE_2D:
+             return 0;
+         case GR_GL_TEXTURE_RECTANGLE:
+             return 1;
+         case GR_GL_TEXTURE_EXTERNAL:
              return 2;
      }
      SK_ABORT("Unexpected GL texture target.");
@@ -593,7 +987,17 @@
  }
  
  GrGpuResource::UniqueID GrGLGpu::TextureUnitBindings::boundID(GrGLenum target) const {
-@@ -234,6 +235,7 @@ static GrGLenum filter_to_gl_mag_filter(GrSamplerState::Filter filter) {
+     return fTargetBindings[gl_target_to_binding_index(target)].fBoundResourceID;
+ }
+ 
+ bool GrGLGpu::TextureUnitBindings::hasBeenModified(GrGLenum target) const {
+     return fTargetBindings[gl_target_to_binding_index(target)].fHasBeenModified;
+@@ -229,39 +230,42 @@ void GrGLGpu::TextureUnitBindings::inval
+ 
+ static GrGLenum filter_to_gl_mag_filter(GrSamplerState::Filter filter) {
+     switch (filter) {
+         case GrSamplerState::Filter::kNearest: return GR_GL_NEAREST;
+         case GrSamplerState::Filter::kBilerp:  return GR_GL_LINEAR;
          case GrSamplerState::Filter::kMipMap:  return GR_GL_LINEAR;
      }
      SK_ABORT("Unknown filter");
@@ -601,7 +1005,9 @@
  }
  
  static GrGLenum filter_to_gl_min_filter(GrSamplerState::Filter filter) {
-@@ -243,6 +245,7 @@ static GrGLenum filter_to_gl_min_filter(GrSamplerState::Filter filter) {
+     switch (filter) {
+         case GrSamplerState::Filter::kNearest: return GR_GL_NEAREST;
+         case GrSamplerState::Filter::kBilerp:  return GR_GL_LINEAR;
          case GrSamplerState::Filter::kMipMap:  return GR_GL_LINEAR_MIPMAP_LINEAR;
      }
      SK_ABORT("Unknown filter");
@@ -609,7 +1015,14 @@
  }
  
  static inline GrGLenum wrap_mode_to_gl_wrap(GrSamplerState::WrapMode wrapMode,
-@@ -257,6 +260,7 @@ static inline GrGLenum wrap_mode_to_gl_wrap(GrSamplerState::WrapMode wrapMode,
+                                             const GrCaps& caps) {
+     switch (wrapMode) {
+         case GrSamplerState::WrapMode::kClamp:        return GR_GL_CLAMP_TO_EDGE;
+         case GrSamplerState::WrapMode::kRepeat:       return GR_GL_REPEAT;
+         case GrSamplerState::WrapMode::kMirrorRepeat: return GR_GL_MIRRORED_REPEAT;
+         case GrSamplerState::WrapMode::kClampToBorder:
+             // May not be supported but should have been caught earlier
+             SkASSERT(caps.clampToBorderSupport());
              return GR_GL_CLAMP_TO_BORDER;
      }
      SK_ABORT("Unknown wrap mode");
@@ -617,7 +1030,17 @@
  }
  
  ///////////////////////////////////////////////////////////////////////////////
-@@ -1107,7 +1111,7 @@ static bool renderbuffer_storage_msaa(const GrGLContext& ctx,
+ 
+ class GrGLGpu::SamplerObjectCache {
+ public:
+     SamplerObjectCache(GrGLGpu* gpu) : fGpu(gpu) {
+         fNumTextureUnits = fGpu->glCaps().shaderCaps()->maxFragmentSamplers();
+@@ -1102,17 +1106,17 @@ static bool renderbuffer_storage_msaa(co
+             GL_ALLOC_CALL(ctx.interface(),
+                             RenderbufferStorageMultisampleES2EXT(GR_GL_RENDERBUFFER,
+                                                                 sampleCount,
+                                                                 format,
+                                                                 width, height));
              break;
          case GrGLCaps::kNone_MSFBOType:
              SK_ABORT("Shouldn't be here if we don't support multisampled renderbuffers.");
@@ -626,7 +1049,17 @@
      }
      return (GR_GL_NO_ERROR == CHECK_ALLOC_ERROR(ctx.interface()));
  }
-@@ -2275,9 +2279,10 @@ static GrGLenum gr_primitive_type_to_gl_mode(GrPrimitiveType primitiveType) {
+ 
+ bool GrGLGpu::createRenderTargetObjects(const GrGLTexture::Desc& desc,
+                                         int sampleCount,
+                                         GrGLRenderTarget::IDs* rtIDs) {
+     rtIDs->fMSColorRenderbufferID = 0;
+@@ -2270,19 +2274,20 @@ static GrGLenum gr_primitive_type_to_gl_
+         case GrPrimitiveType::kPoints:
+             return GR_GL_POINTS;
+         case GrPrimitiveType::kLines:
+             return GR_GL_LINES;
+         case GrPrimitiveType::kLineStrip:
              return GR_GL_LINE_STRIP;
          case GrPrimitiveType::kPath:
              SK_ABORT("non-mesh-based GrPrimitiveType");
@@ -638,7 +1071,17 @@
  }
  
  void GrGLGpu::sendMeshToGpu(GrPrimitiveType primitiveType, const GrBuffer* vertexBuffer,
-@@ -4006,7 +4011,8 @@ int GrGLGpu::TextureToCopyProgramIdx(GrTexture* texture) {
+                             int vertexCount, int baseVertex) {
+     const GrGLenum glPrimType = gr_primitive_type_to_gl_mode(primitiveType);
+     if (this->glCaps().drawArraysBaseVertexIsBroken()) {
+         this->setupGeometry(nullptr, vertexBuffer, baseVertex, nullptr, 0, GrPrimitiveRestart::kNo);
+         GL_CALL(DrawArrays(glPrimType, 0, vertexCount));
+@@ -4001,17 +4006,18 @@ int GrGLGpu::TextureToCopyProgramIdx(GrT
+     switch (GrSLCombinedSamplerTypeForTextureType(texture->texturePriv().textureType())) {
+         case kTexture2DSampler_GrSLType:
+             return 0;
+         case kTexture2DRectSampler_GrSLType:
+             return 1;
          case kTextureExternalSampler_GrSLType:
              return 2;
          default:
@@ -648,11 +1091,20 @@
      }
  }
  
+ #ifdef SK_ENABLE_DUMP_GPU
+ #include "src/utils/SkJSONWriter.h"
+ void GrGLGpu::onDumpJSON(SkJSONWriter* writer) const {
+     // We are called by the base class, which has already called beginObject(). We choose to nest
+     // all of our caps information in a named sub-object.
 diff --git a/gfx/skia/skia/src/gpu/gl/GrGLPath.cpp b/gfx/skia/skia/src/gpu/gl/GrGLPath.cpp
-index e001bf93a1..8d51f00e4b 100644
 --- a/gfx/skia/skia/src/gpu/gl/GrGLPath.cpp
 +++ b/gfx/skia/skia/src/gpu/gl/GrGLPath.cpp
-@@ -197,6 +197,7 @@ static GrPathRendering::FillType convert_skpath_filltype(SkPath::FillType fill)
+@@ -192,16 +192,17 @@ inline bool init_path_object_for_general
+ 
+ /*
+  * For now paths only natively support winding and even odd fill types
+  */
+ static GrPathRendering::FillType convert_skpath_filltype(SkPath::FillType fill) {
      switch (fill) {
          default:
              SK_ABORT("Incomplete Switch\n");
@@ -660,11 +1112,20 @@
          case SkPath::kWinding_FillType:
          case SkPath::kInverseWinding_FillType:
              return GrPathRendering::kWinding_FillType;
+         case SkPath::kEvenOdd_FillType:
+         case SkPath::kInverseEvenOdd_FillType:
+             return GrPathRendering::kEvenOdd_FillType;
+     }
+ }
 diff --git a/gfx/skia/skia/src/gpu/gl/GrGLTexture.cpp b/gfx/skia/skia/src/gpu/gl/GrGLTexture.cpp
-index a5a1a3708b..1a223cf1e2 100644
 --- a/gfx/skia/skia/src/gpu/gl/GrGLTexture.cpp
 +++ b/gfx/skia/skia/src/gpu/gl/GrGLTexture.cpp
-@@ -25,6 +25,7 @@ GrTextureType GrGLTexture::TextureTypeFromTarget(GrGLenum target) {
+@@ -20,30 +20,33 @@ GrTextureType GrGLTexture::TextureTypeFr
+         case GR_GL_TEXTURE_2D:
+             return GrTextureType::k2D;
+         case GR_GL_TEXTURE_RECTANGLE:
+             return GrTextureType::kRectangle;
+         case GR_GL_TEXTURE_EXTERNAL:
              return GrTextureType::kExternal;
      }
      SK_ABORT("Unexpected texture target");
@@ -672,7 +1133,12 @@
  }
  
  static inline GrGLenum target_from_texture_type(GrTextureType type) {
-@@ -37,8 +38,10 @@ static inline GrGLenum target_from_texture_type(GrTextureType type) {
+     switch (type) {
+         case GrTextureType::k2D:
+             return GR_GL_TEXTURE_2D;
+         case GrTextureType::kRectangle:
+             return GR_GL_TEXTURE_RECTANGLE;
+         case GrTextureType::kExternal:
              return GR_GL_TEXTURE_EXTERNAL;
          default:
              SK_ABORT("Unexpected texture target");
@@ -683,11 +1149,20 @@
  }
  
  // Because this class is virtually derived from GrSurface we must explicitly call its constructor.
+ GrGLTexture::GrGLTexture(GrGLGpu* gpu, SkBudgeted budgeted, const Desc& desc,
+                          GrMipMapsStatus mipMapsStatus)
+         : GrSurface(gpu, desc.fSize, desc.fConfig, GrProtected::kNo)
+         , INHERITED(gpu, desc.fSize, desc.fConfig, GrProtected::kNo,
+                     TextureTypeFromTarget(desc.fTarget), mipMapsStatus)
 diff --git a/gfx/skia/skia/src/gpu/gl/GrGLVertexArray.cpp b/gfx/skia/skia/src/gpu/gl/GrGLVertexArray.cpp
-index cfac573241..4d878af131 100644
 --- a/gfx/skia/skia/src/gpu/gl/GrGLVertexArray.cpp
 +++ b/gfx/skia/skia/src/gpu/gl/GrGLVertexArray.cpp
-@@ -80,6 +80,7 @@ static AttribLayout attrib_layout(GrVertexAttribType type) {
+@@ -75,16 +75,17 @@ static AttribLayout attrib_layout(GrVert
+         case kUint_GrVertexAttribType:
+             return {false, 1, GR_GL_UNSIGNED_INT};
+         case kUShort_norm_GrVertexAttribType:
+             return {true, 1, GR_GL_UNSIGNED_SHORT};
+         case kUShort4_norm_GrVertexAttribType:
              return {true, 4, GR_GL_UNSIGNED_SHORT};
      }
      SK_ABORT("Unknown vertex attrib type");
@@ -695,21 +1170,34 @@
  };
  
  void GrGLAttribArrayState::set(GrGLGpu* gpu,
+                                int index,
+                                const GrBuffer* vertexBuffer,
+                                GrVertexAttribType cpuType,
+                                GrSLType gpuType,
+                                GrGLsizei stride,
 diff --git a/gfx/skia/skia/src/gpu/glsl/GrGLSL.cpp b/gfx/skia/skia/src/gpu/glsl/GrGLSL.cpp
-index afa9159bb0..d073fa6f8b 100644
 --- a/gfx/skia/skia/src/gpu/glsl/GrGLSL.cpp
 +++ b/gfx/skia/skia/src/gpu/glsl/GrGLSL.cpp
-@@ -98,4 +98,5 @@ const char* GrGLSLTypeString(GrSLType t) {
+@@ -93,9 +93,10 @@ const char* GrGLSLTypeString(GrSLType t)
+         case kUByte4_GrSLType:
+             return "ubyte4";
+         case kTexture2D_GrSLType:
+             return "texture2D";
+         case kSampler_GrSLType:
              return "sampler";
      }
      SK_ABORT("Unknown shader var type.");
 +    SkUNREACHABLE;
  }
 diff --git a/gfx/skia/skia/src/gpu/glsl/GrGLSLVarying.cpp b/gfx/skia/skia/src/gpu/glsl/GrGLSLVarying.cpp
-index ce086a9082..16a0171e7d 100644
 --- a/gfx/skia/skia/src/gpu/glsl/GrGLSLVarying.cpp
 +++ b/gfx/skia/skia/src/gpu/glsl/GrGLSLVarying.cpp
-@@ -35,6 +35,7 @@ static bool use_flat_interpolation(GrGLSLVaryingHandler::Interpolation interpola
+@@ -30,16 +30,17 @@ static bool use_flat_interpolation(GrGLS
+             SkASSERT(!shaderCaps.preferFlatInterpolation() ||
+                      shaderCaps.flatInterpolationSupport());
+             return shaderCaps.preferFlatInterpolation();
+         case Interpolation::kMustBeFlat:
+             SkASSERT(shaderCaps.flatInterpolationSupport());
              return true;
      }
      SK_ABORT("Invalid interpolation");
@@ -717,11 +1205,20 @@
  }
  
  void GrGLSLVaryingHandler::addVarying(const char* name, GrGLSLVarying* varying,
+                                       Interpolation interpolation) {
+     SkASSERT(GrSLTypeIsFloatType(varying->type()) || Interpolation::kMustBeFlat == interpolation);
+     bool willUseGeoShader = fProgramBuilder->primitiveProcessor().willUseGeoShader();
+     VaryingInfo& v = fVaryings.push_back();
+ 
 diff --git a/gfx/skia/skia/src/gpu/glsl/GrGLSLVertexGeoBuilder.cpp b/gfx/skia/skia/src/gpu/glsl/GrGLSLVertexGeoBuilder.cpp
-index ccec08db8b..751b40e9fe 100644
 --- a/gfx/skia/skia/src/gpu/glsl/GrGLSLVertexGeoBuilder.cpp
 +++ b/gfx/skia/skia/src/gpu/glsl/GrGLSLVertexGeoBuilder.cpp
-@@ -51,6 +51,7 @@ static const char* input_type_name(GrGLSLGeometryBuilder::InputType in) {
+@@ -46,26 +46,28 @@ void GrGLSLVertexBuilder::onFinalize() {
+ static const char* input_type_name(GrGLSLGeometryBuilder::InputType in) {
+     using InputType = GrGLSLGeometryBuilder::InputType;
+     switch (in) {
+         case InputType::kPoints: return "points";
+         case InputType::kLines: return "lines";
          case InputType::kTriangles: return "triangles";
      }
      SK_ABORT("invalid input type");
@@ -729,7 +1226,10 @@
  }
  
  static const char* output_type_name(GrGLSLGeometryBuilder::OutputType out) {
-@@ -61,6 +62,7 @@ static const char* output_type_name(GrGLSLGeometryBuilder::OutputType out) {
+     using OutputType = GrGLSLGeometryBuilder::OutputType;
+     switch (out) {
+         case OutputType::kPoints: return "points";
+         case OutputType::kLineStrip: return "line_strip";
          case OutputType::kTriangleStrip: return "triangle_strip";
      }
      SK_ABORT("invalid output type");
@@ -737,11 +1237,20 @@
  }
  
  void GrGLSLGeometryBuilder::configure(InputType inputType, OutputType outputType, int maxVertices,
+                                       int numInvocations) {
+     SkASSERT(!this->isConfigured());
+     fNumInvocations = numInvocations;
+     this->addLayoutQualifier(input_type_name(inputType), kIn_InterfaceQualifier);
+     this->addLayoutQualifier(SkStringPrintf("invocations = %i", numInvocations).c_str(),
 diff --git a/gfx/skia/skia/src/gpu/mtl/GrMtlCaps.mm b/gfx/skia/skia/src/gpu/mtl/GrMtlCaps.mm
-index 7511f26366..82ff3db772 100644
 --- a/gfx/skia/skia/src/gpu/mtl/GrMtlCaps.mm
 +++ b/gfx/skia/skia/src/gpu/mtl/GrMtlCaps.mm
-@@ -506,6 +506,7 @@ size_t GrMtlCaps::GetFormatIndex(MTLPixelFormat pixelFormat) {
+@@ -501,16 +501,17 @@ size_t GrMtlCaps::GetFormatIndex(MTLPixe
+     static_assert(SK_ARRAY_COUNT(kMtlFormats) == GrMtlCaps::kNumMtlFormats,
+                   "Size of kMtlFormats array must match static value in header");
+     for (size_t i = 0; i < GrMtlCaps::kNumMtlFormats; ++i) {
+         if (kMtlFormats[i] == pixelFormat) {
+             return i;
          }
      }
      SK_ABORT("Invalid MTLPixelFormat");
@@ -749,7 +1258,17 @@
  }
  
  void GrMtlCaps::initFormatTable() {
-@@ -1011,6 +1012,7 @@ GrBackendFormat GrMtlCaps::getBackendFormatFromCompressionType(
+     FormatInfo* info;
+ 
+     // Format: R8Unorm
+     {
+         info = &fFormatTable[GetFormatIndex(MTLPixelFormatR8Unorm)];
+@@ -1006,16 +1007,17 @@ GrBackendFormat GrMtlCaps::getBackendFor
+         case SkImage::kETC1_CompressionType:
+ #ifdef SK_BUILD_FOR_MAC
+             return {};
+ #else
+             return GrBackendFormat::MakeMtl(MTLPixelFormatETC2_RGB8);
  #endif
      }
      SK_ABORT("Invalid compression type");
@@ -757,11 +1276,20 @@
  }
  
  GrSwizzle GrMtlCaps::getTextureSwizzle(const GrBackendFormat& format, GrColorType colorType) const {
+     MTLPixelFormat mtlFormat = GrBackendFormatAsMTLPixelFormat(format);
+     SkASSERT(mtlFormat != MTLPixelFormatInvalid);
+     const auto& info = this->getFormatInfo(mtlFormat);
+     for (int i = 0; i < info.fColorTypeInfoCount; ++i) {
+         const auto& ctInfo = info.fColorTypeInfos[i];
 diff --git a/gfx/skia/skia/src/gpu/mtl/GrMtlPipelineStateBuilder.mm b/gfx/skia/skia/src/gpu/mtl/GrMtlPipelineStateBuilder.mm
-index 090c41b9de..4be37d4c53 100644
 --- a/gfx/skia/skia/src/gpu/mtl/GrMtlPipelineStateBuilder.mm
 +++ b/gfx/skia/skia/src/gpu/mtl/GrMtlPipelineStateBuilder.mm
-@@ -155,6 +155,7 @@ static inline MTLVertexFormat attribute_type_to_mtlformat(GrVertexAttribType typ
+@@ -150,16 +150,17 @@ static inline MTLVertexFormat attribute_
+                 return MTLVertexFormatUShortNormalized;
+             } else {
+                 return MTLVertexFormatInvalid;
+             }
+         case kUShort4_norm_GrVertexAttribType:
              return MTLVertexFormatUShort4Normalized;
      }
      SK_ABORT("Unknown vertex attribute type");
@@ -769,7 +1297,17 @@
  }
  
  static MTLVertexDescriptor* create_vertex_descriptor(const GrPrimitiveProcessor& primProc) {
-@@ -276,6 +277,7 @@ static MTLBlendFactor blend_coeff_to_mtl_blend(GrBlendCoeff coeff) {
+     uint32_t vertexBinding = 0, instanceBinding = 0;
+ 
+     int nextBinding = GrMtlUniformHandler::kLastUniformBinding + 1;
+     if (primProc.hasVertexAttributes()) {
+         vertexBinding = nextBinding++;
+@@ -271,16 +272,17 @@ static MTLBlendFactor blend_coeff_to_mtl
+             } else {
+                 return MTLBlendFactorZero;
+             }
+         case kIllegal_GrBlendCoeff:
+             return MTLBlendFactorZero;
      }
  
      SK_ABORT("Unknown blend coefficient");
@@ -777,11 +1315,20 @@
  }
  
  static MTLBlendOperation blend_equation_to_mtl_blend_op(GrBlendEquation equation) {
+     static const MTLBlendOperation gTable[] = {
+         MTLBlendOperationAdd,              // kAdd_GrBlendEquation
+         MTLBlendOperationSubtract,         // kSubtract_GrBlendEquation
+         MTLBlendOperationReverseSubtract,  // kReverseSubtract_GrBlendEquation
+     };
 diff --git a/gfx/skia/skia/src/gpu/mtl/GrMtlSampler.mm b/gfx/skia/skia/src/gpu/mtl/GrMtlSampler.mm
-index 2d7344eff7..2d03c968bf 100644
 --- a/gfx/skia/skia/src/gpu/mtl/GrMtlSampler.mm
 +++ b/gfx/skia/skia/src/gpu/mtl/GrMtlSampler.mm
-@@ -38,6 +38,7 @@ static inline MTLSamplerAddressMode wrap_mode_to_mtl_sampler_address(
+@@ -33,16 +33,17 @@ static inline MTLSamplerAddressMode wrap
+             } else
+ #endif
+             {
+                 SkASSERT(false);
+                 return MTLSamplerAddressModeClampToEdge;
              }
      }
      SK_ABORT("Unknown wrap mode.");
@@ -789,11 +1336,20 @@
  }
  
  GrMtlSampler* GrMtlSampler::Create(const GrMtlGpu* gpu, const GrSamplerState& samplerState) {
+     static MTLSamplerMinMagFilter mtlMinMagFilterModes[] = {
+         MTLSamplerMinMagFilterNearest,
+         MTLSamplerMinMagFilterLinear,
+         MTLSamplerMinMagFilterLinear
+     };
 diff --git a/gfx/skia/skia/src/gpu/mtl/GrMtlUniformHandler.mm b/gfx/skia/skia/src/gpu/mtl/GrMtlUniformHandler.mm
-index 89e1263eaf..7a2d007918 100644
 --- a/gfx/skia/skia/src/gpu/mtl/GrMtlUniformHandler.mm
 +++ b/gfx/skia/skia/src/gpu/mtl/GrMtlUniformHandler.mm
-@@ -90,6 +90,7 @@ static uint32_t grsltype_to_alignment_mask(GrSLType type) {
+@@ -85,16 +85,17 @@ static uint32_t grsltype_to_alignment_ma
+         case kTexture2DSampler_GrSLType:
+         case kTextureExternalSampler_GrSLType:
+         case kTexture2DRectSampler_GrSLType:
+         case kSampler_GrSLType:
+         case kTexture2D_GrSLType:
              break;
      }
      SK_ABORT("Unexpected type");
@@ -801,7 +1357,17 @@
  }
  
  /** Returns the size in bytes taken up in Metal buffers for GrSLTypes. */
-@@ -172,6 +173,7 @@ static inline uint32_t grsltype_to_mtl_size(GrSLType type) {
+ static inline uint32_t grsltype_to_mtl_size(GrSLType type) {
+     switch(type) {
+         case kByte_GrSLType:
+             return sizeof(int8_t);
+         case kByte2_GrSLType:
+@@ -167,16 +168,17 @@ static inline uint32_t grsltype_to_mtl_s
+         case kTexture2DSampler_GrSLType:
+         case kTextureExternalSampler_GrSLType:
+         case kTexture2DRectSampler_GrSLType:
+         case kSampler_GrSLType:
+         case kTexture2D_GrSLType:
              break;
      }
      SK_ABORT("Unexpected type");
@@ -809,11 +1375,20 @@
  }
  
  // Given the current offset into the ubo, calculate the offset for the uniform we're trying to add
+ // taking into consideration all alignment requirements. The uniformOffset is set to the offset for
+ // the new uniform, and currentOffset is updated to be the offset to the end of the new uniform.
+ static void get_ubo_aligned_offset(uint32_t* uniformOffset,
+                                    uint32_t* currentOffset,
+                                    uint32_t* maxAlignment,
 diff --git a/gfx/skia/skia/src/gpu/mtl/GrMtlUtil.mm b/gfx/skia/skia/src/gpu/mtl/GrMtlUtil.mm
-index eccf435074..b49a43b7ec 100644
 --- a/gfx/skia/skia/src/gpu/mtl/GrMtlUtil.mm
 +++ b/gfx/skia/skia/src/gpu/mtl/GrMtlUtil.mm
-@@ -112,6 +112,7 @@ bool GrPixelConfigToMTLFormat(GrPixelConfig config, MTLPixelFormat* format) {
+@@ -107,16 +107,17 @@ bool GrPixelConfigToMTLFormat(GrPixelCon
+         case kRGBA_16161616_GrPixelConfig:
+             *format = MTLPixelFormatRGBA16Unorm;
+             return true;
+         case kRG_half_GrPixelConfig:
+             *format = MTLPixelFormatRG16Float;
              return true;
      }
      SK_ABORT("Unexpected config");
@@ -821,11 +1396,20 @@
  }
  
  MTLTextureDescriptor* GrGetMTLTextureDescriptor(id<MTLTexture> mtlTexture) {
+     MTLTextureDescriptor* texDesc = [[MTLTextureDescriptor alloc] init];
+     texDesc.textureType = mtlTexture.textureType;
+     texDesc.pixelFormat = mtlTexture.pixelFormat;
+     texDesc.width = mtlTexture.width;
+     texDesc.height = mtlTexture.height;
 diff --git a/gfx/skia/skia/src/gpu/ops/GrDrawVerticesOp.cpp b/gfx/skia/skia/src/gpu/ops/GrDrawVerticesOp.cpp
-index 4b311b5207..8a010a1de1 100644
 --- a/gfx/skia/skia/src/gpu/ops/GrDrawVerticesOp.cpp
 +++ b/gfx/skia/skia/src/gpu/ops/GrDrawVerticesOp.cpp
-@@ -610,6 +610,7 @@ static uint32_t seed_vertices(GrPrimitiveType type) {
+@@ -605,16 +605,17 @@ static uint32_t seed_vertices(GrPrimitiv
+         case GrPrimitiveType::kLines:
+         case GrPrimitiveType::kLineStrip:
+             return 2;
+         case GrPrimitiveType::kPath:
+             SkASSERT(0);
              return 0;
      }
      SK_ABORT("Incomplete switch\n");
@@ -833,7 +1417,17 @@
  }
  
  static uint32_t primitive_vertices(GrPrimitiveType type) {
-@@ -627,6 +628,7 @@ static uint32_t primitive_vertices(GrPrimitiveType type) {
+     switch (type) {
+         case GrPrimitiveType::kTriangles:
+             return 3;
+         case GrPrimitiveType::kLines:
+             return 2;
+@@ -622,16 +623,17 @@ static uint32_t primitive_vertices(GrPri
+         case GrPrimitiveType::kPoints:
+         case GrPrimitiveType::kLineStrip:
+             return 1;
+         case GrPrimitiveType::kPath:
+             SkASSERT(0);
              return 0;
      }
      SK_ABORT("Incomplete switch\n");
@@ -841,21 +1435,34 @@
  }
  
  static SkPoint random_point(SkRandom* random, SkScalar min, SkScalar max) {
+     SkPoint p;
+     p.fX = random->nextRangeScalar(min, max);
+     p.fY = random->nextRangeScalar(min, max);
+     return p;
+ }
 diff --git a/gfx/skia/skia/src/gpu/ops/GrFillRRectOp.cpp b/gfx/skia/skia/src/gpu/ops/GrFillRRectOp.cpp
-index 6b3c023ff6..6b28723bd5 100644
 --- a/gfx/skia/skia/src/gpu/ops/GrFillRRectOp.cpp
 +++ b/gfx/skia/skia/src/gpu/ops/GrFillRRectOp.cpp
-@@ -823,4 +823,5 @@ static bool can_use_hw_derivatives_with_coverage(
+@@ -818,9 +818,10 @@ static bool can_use_hw_derivatives_with_
+                 if (!can_use_hw_derivatives_with_coverage(devScale, rrect.radii(corner))) {
+                     return false;
+                 }
+             }
+             return true;
          }
      }
      SK_ABORT("Invalid round rect type.");
 +    SkUNREACHABLE;
  }
 diff --git a/gfx/skia/skia/src/gpu/ops/GrOvalOpFactory.cpp b/gfx/skia/skia/src/gpu/ops/GrOvalOpFactory.cpp
-index b32758150f..10f0d96889 100644
 --- a/gfx/skia/skia/src/gpu/ops/GrOvalOpFactory.cpp
 +++ b/gfx/skia/skia/src/gpu/ops/GrOvalOpFactory.cpp
-@@ -2283,6 +2283,7 @@ static int rrect_type_to_vert_count(RRectType type) {
+@@ -2278,39 +2278,42 @@ static int rrect_type_to_vert_count(RRec
+     switch (type) {
+         case kFill_RRectType:
+         case kStroke_RRectType:
+             return kVertsPerStandardRRect;
+         case kOverstroke_RRectType:
              return kVertsPerOverstrokeRRect;
      }
      SK_ABORT("Invalid type");
@@ -863,7 +1470,12 @@
  }
  
  static int rrect_type_to_index_count(RRectType type) {
-@@ -2295,6 +2296,7 @@ static int rrect_type_to_index_count(RRectType type) {
+     switch (type) {
+         case kFill_RRectType:
+             return kIndicesPerFillRRect;
+         case kStroke_RRectType:
+             return kIndicesPerStrokeRRect;
+         case kOverstroke_RRectType:
              return kIndicesPerOverstrokeRRect;
      }
      SK_ABORT("Invalid type");
@@ -871,7 +1483,11 @@
  }
  
  static const uint16_t* rrect_type_to_indices(RRectType type) {
-@@ -2306,6 +2308,7 @@ static const uint16_t* rrect_type_to_indices(RRectType type) {
+     switch (type) {
+         case kFill_RRectType:
+         case kStroke_RRectType:
+             return gStandardRRectIndices;
+         case kOverstroke_RRectType:
              return gOverstrokeRRectIndices;
      }
      SK_ABORT("Invalid type");
@@ -879,11 +1495,20 @@
  }
  
  ///////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+ // For distance computations in the interior of filled rrects we:
+ //
+ //   add a interior degenerate (point or line) rect
+ //   each vertex of that rect gets -outerRad as its radius
 diff --git a/gfx/skia/skia/src/gpu/ops/GrShadowRRectOp.cpp b/gfx/skia/skia/src/gpu/ops/GrShadowRRectOp.cpp
-index 546933bb8a..fadf6096c3 100644
 --- a/gfx/skia/skia/src/gpu/ops/GrShadowRRectOp.cpp
 +++ b/gfx/skia/skia/src/gpu/ops/GrShadowRRectOp.cpp
-@@ -155,6 +155,7 @@ static int rrect_type_to_vert_count(RRectType type) {
+@@ -150,39 +150,42 @@ static int rrect_type_to_vert_count(RRec
+         case kFill_RRectType:
+             return kVertsPerFillRRect;
+         case kStroke_RRectType:
+             return kVertsPerStrokeRRect;
+         case kOverstroke_RRectType:
              return kVertsPerOverstrokeRRect;
      }
      SK_ABORT("Invalid type");
@@ -891,7 +1516,12 @@
  }
  
  static int rrect_type_to_index_count(RRectType type) {
-@@ -167,6 +168,7 @@ static int rrect_type_to_index_count(RRectType type) {
+     switch (type) {
+         case kFill_RRectType:
+             return kIndicesPerFillRRect;
+         case kStroke_RRectType:
+             return kIndicesPerStrokeRRect;
+         case kOverstroke_RRectType:
              return kIndicesPerOverstrokeRRect;
      }
      SK_ABORT("Invalid type");
@@ -899,7 +1529,11 @@
  }
  
  static const uint16_t* rrect_type_to_indices(RRectType type) {
-@@ -178,6 +180,7 @@ static const uint16_t* rrect_type_to_indices(RRectType type) {
+     switch (type) {
+         case kFill_RRectType:
+         case kStroke_RRectType:
+             return gRRectIndices + 6*4;
+         case kOverstroke_RRectType:
              return gRRectIndices;
      }
      SK_ABORT("Invalid type");
@@ -907,11 +1541,20 @@
  }
  
  ///////////////////////////////////////////////////////////////////////////////
+ namespace {
+ 
+ class ShadowCircularRRectOp final : public GrMeshDrawOp {
+ public:
+     DEFINE_OP_CLASS_ID
 diff --git a/gfx/skia/skia/src/gpu/text/GrTextBlob.h b/gfx/skia/skia/src/gpu/text/GrTextBlob.h
-index ddea88d15f..d82e84704f 100644
 --- a/gfx/skia/skia/src/gpu/text/GrTextBlob.h
 +++ b/gfx/skia/skia/src/gpu/text/GrTextBlob.h
-@@ -125,6 +125,7 @@ public:
+@@ -120,16 +120,17 @@ public:
+     }
+ 
+     void operator delete(void* p) {
+         ::operator delete(p);
+     }
  
      void* operator new(size_t) {
          SK_ABORT("All blobs are created by placement new.");
@@ -919,21 +1562,34 @@
      }
  
      void* operator new(size_t, void* p) { return p; }
+ 
+     bool hasDistanceField() const { return SkToBool(fTextType & kHasDistanceField_TextType); }
+     bool hasBitmap() const { return SkToBool(fTextType & kHasBitmap_TextType); }
+     void setHasDistanceField() { fTextType |= kHasDistanceField_TextType; }
+     void setHasBitmap() { fTextType |= kHasBitmap_TextType; }
 diff --git a/gfx/skia/skia/src/gpu/text/GrTextBlobVertexRegenerator.cpp b/gfx/skia/skia/src/gpu/text/GrTextBlobVertexRegenerator.cpp
-index 976beaf3d4..f9c01dd217 100644
 --- a/gfx/skia/skia/src/gpu/text/GrTextBlobVertexRegenerator.cpp
 +++ b/gfx/skia/skia/src/gpu/text/GrTextBlobVertexRegenerator.cpp
-@@ -284,4 +284,5 @@ bool GrTextBlob::VertexRegenerator::regenerate(GrTextBlob::VertexRegenerator::Re
+@@ -279,9 +279,10 @@ bool GrTextBlob::VertexRegenerator::rege
+         // set use tokens for all of the glyphs in our subrun.  This is only valid if we
+         // have a valid atlas generation
+         fFullAtlasManager->setUseTokenBulk(*fSubRun->bulkUseToken(),
+                                            fUploadTarget->tokenTracker()->nextDrawToken(),
+                                            fSubRun->maskFormat());
          return true;
      }
      SK_ABORT("Should not get here");
 +    SkUNREACHABLE;
  }
 diff --git a/gfx/skia/skia/src/gpu/vk/GrVkCaps.cpp b/gfx/skia/skia/src/gpu/vk/GrVkCaps.cpp
-index 36e2436a85..a914f5a4d5 100644
 --- a/gfx/skia/skia/src/gpu/vk/GrVkCaps.cpp
 +++ b/gfx/skia/skia/src/gpu/vk/GrVkCaps.cpp
-@@ -108,6 +108,7 @@ static FormatCompatibilityClass format_compatibility_class(VkFormat format) {
+@@ -103,16 +103,17 @@ static FormatCompatibilityClass format_c
+         case VK_FORMAT_R8G8B8_UNORM:
+             return FormatCompatibilityClass::k24_3_1;
+ 
+         case VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:
+             return FormatCompatibilityClass::kETC2_RGB_8_16;
  
          default:
              SK_ABORT("Unsupported VkFormat");
@@ -941,7 +1597,17 @@
      }
  }
  
-@@ -1656,6 +1657,7 @@ GrBackendFormat GrVkCaps::getBackendFormatFromCompressionType(
+ bool GrVkCaps::canCopyImage(VkFormat dstFormat, int dstSampleCnt, bool dstHasYcbcr,
+                             VkFormat srcFormat, int srcSampleCnt, bool srcHasYcbcr) const {
+     if ((dstSampleCnt > 1 || srcSampleCnt > 1) && dstSampleCnt != srcSampleCnt) {
+         return false;
+     }
+@@ -1651,16 +1652,17 @@ GrBackendFormat GrVkCaps::onGetDefaultBa
+ 
+ GrBackendFormat GrVkCaps::getBackendFormatFromCompressionType(
+         SkImage::CompressionType compressionType) const {
+     switch (compressionType) {
+         case SkImage::kETC1_CompressionType:
              return GrBackendFormat::MakeVk(VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK);
      }
      SK_ABORT("Invalid compression type");
@@ -949,11 +1615,20 @@
  }
  
  GrSwizzle GrVkCaps::getTextureSwizzle(const GrBackendFormat& format, GrColorType colorType) const {
+     VkFormat vkFormat;
+     SkAssertResult(format.asVkFormat(&vkFormat));
+     const auto& info = this->getFormatInfo(vkFormat);
+     for (int i = 0; i < info.fColorTypeInfoCount; ++i) {
+         const auto& ctInfo = info.fColorTypeInfos[i];
 diff --git a/gfx/skia/skia/src/gpu/vk/GrVkMemory.cpp b/gfx/skia/skia/src/gpu/vk/GrVkMemory.cpp
-index ed14a643ec..3675c953d4 100644
 --- a/gfx/skia/skia/src/gpu/vk/GrVkMemory.cpp
 +++ b/gfx/skia/skia/src/gpu/vk/GrVkMemory.cpp
-@@ -28,6 +28,7 @@ static BufferUsage get_buffer_usage(GrVkBuffer::Type type, bool dynamic) {
+@@ -23,16 +23,17 @@ static BufferUsage get_buffer_usage(GrVk
+         case GrVkBuffer::kUniform_Type:
+             SkASSERT(dynamic);
+             return BufferUsage::kCpuWritesGpuReads;
+         case GrVkBuffer::kCopyRead_Type: // fall through
+         case GrVkBuffer::kCopyWrite_Type:
              return BufferUsage::kCpuOnly;
      }
      SK_ABORT("Invalid GrVkBuffer::Type");
@@ -961,11 +1636,20 @@
  }
  
  bool GrVkMemory::AllocAndBindBufferMemory(const GrVkGpu* gpu,
+                                           VkBuffer buffer,
+                                           GrVkBuffer::Type type,
+                                           bool dynamic,
+                                           GrVkAlloc* alloc) {
+     GrVkMemoryAllocator* allocator = gpu->memoryAllocator();
 diff --git a/gfx/skia/skia/src/gpu/vk/GrVkPipeline.cpp b/gfx/skia/skia/src/gpu/vk/GrVkPipeline.cpp
-index 6868ff5bab..2c7a20a7db 100644
 --- a/gfx/skia/skia/src/gpu/vk/GrVkPipeline.cpp
 +++ b/gfx/skia/skia/src/gpu/vk/GrVkPipeline.cpp
-@@ -80,6 +80,7 @@ static inline VkFormat attrib_type_to_vkformat(GrVertexAttribType type) {
+@@ -75,16 +75,17 @@ static inline VkFormat attrib_type_to_vk
+         case kUint_GrVertexAttribType:
+             return VK_FORMAT_R32_UINT;
+         case kUShort_norm_GrVertexAttribType:
+             return VK_FORMAT_R16_UNORM;
+         case kUShort4_norm_GrVertexAttribType:
              return VK_FORMAT_R16G16B16A16_UNORM;
      }
      SK_ABORT("Unknown vertex attrib type");
@@ -973,7 +1657,17 @@
  }
  
  static void setup_vertex_input_state(const GrPrimitiveProcessor& primProc,
-@@ -162,8 +163,10 @@ static VkPrimitiveTopology gr_primitive_type_to_vk_topology(GrPrimitiveType prim
+                                   VkPipelineVertexInputStateCreateInfo* vertexInputInfo,
+                                   SkSTArray<2, VkVertexInputBindingDescription, true>* bindingDescs,
+                                   VkVertexInputAttributeDescription* attributeDesc) {
+     uint32_t vertexBinding = 0, instanceBinding = 0;
+ 
+@@ -157,18 +158,20 @@ static VkPrimitiveTopology gr_primitive_
+         case GrPrimitiveType::kPoints:
+             return VK_PRIMITIVE_TOPOLOGY_POINT_LIST;
+         case GrPrimitiveType::kLines:
+             return VK_PRIMITIVE_TOPOLOGY_LINE_LIST;
+         case GrPrimitiveType::kLineStrip:
              return VK_PRIMITIVE_TOPOLOGY_LINE_STRIP;
          case GrPrimitiveType::kPath:
              SK_ABORT("Unsupported primitive type");
@@ -984,11 +1678,20 @@
  }
  
  static void setup_input_assembly_state(GrPrimitiveType primitiveType,
+                                        VkPipelineInputAssemblyStateCreateInfo* inputAssemblyInfo) {
+     memset(inputAssemblyInfo, 0, sizeof(VkPipelineInputAssemblyStateCreateInfo));
+     inputAssemblyInfo->sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO;
+     inputAssemblyInfo->pNext = nullptr;
+     inputAssemblyInfo->flags = 0;
 diff --git a/gfx/skia/skia/src/gpu/vk/GrVkSampler.cpp b/gfx/skia/skia/src/gpu/vk/GrVkSampler.cpp
-index 5dc3544f00..306bd96816 100644
 --- a/gfx/skia/skia/src/gpu/vk/GrVkSampler.cpp
 +++ b/gfx/skia/skia/src/gpu/vk/GrVkSampler.cpp
-@@ -23,6 +23,7 @@ static inline VkSamplerAddressMode wrap_mode_to_vk_sampler_address(
+@@ -18,16 +18,17 @@ static inline VkSamplerAddressMode wrap_
+         case GrSamplerState::WrapMode::kRepeat:
+             return VK_SAMPLER_ADDRESS_MODE_REPEAT;
+         case GrSamplerState::WrapMode::kMirrorRepeat:
+             return VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT;
+         case GrSamplerState::WrapMode::kClampToBorder:
              return VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER;
      }
      SK_ABORT("Unknown wrap mode.");
@@ -996,11 +1699,20 @@
  }
  
  GrVkSampler* GrVkSampler::Create(GrVkGpu* gpu, const GrSamplerState& samplerState,
+                                  const GrVkYcbcrConversionInfo& ycbcrInfo) {
+     static VkFilter vkMinFilterModes[] = {
+         VK_FILTER_NEAREST,
+         VK_FILTER_LINEAR,
+         VK_FILTER_LINEAR
 diff --git a/gfx/skia/skia/src/gpu/vk/GrVkTransferBuffer.h b/gfx/skia/skia/src/gpu/vk/GrVkTransferBuffer.h
-index 210cf228d9..6a6fd90d96 100644
 --- a/gfx/skia/skia/src/gpu/vk/GrVkTransferBuffer.h
 +++ b/gfx/skia/skia/src/gpu/vk/GrVkTransferBuffer.h
-@@ -34,6 +34,7 @@ private:
+@@ -29,16 +29,17 @@ private:
+                           const SkString& dumpName) const override;
+ 
+     void onMap() override { this->GrGpuBuffer::fMapPtr = this->vkMap(this->getVkGpu()); }
+ 
+     void onUnmap() override { this->vkUnmap(this->getVkGpu()); }
  
      bool onUpdateData(const void* src, size_t srcSizeInBytes) override {
          SK_ABORT("Not implemented for transfer buffers.");
@@ -1008,11 +1720,20 @@
      }
  
      GrVkGpu* getVkGpu() const {
+         SkASSERT(!this->wasDestroyed());
+         return reinterpret_cast<GrVkGpu*>(this->getGpu());
+     }
+ 
+     typedef GrGpuBuffer INHERITED;
 diff --git a/gfx/skia/skia/src/gpu/vk/GrVkUniformHandler.cpp b/gfx/skia/skia/src/gpu/vk/GrVkUniformHandler.cpp
-index 6df62ce6a9..4ac6873563 100644
 --- a/gfx/skia/skia/src/gpu/vk/GrVkUniformHandler.cpp
 +++ b/gfx/skia/skia/src/gpu/vk/GrVkUniformHandler.cpp
-@@ -89,6 +89,7 @@ static uint32_t grsltype_to_alignment_mask(GrSLType type) {
+@@ -84,16 +84,17 @@ static uint32_t grsltype_to_alignment_ma
+         case kTexture2DSampler_GrSLType:
+         case kTextureExternalSampler_GrSLType:
+         case kTexture2DRectSampler_GrSLType:
+         case kSampler_GrSLType:
+         case kTexture2D_GrSLType:
              break;
      }
      SK_ABORT("Unexpected type");
@@ -1020,7 +1741,17 @@
  }
  
  /** Returns the size in bytes taken up in vulkanbuffers for GrSLTypes. */
-@@ -172,6 +173,7 @@ static inline uint32_t grsltype_to_vk_size(GrSLType type) {
+ static inline uint32_t grsltype_to_vk_size(GrSLType type) {
+     switch(type) {
+         case kByte_GrSLType:
+             return sizeof(int8_t);
+         case kByte2_GrSLType:
+@@ -167,16 +168,17 @@ static inline uint32_t grsltype_to_vk_si
+         case kTexture2DSampler_GrSLType:
+         case kTextureExternalSampler_GrSLType:
+         case kTexture2DRectSampler_GrSLType:
+         case kSampler_GrSLType:
+         case kTexture2D_GrSLType:
              break;
      }
      SK_ABORT("Unexpected type");
@@ -1028,11 +1759,20 @@
  }
  
  
+ // Given the current offset into the ubo, calculate the offset for the uniform we're trying to add
+ // taking into consideration all alignment requirements. The uniformOffset is set to the offset for
+ // the new uniform, and currentOffset is updated to be the offset to the end of the new uniform.
+ static void get_ubo_aligned_offset(uint32_t* uniformOffset,
+                                    uint32_t* currentOffset,
 diff --git a/gfx/skia/skia/src/gpu/vk/GrVkVaryingHandler.cpp b/gfx/skia/skia/src/gpu/vk/GrVkVaryingHandler.cpp
-index 5fe2f45373..4b6d61813d 100644
 --- a/gfx/skia/skia/src/gpu/vk/GrVkVaryingHandler.cpp
 +++ b/gfx/skia/skia/src/gpu/vk/GrVkVaryingHandler.cpp
-@@ -74,6 +74,7 @@ static inline int grsltype_to_location_size(GrSLType type) {
+@@ -69,16 +69,17 @@ static inline int grsltype_to_location_s
+         case kByte_GrSLType:
+              return 1;
+         case kUint_GrSLType: // fall through
+         case kUShort_GrSLType:
+         case kUByte_GrSLType:
               return 1;
      }
      SK_ABORT("Unexpected type");
@@ -1040,11 +1780,20 @@
  }
  
  static void finalize_helper(GrVkVaryingHandler::VarArray& vars) {
+     int locationIndex = 0;
+     for (int i = 0; i < vars.count(); ++i) {
+         GrShaderVar& var = vars[i];
+         SkString location;
+         location.appendf("location = %d", locationIndex);
 diff --git a/gfx/skia/skia/src/pdf/SkPDFTag.cpp b/gfx/skia/skia/src/pdf/SkPDFTag.cpp
-index a2248070e8..15122d5047 100644
 --- a/gfx/skia/skia/src/pdf/SkPDFTag.cpp
 +++ b/gfx/skia/skia/src/pdf/SkPDFTag.cpp
-@@ -64,6 +64,7 @@ static const char* tag_name_from_type(SkPDF::DocumentStructureType type) {
+@@ -59,16 +59,17 @@ static const char* tag_name_from_type(Sk
+         M(WT);
+         M(WP);
+         M(Figure);
+         M(Formula);
+         M(Form);
          #undef M
      }
      SK_ABORT("bad tag");
@@ -1052,11 +1801,20 @@
  }
  
  struct SkPDFTagNode {
+     SkPDFTagNode* fChildren = nullptr;
+     size_t fChildCount = 0;
+     struct MarkedContentInfo {
+         unsigned fPageIndex;
+         int fMarkId;
 diff --git a/gfx/skia/skia/src/ports/SkFontMgr_FontConfigInterface.cpp b/gfx/skia/skia/src/ports/SkFontMgr_FontConfigInterface.cpp
-index 23986cbaaa..e78c47b11a 100644
 --- a/gfx/skia/skia/src/ports/SkFontMgr_FontConfigInterface.cpp
 +++ b/gfx/skia/skia/src/ports/SkFontMgr_FontConfigInterface.cpp
-@@ -173,18 +173,22 @@ public:
+@@ -168,28 +168,32 @@ public:
+     SkFontMgr_FCI(sk_sp<SkFontConfigInterface> fci)
+         : fFCI(std::move(fci))
+         , fCache(kMaxSize)
+     {}
+ 
  protected:
      int onCountFamilies() const override {
          SK_ABORT("Not implemented.");
@@ -1079,7 +1837,17 @@
      }
  
      SkTypeface* onMatchFamilyStyle(const char requestedFamilyName[],
-@@ -215,10 +219,12 @@ protected:
+                                    const SkFontStyle& requestedStyle) const override
+     {
+         SkAutoMutexExclusive ama(fMutex);
+ 
+         SkFontConfigInterface::FontIdentity identity;
+@@ -210,20 +214,22 @@ protected:
+         }
+         return face.release();
+     }
+ 
+     SkTypeface* onMatchFamilyStyleCharacter(const char familyName[], const SkFontStyle&,
                                              const char* bcp47[], int bcp47Count,
                                              SkUnichar character) const override {
          SK_ABORT("Not implemented.");
@@ -1092,11 +1860,20 @@
      }
  
      sk_sp<SkTypeface> onMakeFromData(sk_sp<SkData> data, int ttcIndex) const override {
+         return this->onMakeFromStreamIndex(SkMemoryStream::Make(std::move(data)), ttcIndex);
+     }
+ 
+     sk_sp<SkTypeface> onMakeFromStreamIndex(std::unique_ptr<SkStreamAsset> stream,
+                                             int ttcIndex) const override {
 diff --git a/gfx/skia/skia/src/shaders/SkImageShader.cpp b/gfx/skia/skia/src/shaders/SkImageShader.cpp
-index 5bc13e587c..968e3cffae 100644
 --- a/gfx/skia/skia/src/shaders/SkImageShader.cpp
 +++ b/gfx/skia/skia/src/shaders/SkImageShader.cpp
-@@ -183,6 +183,7 @@ static GrSamplerState::WrapMode tile_mode_to_wrap_mode(const SkTileMode tileMode
+@@ -178,16 +178,17 @@ static GrSamplerState::WrapMode tile_mod
+         case SkTileMode::kRepeat:
+             return GrSamplerState::WrapMode::kRepeat;
+         case SkTileMode::kMirror:
+             return GrSamplerState::WrapMode::kMirrorRepeat;
+         case SkTileMode::kDecal:
              return GrSamplerState::WrapMode::kClampToBorder;
      }
      SK_ABORT("Unknown tile mode.");
@@ -1104,11 +1881,20 @@
  }
  
  std::unique_ptr<GrFragmentProcessor> SkImageShader::asFragmentProcessor(
+         const GrFPArgs& args) const {
+     const auto lm = this->totalLocalMatrix(args.fPreLocalMatrix, args.fPostLocalMatrix);
+     SkMatrix lmInverse;
+     if (!lm->invert(&lmInverse)) {
+         return nullptr;
 diff --git a/gfx/skia/skia/src/utils/SkShadowUtils.cpp b/gfx/skia/skia/src/utils/SkShadowUtils.cpp
-index 1b47af5523..f0ae0411d0 100644
 --- a/gfx/skia/skia/src/utils/SkShadowUtils.cpp
 +++ b/gfx/skia/skia/src/utils/SkShadowUtils.cpp
-@@ -149,6 +149,7 @@ struct SpotVerticesFactory {
+@@ -144,16 +144,17 @@ struct SpotVerticesFactory {
+                 // if the offsets don't match.
+                 if (fOffset == that.fOffset) {
+                     translate->set(0, 0);
+                     return true;
+                 }
                  return false;
          }
          SK_ABORT("Uninitialized occluder type?");
@@ -1116,11 +1902,20 @@
      }
  
      sk_sp<SkVertices> makeVertices(const SkPath& path, const SkMatrix& ctm,
+                                    SkVector* translate) const {
+         bool transparent = OccluderType::kTransparent == fOccluderType;
+         SkPoint3 zParams = SkPoint3::Make(0, 0, fOccluderHeight);
+         if (ctm.hasPerspective() || OccluderType::kOpaquePartialUmbra == fOccluderType) {
+             translate->set(0, 0);
 diff --git a/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/ast_to_hir.cpp b/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/ast_to_hir.cpp
-index c00298a160..74b9d1aef3 100644
 --- a/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/ast_to_hir.cpp
 +++ b/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/ast_to_hir.cpp
-@@ -2651,6 +2651,7 @@ get_type_name_for_precision_qualifier(const glsl_type *type)
+@@ -2646,16 +2646,17 @@ get_type_name_for_precision_qualifier(co
+          unreachable("Unsupported sampler/image type");
+       } /* sampler/image type */
+       break;
+    } /* GLSL_TYPE_SAMPLER/GLSL_TYPE_IMAGE */
+    break;
     default:
        unreachable("Unsupported type");
     } /* base type */
@@ -1128,11 +1923,20 @@
  }
  
  static unsigned
+ select_gles_precision(unsigned qual_precision,
+                       const glsl_type *type,
+                       struct _mesa_glsl_parse_state *state, YYLTYPE *loc)
+ {
+    /* Precision qualifiers do not have any meaning in Desktop GLSL.
 diff --git a/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/ir.cpp b/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/ir.cpp
-index 9ea8e00d31..2dee2ccdcd 100644
 --- a/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/ir.cpp
 +++ b/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/ir.cpp
-@@ -624,6 +624,7 @@ ir_expression::get_num_operands(ir_expression_operation op)
+@@ -619,16 +619,17 @@ ir_expression::get_num_operands(ir_expre
+ 
+    if (op <= ir_last_triop)
+       return 3;
+ 
+    if (op <= ir_last_quadop)
        return 4;
  
     unreachable("Could not calculate number of operands");
@@ -1140,11 +1944,20 @@
  }
  
  #include "ir_expression_operation_strings.h"
+ 
+ const char*
+ depth_layout_string(ir_depth_layout layout)
+ {
+    switch(layout) {
 diff --git a/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/loop_analysis.cpp b/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/loop_analysis.cpp
-index 9429e69c2a..8d9da42434 100644
 --- a/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/loop_analysis.cpp
 +++ b/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/loop_analysis.cpp
-@@ -239,6 +239,7 @@ incremented_before_terminator(ir_loop *loop, ir_variable *var,
+@@ -234,16 +234,17 @@ incremented_before_terminator(ir_loop *l
+       }
+ 
+       default:
+          break;
+       }
     }
  
     unreachable("Unable to find induction variable");
@@ -1152,11 +1965,20 @@
  }
  
  /**
+  * Record the fact that the given loop variable was referenced inside the loop.
+  *
+  * \arg in_assignee is true if the reference was on the LHS of an assignment.
+  *
+  * \arg in_conditional_code_or_nested_loop is true if the reference occurred
 diff --git a/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/opt_vectorize.cpp b/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/opt_vectorize.cpp
-index 88318cd8a6..63a535c802 100644
 --- a/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/opt_vectorize.cpp
 +++ b/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/opt_vectorize.cpp
-@@ -229,6 +229,7 @@ write_mask_to_swizzle(unsigned write_mask)
+@@ -224,16 +224,17 @@ write_mask_to_swizzle(unsigned write_mas
+ {
+    switch (write_mask) {
+    case WRITEMASK_X: return SWIZZLE_X;
+    case WRITEMASK_Y: return SWIZZLE_Y;
+    case WRITEMASK_Z: return SWIZZLE_Z;
     case WRITEMASK_W: return SWIZZLE_W;
     }
     unreachable("not reached");
@@ -1164,11 +1986,20 @@
  }
  
  /**
+  * Returns whether a single-channeled write mask matches a swizzle.
+  */
+ static bool
+ write_mask_matches_swizzle(unsigned write_mask,
+                            const ir_swizzle *swz)
 diff --git a/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl_types.cpp b/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl_types.cpp
-index 445659599c..615ab6215a 100644
 --- a/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl_types.cpp
 +++ b/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl_types.cpp
-@@ -460,6 +460,7 @@ const glsl_type *glsl_type::get_bare_type() const
+@@ -455,16 +455,17 @@ const glsl_type *glsl_type::get_bare_typ
+    case GLSL_TYPE_VOID:
+    case GLSL_TYPE_SUBROUTINE:
+    case GLSL_TYPE_FUNCTION:
+    case GLSL_TYPE_ERROR:
+       return this;
     }
  
     unreachable("Invalid base type");
@@ -1176,7 +2007,17 @@
  }
  
  const glsl_type *glsl_type::get_float16_type() const
-@@ -2016,6 +2017,7 @@ glsl_type::get_explicit_std140_type(bool row_major) const
+ {
+    assert(this->base_type == GLSL_TYPE_FLOAT);
+ 
+    return get_instance(GLSL_TYPE_FLOAT16,
+                        this->vector_elements,
+@@ -2011,16 +2012,17 @@ glsl_type::get_explicit_std140_type(bool
+                                        (enum glsl_interface_packing)this->interface_packing,
+                                        this->interface_row_major,
+                                        this->name);
+ 
+       delete[] fields;
        return type;
     } else {
        unreachable("Invalid type for UBO or SSBO");
@@ -1184,7 +2025,17 @@
     }
  }
  
-@@ -2374,6 +2376,7 @@ glsl_type::get_explicit_std430_type(bool row_major) const
+ unsigned
+ glsl_type::std430_base_alignment(bool row_major) const
+ {
+ 
+    unsigned N = is_64bit() ? 8 : 4;
+@@ -2369,16 +2371,17 @@ glsl_type::get_explicit_std430_type(bool
+                                        (enum glsl_interface_packing)this->interface_packing,
+                                        this->interface_row_major,
+                                        this->name);
+ 
+       delete[] fields;
        return type;
     } else {
        unreachable("Invalid type for SSBO");
@@ -1192,7 +2043,17 @@
     }
  }
  
-@@ -2448,6 +2451,7 @@ glsl_type::get_explicit_type_for_size_align(glsl_type_size_align_func type_info,
+ const glsl_type *
+ glsl_type::get_explicit_interface_type(bool supports_std430) const
+ {
+    enum glsl_interface_packing packing =
+       this->get_internal_ifc_packing(supports_std430);
+@@ -2443,16 +2446,17 @@ glsl_type::get_explicit_type_for_size_al
+       unsigned stride = align(col_size, col_align);
+ 
+       *size = this->matrix_columns * stride;
+       *alignment = col_align;
+       return glsl_type::get_instance(this->base_type, this->vector_elements,
                                       this->matrix_columns, stride, false);
     } else {
        unreachable("Unhandled type.");
@@ -1200,7 +2061,17 @@
     }
  }
  
-@@ -2948,6 +2952,7 @@ glsl_get_sampler_dim_coordinate_components(enum glsl_sampler_dim dim)
+ unsigned
+ glsl_type::count_vec4_slots(bool is_gl_vertex_input, bool is_bindless) const
+ {
+    /* From page 31 (page 37 of the PDF) of the GLSL 1.50 spec:
+     *
+@@ -2943,12 +2947,13 @@ glsl_get_sampler_dim_coordinate_componen
+    case GLSL_SAMPLER_DIM_SUBPASS:
+    case GLSL_SAMPLER_DIM_SUBPASS_MS:
+       return 2;
+    case GLSL_SAMPLER_DIM_3D:
+    case GLSL_SAMPLER_DIM_CUBE:
        return 3;
     default:
        unreachable("Unknown sampler dim");
@@ -1208,11 +2079,16 @@
     }
  }
  
+ }
 diff --git a/third_party/rust/glslopt/glsl-optimizer/src/mesa/main/shaderobj.h b/third_party/rust/glslopt/glsl-optimizer/src/mesa/main/shaderobj.h
-index 0d512550de..ef940cabdd 100644
 --- a/third_party/rust/glslopt/glsl-optimizer/src/mesa/main/shaderobj.h
 +++ b/third_party/rust/glslopt/glsl-optimizer/src/mesa/main/shaderobj.h
-@@ -185,6 +185,7 @@ _mesa_shader_stage_from_subroutine_uniform(GLenum subuniform)
+@@ -180,16 +180,17 @@ static inline gl_shader_stage
+    case GL_COMPUTE_SUBROUTINE_UNIFORM:
+       return MESA_SHADER_COMPUTE;
+    case GL_TESS_CONTROL_SUBROUTINE_UNIFORM:
+       return MESA_SHADER_TESS_CTRL;
+    case GL_TESS_EVALUATION_SUBROUTINE_UNIFORM:
        return MESA_SHADER_TESS_EVAL;
     }
     unreachable("not reached");
@@ -1220,7 +2096,17 @@
  }
  
  static inline gl_shader_stage
-@@ -205,6 +206,7 @@ _mesa_shader_stage_from_subroutine(GLenum subroutine)
+ _mesa_shader_stage_from_subroutine(GLenum subroutine)
+ {
+    switch (subroutine) {
+    case GL_VERTEX_SUBROUTINE:
+       return MESA_SHADER_VERTEX;
+@@ -200,16 +201,17 @@ static inline gl_shader_stage
+    case GL_COMPUTE_SUBROUTINE:
+       return MESA_SHADER_COMPUTE;
+    case GL_TESS_CONTROL_SUBROUTINE:
+       return MESA_SHADER_TESS_CTRL;
+    case GL_TESS_EVALUATION_SUBROUTINE:
        return MESA_SHADER_TESS_EVAL;
     }
     unreachable("not reached");
@@ -1228,7 +2114,17 @@
  }
  
  static inline GLenum
-@@ -230,6 +232,7 @@ _mesa_shader_stage_to_subroutine(gl_shader_stage stage)
+ _mesa_shader_stage_to_subroutine(gl_shader_stage stage)
+ {
+    switch (stage) {
+    case MESA_SHADER_VERTEX:
+       return GL_VERTEX_SUBROUTINE;
+@@ -225,16 +227,17 @@ static inline GLenum
+       return GL_TESS_EVALUATION_SUBROUTINE;
+    case MESA_SHADER_NONE:
+       break;
+    case MESA_SHADER_KERNEL:
+       unreachable("not reached");
        break;
     }
     unreachable("not reached");
@@ -1236,7 +2132,17 @@
  }
  
  static inline GLenum
-@@ -253,6 +256,7 @@ _mesa_shader_stage_to_subroutine_uniform(gl_shader_stage stage)
+ _mesa_shader_stage_to_subroutine_uniform(gl_shader_stage stage)
+ {
+    switch (stage) {
+    case MESA_SHADER_VERTEX:
+       return GL_VERTEX_SUBROUTINE_UNIFORM;
+@@ -248,16 +251,17 @@ static inline GLenum
+       return GL_TESS_CONTROL_SUBROUTINE_UNIFORM;
+    case MESA_SHADER_TESS_EVAL:
+       return GL_TESS_EVALUATION_SUBROUTINE_UNIFORM;
+    case MESA_SHADER_NONE:
+    case MESA_SHADER_KERNEL:
        break;
     }
     unreachable("not reached");
@@ -1244,3 +2150,8 @@
  }
  
  extern bool
+ _mesa_validate_pipeline_io(struct gl_pipeline_object *);
+ 
+ #ifdef __cplusplus
+ }
+ #endif
--- a/series	Fri Oct 01 12:00:20 2021 +0200
+++ b/series	Sun Oct 17 20:19:48 2021 +0200
@@ -22,9 +22,9 @@
 mozilla-bmo1626236.patch
 mozilla-s390x-skia-gradient.patch
 mozilla-libavcodec58_91.patch
-mozilla-bmo1708709.patch
 mozilla-silence-no-return-type.patch
 mozilla-bmo1725828.patch
+mozilla-bmo531915.patch
 
 # Firefox patches
 firefox-kde.patch