[Libreoffice-commits] core.git: bin/update_pch download.lst external/skia vcl/inc vcl/skia

Luboš Luňák (via logerrit) logerrit at kemper.freedesktop.org
Wed Mar 3 10:08:23 UTC 2021


 bin/update_pch                                |    1 
 download.lst                                  |    4 
 external/skia/Library_skia.mk                 |   58 +++++++++----
 external/skia/UnpackedTarball_skia.mk         |    2 
 external/skia/constexpr-debug-std-max.patch.1 |   47 +----------
 external/skia/fix-pch.patch.1                 |   20 ++--
 external/skia/fix-warnings.patch.1            |   28 ++++++
 external/skia/fontconfig-get-typeface.patch.0 |   50 ++++++------
 external/skia/inc/pch/precompiled_skia.hxx    |   88 ++++++++++-----------
 external/skia/lerp.patch                      |   12 --
 vcl/inc/skia/salbmp.hxx                       |    8 +
 vcl/inc/skia/utils.hxx                        |   25 ++++++
 vcl/skia/SkiaHelper.cxx                       |    6 -
 vcl/skia/gdiimpl.cxx                          |  108 ++++++++++++++------------
 vcl/skia/salbmp.cxx                           |   87 +++++++++-----------
 vcl/skia/win/gdiimpl.cxx                      |    2 
 vcl/skia/zone.cxx                             |    2 
 17 files changed, 295 insertions(+), 253 deletions(-)

New commits:
commit ad8bff9d2625524999871ace65cfe0382f991f24
Author:     Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Mon Jan 18 19:38:03 2021 +0100
Commit:     Luboš Luňák <l.lunak at collabora.com>
CommitDate: Wed Mar 3 11:07:37 2021 +0100

    update Skia to chrome/m90
    
    Including chrome/m89, which wasn't included before because of
    tdf#140023.
    
    Change-Id: I64f1de8e10eab2d92a9383ce8104be5afca40101
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111792
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lunak at collabora.com>

diff --git a/bin/update_pch b/bin/update_pch
index dca39eac8bea..d72509007e28 100755
--- a/bin/update_pch
+++ b/bin/update_pch
@@ -474,6 +474,7 @@ def filter_ignore(line, module):
             'src/sksl/SkSLCPP.h',
             'src/gpu/vk/GrVkAMDMemoryAllocator.h',
             'src/gpu/GrUtil.h',
+            'src/sksl/dsl/',
             ]
 
     for i in ignore_list:
diff --git a/download.lst b/download.lst
index cdc3bb3a2e99..46013d7f6d2d 100644
--- a/download.lst
+++ b/download.lst
@@ -241,8 +241,8 @@ export RHINO_SHA256SUM := 1fb458d6aab06932693cc8a9b6e4e70944ee1ff052fa63606e3131
 export RHINO_TARBALL := 798b2ffdc8bcfe7bca2cf92b62caf685-rhino1_5R5.zip
 export SERF_SHA256SUM := 6988d394b62c3494635b6f0760bc3079f9a0cd380baf0f6b075af1eb9fa5e700
 export SERF_TARBALL := serf-1.2.1.tar.bz2
-export SKIA_SHA256SUM := f293656a15342a53bb407b932fc907c6894178a162f09728bd383e24d84b1301
-export SKIA_TARBALL := skia-m88-59bafeeaa7de9eb753e3778c414e01dcf013dcd8.tar.xz
+export SKIA_SHA256SUM := abe0b94d54edb717c58d74263f4ed3d27824d2ce9e9f2ce85a21ab38d993f94d
+export SKIA_TARBALL := skia-m90-45c57e116ee0ce214bdf78405a4762722e4507d9.tar.xz
 export STAROFFICE_SHA256SUM := f94fb0ad8216f97127bedef163a45886b43c62deac5e5b0f5e628e234220c8db
 export STAROFFICE_VERSION_MICRO := 7
 export STAROFFICE_TARBALL := libstaroffice-0.0.$(STAROFFICE_VERSION_MICRO).tar.xz
diff --git a/external/skia/Library_skia.mk b/external/skia/Library_skia.mk
index 87ae0c64552f..ab12388cadfe 100644
--- a/external/skia/Library_skia.mk
+++ b/external/skia/Library_skia.mk
@@ -137,7 +137,6 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
     UnpackedTarball/skia/src/core/SkBBHFactory \
     UnpackedTarball/skia/src/core/SkBigPicture \
     UnpackedTarball/skia/src/core/SkBitmapCache \
-    UnpackedTarball/skia/src/core/SkBitmapController \
     UnpackedTarball/skia/src/core/SkBitmap \
     UnpackedTarball/skia/src/core/SkBitmapDevice \
     UnpackedTarball/skia/src/core/SkBitmapProcState \
@@ -230,8 +229,10 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
     UnpackedTarball/skia/src/core/SkMD5 \
     UnpackedTarball/skia/src/core/SkMiniRecorder \
     UnpackedTarball/skia/src/core/SkMipmap \
+    UnpackedTarball/skia/src/core/SkMipmapAccessor \
     UnpackedTarball/skia/src/core/SkModeColorFilter \
     UnpackedTarball/skia/src/core/SkOpts \
+    UnpackedTarball/skia/src/core/SkOpts_erms \
     UnpackedTarball/skia/src/core/SkOverdrawCanvas \
     UnpackedTarball/skia/src/core/SkPaint \
     UnpackedTarball/skia/src/core/SkPaintPriv \
@@ -273,7 +274,6 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
     UnpackedTarball/skia/src/core/SkRRect \
     UnpackedTarball/skia/src/core/SkRTree \
     UnpackedTarball/skia/src/core/SkRuntimeEffect \
-    UnpackedTarball/skia/src/core/SkRWBuffer \
     UnpackedTarball/skia/src/core/SkScalar \
     UnpackedTarball/skia/src/core/SkScalerCache \
     UnpackedTarball/skia/src/core/SkScalerContext \
@@ -323,32 +323,31 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
     UnpackedTarball/skia/src/core/SkXfermodeInterpretation \
     UnpackedTarball/skia/src/core/SkYUVAInfo \
     UnpackedTarball/skia/src/core/SkYUVAPixmaps \
-    UnpackedTarball/skia/src/core/SkYUVASizeInfo \
     UnpackedTarball/skia/src/core/SkYUVMath \
     UnpackedTarball/skia/src/core/SkYUVPlanesCache \
     UnpackedTarball/skia/src/c/sk_effects \
     UnpackedTarball/skia/src/c/sk_imageinfo \
     UnpackedTarball/skia/src/c/sk_paint \
     UnpackedTarball/skia/src/c/sk_surface \
-    UnpackedTarball/skia/src/effects/imagefilters/SkAlphaThresholdFilter \
+    UnpackedTarball/skia/src/effects/imagefilters/SkAlphaThresholdImageFilter \
     UnpackedTarball/skia/src/effects/imagefilters/SkArithmeticImageFilter \
+    UnpackedTarball/skia/src/effects/imagefilters/SkBlendImageFilter \
     UnpackedTarball/skia/src/effects/imagefilters/SkBlurImageFilter \
     UnpackedTarball/skia/src/effects/imagefilters/SkColorFilterImageFilter \
     UnpackedTarball/skia/src/effects/imagefilters/SkComposeImageFilter \
-    UnpackedTarball/skia/src/effects/imagefilters/SkDisplacementMapEffect \
+    UnpackedTarball/skia/src/effects/imagefilters/SkDisplacementMapImageFilter \
     UnpackedTarball/skia/src/effects/imagefilters/SkDropShadowImageFilter \
     UnpackedTarball/skia/src/effects/imagefilters/SkImageFilters \
-    UnpackedTarball/skia/src/effects/imagefilters/SkImageSource \
+    UnpackedTarball/skia/src/effects/imagefilters/SkImageImageFilter \
     UnpackedTarball/skia/src/effects/imagefilters/SkLightingImageFilter \
     UnpackedTarball/skia/src/effects/imagefilters/SkMagnifierImageFilter \
     UnpackedTarball/skia/src/effects/imagefilters/SkMatrixConvolutionImageFilter \
     UnpackedTarball/skia/src/effects/imagefilters/SkMergeImageFilter \
     UnpackedTarball/skia/src/effects/imagefilters/SkMorphologyImageFilter \
     UnpackedTarball/skia/src/effects/imagefilters/SkOffsetImageFilter \
-    UnpackedTarball/skia/src/effects/imagefilters/SkPaintImageFilter \
     UnpackedTarball/skia/src/effects/imagefilters/SkPictureImageFilter \
+    UnpackedTarball/skia/src/effects/imagefilters/SkShaderImageFilter \
     UnpackedTarball/skia/src/effects/imagefilters/SkTileImageFilter \
-    UnpackedTarball/skia/src/effects/imagefilters/SkXfermodeImageFilter \
     UnpackedTarball/skia/src/effects/SkColorMatrix \
     UnpackedTarball/skia/src/effects/SkColorMatrixFilter \
     UnpackedTarball/skia/src/effects/SkCornerPathEffect \
@@ -429,27 +428,43 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
     UnpackedTarball/skia/src/shaders/SkPerlinNoiseShader \
     UnpackedTarball/skia/src/shaders/SkPictureShader \
     UnpackedTarball/skia/src/shaders/SkShader \
+    UnpackedTarball/skia/src/sksl/dsl/DSLBlock \
+    UnpackedTarball/skia/src/sksl/dsl/DSLCore \
+    UnpackedTarball/skia/src/sksl/dsl/DSLExpression \
+    UnpackedTarball/skia/src/sksl/dsl/DSLFunction \
+    UnpackedTarball/skia/src/sksl/dsl/DSLStatement \
+    UnpackedTarball/skia/src/sksl/dsl/DSLType \
+    UnpackedTarball/skia/src/sksl/dsl/DSLVar \
+    UnpackedTarball/skia/src/sksl/dsl/priv/DSLFPs \
+    UnpackedTarball/skia/src/sksl/dsl/priv/DSLWriter \
     UnpackedTarball/skia/src/sksl/ir/SkSLConstructor \
     UnpackedTarball/skia/src/sksl/ir/SkSLPrefixExpression \
     UnpackedTarball/skia/src/sksl/ir/SkSLSetting \
+    UnpackedTarball/skia/src/sksl/ir/SkSLSwitchStatement \
+    UnpackedTarball/skia/src/sksl/ir/SkSLSwizzle \
     UnpackedTarball/skia/src/sksl/ir/SkSLSymbolTable \
     UnpackedTarball/skia/src/sksl/ir/SkSLType \
+    UnpackedTarball/skia/src/sksl/ir/SkSLVariable \
     UnpackedTarball/skia/src/sksl/ir/SkSLVariableReference \
     UnpackedTarball/skia/src/sksl/SkSLASTNode \
     UnpackedTarball/skia/src/sksl/SkSLAnalysis \
-    UnpackedTarball/skia/src/sksl/SkSLByteCode \
-    UnpackedTarball/skia/src/sksl/SkSLByteCodeGenerator \
+    UnpackedTarball/skia/src/sksl/SkSLBuiltinTypes \
     UnpackedTarball/skia/src/sksl/SkSLCFGGenerator \
     UnpackedTarball/skia/src/sksl/SkSLCompiler \
+    UnpackedTarball/skia/src/sksl/SkSLConstantFolder \
+    UnpackedTarball/skia/src/sksl/SkSLContext \
     UnpackedTarball/skia/src/sksl/SkSLCPPCodeGenerator \
     UnpackedTarball/skia/src/sksl/SkSLCPPUniformCTypes \
+    UnpackedTarball/skia/src/sksl/SkSLDefinitionMap \
     UnpackedTarball/skia/src/sksl/SkSLDehydrator \
     UnpackedTarball/skia/src/sksl/SkSLGLSLCodeGenerator \
     UnpackedTarball/skia/src/sksl/SkSLHCodeGenerator \
     UnpackedTarball/skia/src/sksl/SkSLIRGenerator \
     UnpackedTarball/skia/src/sksl/SkSLInliner \
     UnpackedTarball/skia/src/sksl/SkSLLexer \
+    UnpackedTarball/skia/src/sksl/SkSLMangler \
     UnpackedTarball/skia/src/sksl/SkSLMetalCodeGenerator \
+    UnpackedTarball/skia/src/sksl/SkSLOperators \
     UnpackedTarball/skia/src/sksl/SkSLOutputStream \
     UnpackedTarball/skia/src/sksl/SkSLParser \
     UnpackedTarball/skia/src/sksl/SkSLPool \
@@ -461,6 +476,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
     UnpackedTarball/skia/src/sksl/SkSLSectionAndParameterHelper \
     UnpackedTarball/skia/src/sksl/SkSLString \
     UnpackedTarball/skia/src/sksl/SkSLUtil \
+    UnpackedTarball/skia/src/sksl/SkSLVMGenerator \
     UnpackedTarball/skia/src/utils/SkBase64 \
     UnpackedTarball/skia/src/utils/SkCamera \
     UnpackedTarball/skia/src/utils/SkCanvasStack \
@@ -534,10 +550,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
     UnpackedTarball/skia/src/gpu/effects/generated/GrEllipseEffect \
     UnpackedTarball/skia/src/gpu/effects/generated/GrDeviceSpaceEffect \
     UnpackedTarball/skia/src/gpu/effects/generated/GrHSLToRGBFilterEffect \
-    UnpackedTarball/skia/src/gpu/effects/generated/GrHighContrastFilterEffect \
-    UnpackedTarball/skia/src/gpu/effects/generated/GrLumaColorFilterEffect \
     UnpackedTarball/skia/src/gpu/effects/generated/GrMagnifierEffect \
-    UnpackedTarball/skia/src/gpu/effects/generated/GrMixerEffect \
     UnpackedTarball/skia/src/gpu/effects/generated/GrOverrideInputFragmentProcessor \
     UnpackedTarball/skia/src/gpu/effects/generated/GrRectBlurEffect \
     UnpackedTarball/skia/src/gpu/effects/generated/GrRGBToHSLFilterEffect \
@@ -590,6 +603,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
     UnpackedTarball/skia/src/gpu/gradients/generated/GrUnrolledBinaryGradientColorizer \
     UnpackedTarball/skia/src/gpu/gradients/GrGradientBitmapCache \
     UnpackedTarball/skia/src/gpu/gradients/GrGradientShader \
+    UnpackedTarball/skia/src/gpu/GrAATriangulator \
     UnpackedTarball/skia/src/gpu/GrAHardwareBufferImageGenerator \
     UnpackedTarball/skia/src/gpu/GrAHardwareBufferUtils \
     UnpackedTarball/skia/src/gpu/GrAttachment \
@@ -614,6 +628,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
     UnpackedTarball/skia/src/gpu/GrCopyRenderTask \
     UnpackedTarball/skia/src/gpu/GrDataUtils \
     UnpackedTarball/skia/src/gpu/GrDDLContext \
+    UnpackedTarball/skia/src/gpu/GrDDLTask \
     UnpackedTarball/skia/src/gpu/GrDefaultGeoProcFactory \
     UnpackedTarball/skia/src/gpu/GrDirectContext \
     UnpackedTarball/skia/src/gpu/GrDirectContextPriv \
@@ -657,8 +672,8 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
     UnpackedTarball/skia/src/gpu/GrRectanizerPow2 \
     UnpackedTarball/skia/src/gpu/GrRectanizerSkyline \
     UnpackedTarball/skia/src/gpu/GrRenderTask \
+    UnpackedTarball/skia/src/gpu/GrRenderTaskCluster \
     UnpackedTarball/skia/src/gpu/GrReducedClip \
-    UnpackedTarball/skia/src/gpu/GrRenderTargetContext \
     UnpackedTarball/skia/src/gpu/GrRenderTarget \
     UnpackedTarball/skia/src/gpu/GrRenderTargetProxy \
     UnpackedTarball/skia/src/gpu/GrResourceAllocator \
@@ -677,6 +692,8 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
     UnpackedTarball/skia/src/gpu/GrStencilSettings \
     UnpackedTarball/skia/src/gpu/GrStyle \
     UnpackedTarball/skia/src/gpu/GrSurfaceContext \
+    UnpackedTarball/skia/src/gpu/GrSurfaceDrawContext \
+    UnpackedTarball/skia/src/gpu/GrSurfaceFillContext \
     UnpackedTarball/skia/src/gpu/GrSurface \
     UnpackedTarball/skia/src/gpu/GrSurfaceProxy \
     UnpackedTarball/skia/src/gpu/GrSwizzle \
@@ -695,8 +712,10 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
     UnpackedTarball/skia/src/gpu/GrTransferFromRenderTask \
     UnpackedTarball/skia/src/gpu/GrUtil \
     UnpackedTarball/skia/src/gpu/GrWaitRenderTask \
+    UnpackedTarball/skia/src/gpu/GrWritePixelsRenderTask \
     UnpackedTarball/skia/src/gpu/GrXferProcessor \
     UnpackedTarball/skia/src/gpu/GrYUVABackendTextures \
+    UnpackedTarball/skia/src/gpu/GrYUVATextureProxies \
     UnpackedTarball/skia/src/gpu/mock/GrMockCaps \
     UnpackedTarball/skia/src/gpu/mock/GrMockGpu \
     UnpackedTarball/skia/src/gpu/mock/GrMockTypes \
@@ -737,11 +756,14 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
     UnpackedTarball/skia/src/gpu/SkGr \
     UnpackedTarball/skia/src/gpu/tessellate/GrDrawAtlasPathOp \
     UnpackedTarball/skia/src/gpu/tessellate/GrFillPathShader \
-    UnpackedTarball/skia/src/gpu/tessellate/GrPathTessellateOp \
+    UnpackedTarball/skia/src/gpu/tessellate/GrPathInnerTriangulateOp \
+    UnpackedTarball/skia/src/gpu/tessellate/GrPathTessellator \
     UnpackedTarball/skia/src/gpu/tessellate/GrStencilPathShader \
-    UnpackedTarball/skia/src/gpu/tessellate/GrStrokeOp \
+    UnpackedTarball/skia/src/gpu/tessellate/GrStrokeHardwareTessellator \
+    UnpackedTarball/skia/src/gpu/tessellate/GrStrokeIndirectTessellator \
     UnpackedTarball/skia/src/gpu/tessellate/GrStrokeTessellateOp \
     UnpackedTarball/skia/src/gpu/tessellate/GrStrokeTessellateShader \
+    UnpackedTarball/skia/src/gpu/tessellate/GrTessellatingStencilFillOp \
     UnpackedTarball/skia/src/gpu/tessellate/GrTessellationPathRenderer \
     UnpackedTarball/skia/src/gpu/text/GrAtlasManager \
     UnpackedTarball/skia/src/gpu/text/GrDistanceFieldAdjustTable \
@@ -769,8 +791,8 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
     UnpackedTarball/skia/src/gpu/vk/GrVkImage \
     UnpackedTarball/skia/src/gpu/vk/GrVkImageView \
     UnpackedTarball/skia/src/gpu/vk/GrVkInterface \
+    UnpackedTarball/skia/src/gpu/vk/GrVkMSAALoadManager \
     UnpackedTarball/skia/src/gpu/vk/GrVkMemory \
-    UnpackedTarball/skia/src/gpu/vk/GrVkMeshBuffer \
     UnpackedTarball/skia/src/gpu/vk/GrVkOpsRenderPass \
     UnpackedTarball/skia/src/gpu/vk/GrVkPipeline \
     UnpackedTarball/skia/src/gpu/vk/GrVkPipelineStateBuilder \
@@ -786,9 +808,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
     UnpackedTarball/skia/src/gpu/vk/GrVkSemaphore \
     UnpackedTarball/skia/src/gpu/vk/GrVkTexture \
     UnpackedTarball/skia/src/gpu/vk/GrVkTextureRenderTarget \
-    UnpackedTarball/skia/src/gpu/vk/GrVkTransferBuffer \
     UnpackedTarball/skia/src/gpu/vk/GrVkTypesPriv \
-    UnpackedTarball/skia/src/gpu/vk/GrVkUniformBuffer \
     UnpackedTarball/skia/src/gpu/vk/GrVkUniformHandler \
     UnpackedTarball/skia/src/gpu/vk/GrVkUtil \
     UnpackedTarball/skia/src/gpu/vk/GrVkVaryingHandler \
diff --git a/external/skia/UnpackedTarball_skia.mk b/external/skia/UnpackedTarball_skia.mk
index 0da268a17406..e1ea21b3cd35 100644
--- a/external/skia/UnpackedTarball_skia.mk
+++ b/external/skia/UnpackedTarball_skia.mk
@@ -14,7 +14,6 @@ $(eval $(call gb_UnpackedTarball_set_tarball,skia,$(SKIA_TARBALL)))
 # * c++20.patch.0 has been reported upstream at
 #   <https://groups.google.com/forum/#!topic/skia-discuss/pYZQq_sLnv8> "C++20 operator== issue":
 skia_patches := \
-    lerp.patch \
     fix-pch.patch.1 \
     fix-ddi.patch \
     make-api-visible.patch.1 \
@@ -39,6 +38,7 @@ skia_patches := \
     ubsan.patch.0 \
     fast-png-write.patch.1 \
     skia_sk_cpu_sse_level_0_by_default.patch.1 \
+    fix-warnings.patch.1 \
 
 $(eval $(call gb_UnpackedTarball_set_patchlevel,skia,1))
 
diff --git a/external/skia/constexpr-debug-std-max.patch.1 b/external/skia/constexpr-debug-std-max.patch.1
index 9f3784836c70..03a549c8fd4a 100644
--- a/external/skia/constexpr-debug-std-max.patch.1
+++ b/external/skia/constexpr-debug-std-max.patch.1
@@ -1,45 +1,8 @@
-diff --git a/src/shaders/SkImageShader.cpp b/src/shaders/SkImageShader.cpp
-index 52dda13e29..cafe2e672a 100755
---- a/src/shaders/SkImageShader.cpp
-+++ b/src/shaders/SkImageShader.cpp
-@@ -322,6 +322,18 @@ sk_sp<SkShader> SkImageShader::Make(sk_sp<SkImage> image, SkTileMode tmx, SkTile
- #include "src/gpu/effects/GrBlendFragmentProcessor.h"
- #include "src/gpu/effects/GrTextureEffect.h"
- 
-+namespace {
-+template<typename T>
-+constexpr T skia_max( std::initializer_list<T> list )
-+{
-+T max = *list.begin();
-+for(auto i: list)
-+    if( max < i )
-+        max = i;
-+return max;
-+}
-+}
-+
- std::unique_ptr<GrFragmentProcessor> SkImageShader::asFragmentProcessor(
-         const GrFPArgs& args) const {
-     const auto lm = this->totalLocalMatrix(args.fPreLocalMatrix);
-@@ -331,11 +343,11 @@ std::unique_ptr<GrFragmentProcessor> SkImageShader::asFragmentProcessor(
-     }
- 
-     // This would all be much nicer with std::variant.
--    static constexpr size_t kSize = std::max({sizeof(GrYUVAImageTextureMaker),
-+    static constexpr size_t kSize = skia_max({sizeof(GrYUVAImageTextureMaker),
-                                               sizeof(GrTextureAdjuster      ),
-                                               sizeof(GrImageTextureMaker    ),
-                                               sizeof(GrBitmapTextureMaker   )});
--    static constexpr size_t kAlign = std::max({alignof(GrYUVAImageTextureMaker),
-+    static constexpr size_t kAlign = skia_max({alignof(GrYUVAImageTextureMaker),
-                                                alignof(GrTextureAdjuster      ),
-                                                alignof(GrImageTextureMaker    ),
-                                                alignof(GrBitmapTextureMaker   )});
 diff --git a/src/sksl/SkSLASTNode.h b/src/sksl/SkSLASTNode.h
-index 5922cd5fb3..17a877ee21 100644
+index e6d3015d33..d95b43a778 100644
 --- a/src/sksl/SkSLASTNode.h
 +++ b/src/sksl/SkSLASTNode.h
-@@ -17,6 +17,18 @@
+@@ -18,6 +18,18 @@
  
  namespace SkSL {
  
@@ -58,12 +21,12 @@ index 5922cd5fb3..17a877ee21 100644
  /**
   * Represents a node in the abstract syntax tree (AST). The AST is based directly on the parse tree;
   * it is a parsed-but-not-yet-analyzed version of the program.
-@@ -263,7 +275,7 @@ struct ASTNode {
+@@ -251,7 +263,7 @@ struct ASTNode {
      };
  
      struct NodeData {
--        char fBytes[std::max({sizeof(Token),
-+        char fBytes[skia_max({sizeof(Token),
+-        char fBytes[std::max({sizeof(Token::Kind),
++        char fBytes[skia_max({sizeof(Token::Kind),
                                sizeof(StringFragment),
                                sizeof(bool),
                                sizeof(SKSL_INT),
diff --git a/external/skia/fix-pch.patch.1 b/external/skia/fix-pch.patch.1
index 8fb6ea870c10..14199fc2feb2 100644
--- a/external/skia/fix-pch.patch.1
+++ b/external/skia/fix-pch.patch.1
@@ -1,8 +1,8 @@
 diff --git a/include/core/SkColor.h b/include/core/SkColor.h
-index 36527e38e5..ef9065ce75 100644
+index 9cba771ddd..6d324b75d0 100644
 --- a/include/core/SkColor.h
 +++ b/include/core/SkColor.h
-@@ -414,6 +414,7 @@ using SkColor4f = SkRGBA4f<kUnpremul_SkAlphaType>;
+@@ -420,6 +420,7 @@ using SkColor4f = SkRGBA4f<kUnpremul_SkAlphaType>;
  
  template <> SK_API SkColor4f SkColor4f::FromColor(SkColor);
  template <> SK_API SkColor   SkColor4f::toSkColor() const;
@@ -35,10 +35,10 @@ index 248917423f..3d0bc00307 100644
      SkASSERT(far > near);
  
 diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
-index 628e135348..5173a54575 100644
+index 76f69754c6..01ce4a1e2d 100644
 --- a/src/gpu/gl/GrGLGpu.cpp
 +++ b/src/gpu/gl/GrGLGpu.cpp
-@@ -3561,6 +3561,8 @@ void GrGLGpu::xferBarrier(GrRenderTarget* rt, GrXferBarrierType type) {
+@@ -3531,6 +3531,8 @@ void GrGLGpu::xferBarrier(GrRenderTarget* rt, GrXferBarrierType type) {
      }
  }
  
@@ -48,10 +48,10 @@ index 628e135348..5173a54575 100644
      SkASSERT(this->caps()->requiresManualFBBarrierAfterTessellatedStencilDraw());
      GL_CALL(MemoryBarrier(GR_GL_FRAMEBUFFER_BARRIER_BIT));
 diff --git a/src/gpu/text/GrTextBlobCache.h b/src/gpu/text/GrTextBlobCache.h
-index 1e6dd9e02b..d917b0e0be 100644
+index c973384081..8943198ddd 100644
 --- a/src/gpu/text/GrTextBlobCache.h
 +++ b/src/gpu/text/GrTextBlobCache.h
-@@ -93,4 +93,6 @@ private:
+@@ -91,4 +91,6 @@ private:
      SkMessageBus<PurgeBlobMessage>::Inbox fPurgeBlobInbox SK_GUARDED_BY(fSpinLock);
  };
  
@@ -84,7 +84,7 @@ index af4909aaaf..825ec35c83 100644
  #include <d2d1.h>
  
 diff --git a/third_party/skcms/skcms.cc b/third_party/skcms/skcms.cc
-index 3b7806081c..a76eb0a451 100644
+index 4f983439b9..f6fc53c91a 100644
 --- a/third_party/skcms/skcms.cc
 +++ b/third_party/skcms/skcms.cc
 @@ -130,7 +130,8 @@ static float minus_1_ulp(float x) {
@@ -95,9 +95,9 @@ index 3b7806081c..a76eb0a451 100644
 +enum TFKind_skcms { Bad, sRGBish, PQish, HLGish, HLGinvish };
 +#define TFKind TFKind_skcms
  struct TF_PQish  { float A,B,C,D,E,F; };
- struct TF_HLGish { float R,G,a,b,c; };
- 
-@@ -2047,7 +2048,9 @@ typedef enum {
+ struct TF_HLGish { float R,G,a,b,c,K_minus_1; };
+ // We didn't originally support a scale factor K for HLG, and instead just stored 0 in
+@@ -2059,7 +2060,9 @@ typedef enum {
      Op_store_hhhh,
      Op_store_fff,
      Op_store_ffff,
diff --git a/external/skia/fix-warnings.patch.1 b/external/skia/fix-warnings.patch.1
new file mode 100644
index 000000000000..fc9418739810
--- /dev/null
+++ b/external/skia/fix-warnings.patch.1
@@ -0,0 +1,28 @@
+diff --git a/include/core/SkFontParameters.h b/include/core/SkFontParameters.h
+index ae4f1d68b6..71263da7c5 100644
+--- a/include/core/SkFontParameters.h
++++ b/include/core/SkFontParameters.h
+@@ -16,8 +16,8 @@ struct SkFontParameters {
+         // Parameters in a variation font axis.
+         struct Axis {
+             constexpr Axis() : tag(0), min(0), def(0), max(0), flags(0) {}
+-            constexpr Axis(SkFourByteTag tag, float min, float def, float max, bool hidden) :
+-                tag(tag), min(min), def(def), max(max), flags(hidden ? HIDDEN : 0) {}
++            constexpr Axis(SkFourByteTag _tag, float _min, float _def, float _max, bool hidden) :
++                tag(_tag), min(_min), def(_def), max(_max), flags(hidden ? HIDDEN : 0) {}
+ 
+             // Four character identifier of the font axis (weight, width, slant, italic...).
+             SkFourByteTag tag;
+diff --git a/tools/sk_app/WindowContext.h b/tools/sk_app/WindowContext.h
+index f143dab013..be3cde0f4f 100644
+--- a/tools/sk_app/WindowContext.h
++++ b/tools/sk_app/WindowContext.h
+@@ -31,7 +31,7 @@ public:
+ 
+     virtual void resize(int w, int h) = 0;
+ 
+-    virtual void activate(bool isActive) {}
++    virtual void activate(bool /*isActive*/) {}
+ 
+     const DisplayParams& getDisplayParams() { return fDisplayParams; }
+     virtual void setDisplayParams(const DisplayParams& params) = 0;
diff --git a/external/skia/fontconfig-get-typeface.patch.0 b/external/skia/fontconfig-get-typeface.patch.0
index a7a82bfa07f4..20c3f5b9cbe0 100644
--- a/external/skia/fontconfig-get-typeface.patch.0
+++ b/external/skia/fontconfig-get-typeface.patch.0
@@ -1,32 +1,40 @@
---- ./src/ports/SkFontMgr_fontconfig.cpp.sav	2020-01-20 16:42:51.322186451 +0100
-+++ ./src/ports/SkFontMgr_fontconfig.cpp	2020-03-13 11:25:15.793936659 +0100
-@@ -699,6 +699,7 @@ class SkFontMgr_fontconfig : public SkFo
+diff --git a/include/ports/SkFontMgr_fontconfig.h b/include/ports/SkFontMgr_fontconfig.h
+index 4b2bb2d297..2b82cbfedd 100644
+--- include/ports/SkFontMgr_fontconfig.h
++++ include/ports/SkFontMgr_fontconfig.h
+@@ -19,4 +19,9 @@ class SkFontMgr;
+  */
+ SK_API sk_sp<SkFontMgr> SkFontMgr_New_FontConfig(FcConfig* fc);
+ 
++struct _FcPattern;
++typedef struct _FcPattern FcPattern;
++class SkTypeface;
++SK_API sk_sp<SkTypeface> SkFontMgr_createTypefaceFromFcPattern(const sk_sp<SkFontMgr>& mgr, FcPattern* pattern);
++
+ #endif // #ifndef SkFontMgr_fontconfig_DEFINED
+diff --git a/src/ports/SkFontMgr_fontconfig.cpp b/src/ports/SkFontMgr_fontconfig.cpp
+index c2da39b28f..28483faf02 100644
+--- src/ports/SkFontMgr_fontconfig.cpp
++++ src/ports/SkFontMgr_fontconfig.cpp
+@@ -690,6 +690,7 @@ class SkFontMgr_fontconfig : public SkFontMgr {
      /** Creates a typeface using a typeface cache.
       *  @param pattern a complete pattern from FcFontRenderPrepare.
       */
 +public:
-     sk_sp<SkTypeface> createTypefaceFromFcPattern(FcPattern* pattern) const {
-         FCLocker::AssertHeld();
-         SkAutoMutexExclusive ama(fTFCacheMutex);
-@@ -1039,3 +1040,9 @@ protected:
+     sk_sp<SkTypeface> createTypefaceFromFcPattern(SkAutoFcPattern pattern) const {
+         if (!pattern) {
+             return nullptr;
+@@ -1043,3 +1044,13 @@ protected:
  SK_API sk_sp<SkFontMgr> SkFontMgr_New_FontConfig(FcConfig* fc) {
      return sk_make_sp<SkFontMgr_fontconfig>(fc);
  }
 +
 +SK_API sk_sp<SkTypeface> SkFontMgr_createTypefaceFromFcPattern(const sk_sp<SkFontMgr>& mgr, FcPattern* pattern)
 +{
-+    FCLocker lock;
-+    return static_cast<SkFontMgr_fontconfig*>(mgr.get())->createTypefaceFromFcPattern(pattern);
++    SkAutoFcPattern p([pattern]() {
++        FCLocker lock;
++        FcPatternReference(pattern);
++        return pattern;
++    }());
++    return static_cast<SkFontMgr_fontconfig*>(mgr.get())->createTypefaceFromFcPattern(std::move(p));
 +}
---- ./include/ports/SkFontMgr_fontconfig.h.sav	2019-09-19 11:38:00.943185323 +0200
-+++ ./include/ports/SkFontMgr_fontconfig.h	2020-03-13 11:31:48.025716543 +0100
-@@ -19,4 +19,9 @@ class SkFontMgr;
-  */
- SK_API sk_sp<SkFontMgr> SkFontMgr_New_FontConfig(FcConfig* fc);
- 
-+struct _FcPattern;
-+typedef struct _FcPattern FcPattern;
-+class SkTypeface;
-+SK_API sk_sp<SkTypeface> SkFontMgr_createTypefaceFromFcPattern(const sk_sp<SkFontMgr>& mgr, FcPattern* pattern);
-+
- #endif // #ifndef SkFontMgr_fontconfig_DEFINED
diff --git a/external/skia/inc/pch/precompiled_skia.hxx b/external/skia/inc/pch/precompiled_skia.hxx
index b4f9ea92f0af..760dea10de62 100644
--- a/external/skia/inc/pch/precompiled_skia.hxx
+++ b/external/skia/inc/pch/precompiled_skia.hxx
@@ -13,7 +13,7 @@
  manual changes will be rewritten by the next run of update_pch.sh (which presumably
  also fixes all possible problems, so it's usually better to use it).
 
- Generated on 2020-11-13 19:45:52 using:
+ Generated on 2021-03-01 17:09:09 using:
  ./bin/update_pch external/skia skia --cutoff=1 --exclude:system --include:module --include:local
 
  If after updating build fails, use the following command to locate conflicting headers:
@@ -40,6 +40,7 @@
 #include <deque>
 #include <errno.h>
 #include <float.h>
+#include <forward_list>
 #include <fstream>
 #include <functional>
 #include <inttypes.h>
@@ -48,6 +49,7 @@
 #include <limits>
 #include <locale>
 #include <map>
+#include <math.h>
 #include <memory>
 #include <new>
 #include <png.h>
@@ -103,7 +105,6 @@
 #include <include/core/SkDeferredDisplayList.h>
 #include <include/core/SkDeferredDisplayListRecorder.h>
 #include <include/core/SkDocument.h>
-#include <include/core/SkDrawLooper.h>
 #include <include/core/SkDrawable.h>
 #include <include/core/SkExecutor.h>
 #include <include/core/SkFilterQuality.h>
@@ -139,7 +140,6 @@
 #include <include/core/SkPromiseImageTexture.h>
 #include <include/core/SkRRect.h>
 #include <include/core/SkRSXform.h>
-#include <include/core/SkRWBuffer.h>
 #include <include/core/SkRasterHandleAllocator.h>
 #include <include/core/SkRect.h>
 #include <include/core/SkRefCnt.h>
@@ -163,50 +163,28 @@
 #include <include/core/SkTypes.h>
 #include <include/core/SkUnPreMultiply.h>
 #include <include/core/SkVertices.h>
-#include <include/core/SkYUVAIndex.h>
 #include <include/core/SkYUVAInfo.h>
 #include <include/core/SkYUVAPixmaps.h>
-#include <include/core/SkYUVASizeInfo.h>
 #include <include/effects/Sk1DPathEffect.h>
 #include <include/effects/Sk2DPathEffect.h>
-#include <include/effects/SkAlphaThresholdFilter.h>
-#include <include/effects/SkArithmeticImageFilter.h>
-#include <include/effects/SkBlurDrawLooper.h>
-#include <include/effects/SkBlurImageFilter.h>
 #include <include/effects/SkBlurMaskFilter.h>
-#include <include/effects/SkColorFilterImageFilter.h>
 #include <include/effects/SkColorMatrix.h>
 #include <include/effects/SkColorMatrixFilter.h>
-#include <include/effects/SkComposeImageFilter.h>
 #include <include/effects/SkCornerPathEffect.h>
 #include <include/effects/SkDashPathEffect.h>
 #include <include/effects/SkDiscretePathEffect.h>
-#include <include/effects/SkDisplacementMapEffect.h>
-#include <include/effects/SkDropShadowImageFilter.h>
 #include <include/effects/SkGradientShader.h>
 #include <include/effects/SkHighContrastFilter.h>
 #include <include/effects/SkImageFilters.h>
-#include <include/effects/SkImageSource.h>
-#include <include/effects/SkLayerDrawLooper.h>
-#include <include/effects/SkLightingImageFilter.h>
 #include <include/effects/SkLumaColorFilter.h>
-#include <include/effects/SkMagnifierImageFilter.h>
-#include <include/effects/SkMatrixConvolutionImageFilter.h>
-#include <include/effects/SkMergeImageFilter.h>
-#include <include/effects/SkMorphologyImageFilter.h>
-#include <include/effects/SkOffsetImageFilter.h>
 #include <include/effects/SkOverdrawColorFilter.h>
-#include <include/effects/SkPaintImageFilter.h>
 #include <include/effects/SkPerlinNoiseShader.h>
-#include <include/effects/SkPictureImageFilter.h>
 #include <include/effects/SkRuntimeEffect.h>
 #include <include/effects/SkShaderMaskFilter.h>
 #include <include/effects/SkStrokeAndFillPathEffect.h>
 #include <include/effects/SkTableColorFilter.h>
 #include <include/effects/SkTableMaskFilter.h>
-#include <include/effects/SkTileImageFilter.h>
 #include <include/effects/SkTrimPathEffect.h>
-#include <include/effects/SkXfermodeImageFilter.h>
 #include <include/encode/SkJpegEncoder.h>
 #include <include/encode/SkPngEncoder.h>
 #include <include/encode/SkWebpEncoder.h>
@@ -225,7 +203,6 @@
 #include <include/gpu/mock/GrMockTypes.h>
 #include <include/gpu/vk/GrVkBackendContext.h>
 #include <include/gpu/vk/GrVkExtensions.h>
-#include <include/gpu/vk/GrVkMemoryAllocator.h>
 #include <include/gpu/vk/GrVkTypes.h>
 #include <include/pathops/SkPathOps.h>
 #include <include/ports/SkRemotableFontMgr.h>
@@ -318,7 +295,6 @@
 #include <src/core/SkAutoPixmapStorage.h>
 #include <src/core/SkBigPicture.h>
 #include <src/core/SkBitmapCache.h>
-#include <src/core/SkBitmapController.h>
 #include <src/core/SkBitmapDevice.h>
 #include <src/core/SkBitmapProcState.h>
 #include <src/core/SkBlendModePriv.h>
@@ -394,6 +370,8 @@
 #include <src/core/SkMessageBus.h>
 #include <src/core/SkMiniRecorder.h>
 #include <src/core/SkMipmap.h>
+#include <src/core/SkMipmapAccessor.h>
+#include <src/core/SkMipmapBuilder.h>
 #include <src/core/SkModeColorFilter.h>
 #include <src/core/SkNextID.h>
 #include <src/core/SkOSFile.h>
@@ -430,8 +408,10 @@
 #include <src/core/SkRegionPriv.h>
 #include <src/core/SkRemoteGlyphCache.h>
 #include <src/core/SkResourceCache.h>
+#include <src/core/SkRuntimeEffectPriv.h>
 #include <src/core/SkSafeMath.h>
 #include <src/core/SkSafeRange.h>
+#include <src/core/SkSamplingPriv.h>
 #include <src/core/SkScaleToSides.h>
 #include <src/core/SkScalerCache.h>
 #include <src/core/SkScalerContext.h>
@@ -458,7 +438,6 @@
 #include <src/core/SkTLazy.h>
 #include <src/core/SkTSearch.h>
 #include <src/core/SkTSort.h>
-#include <src/core/SkTTopoSort.h>
 #include <src/core/SkTaskGroup.h>
 #include <src/core/SkTextBlobPriv.h>
 #include <src/core/SkTextBlobTrace.h>
@@ -477,6 +456,7 @@
 #include <src/core/SkWriter32.h>
 #include <src/core/SkXfermodeInterpretation.h>
 #include <src/core/SkXfermodePriv.h>
+#include <src/core/SkYUVAInfoLocation.h>
 #include <src/core/SkYUVMath.h>
 #include <src/core/SkYUVPlanesCache.h>
 #include <src/effects/SkDashImpl.h>
@@ -485,6 +465,9 @@
 #include <src/effects/SkOpPE.h>
 #include <src/effects/SkPackBits.h>
 #include <src/effects/SkTrimPE.h>
+#include <src/effects/imagefilters/SkPictureImageFilter.h>
+#include <src/effects/imagefilters/SkTileImageFilter.h>
+#include <src/gpu/GrAATriangulator.h>
 #include <src/gpu/GrAHardwareBufferImageGenerator.h>
 #include <src/gpu/GrAHardwareBufferUtils.h>
 #include <src/gpu/GrAppliedClip.h>
@@ -512,11 +495,13 @@
 #include <src/gpu/GrContextThreadSafeProxyPriv.h>
 #include <src/gpu/GrCopyRenderTask.h>
 #include <src/gpu/GrCpuBuffer.h>
+#include <src/gpu/GrDDLTask.h>
 #include <src/gpu/GrDataUtils.h>
 #include <src/gpu/GrDefaultGeoProcFactory.h>
 #include <src/gpu/GrDeferredProxyUploader.h>
 #include <src/gpu/GrDirectContextPriv.h>
 #include <src/gpu/GrDistanceFieldGenFromVector.h>
+#include <src/gpu/GrDrawIndirectCommand.h>
 #include <src/gpu/GrDrawOpAtlas.h>
 #include <src/gpu/GrDrawOpTest.h>
 #include <src/gpu/GrDrawingManager.h>
@@ -536,6 +521,7 @@
 #include <src/gpu/GrImageContextPriv.h>
 #include <src/gpu/GrImageInfo.h>
 #include <src/gpu/GrImageTextureMaker.h>
+#include <src/gpu/GrInnerFanTriangulator.h>
 #include <src/gpu/GrManagedResource.h>
 #include <src/gpu/GrMemoryPool.h>
 #include <src/gpu/GrNativeRect.h>
@@ -564,10 +550,9 @@
 #include <src/gpu/GrRectanizerSkyline.h>
 #include <src/gpu/GrReducedClip.h>
 #include <src/gpu/GrRenderTarget.h>
-#include <src/gpu/GrRenderTargetContext.h>
-#include <src/gpu/GrRenderTargetContextPriv.h>
 #include <src/gpu/GrRenderTargetProxy.h>
 #include <src/gpu/GrRenderTask.h>
+#include <src/gpu/GrRenderTaskCluster.h>
 #include <src/gpu/GrResourceAllocator.h>
 #include <src/gpu/GrResourceCache.h>
 #include <src/gpu/GrResourceProvider.h>
@@ -592,11 +577,13 @@
 #include <src/gpu/GrStyle.h>
 #include <src/gpu/GrSurface.h>
 #include <src/gpu/GrSurfaceContext.h>
-#include <src/gpu/GrSurfaceContextPriv.h>
+#include <src/gpu/GrSurfaceDrawContext.h>
+#include <src/gpu/GrSurfaceFillContext.h>
 #include <src/gpu/GrSurfaceProxy.h>
 #include <src/gpu/GrSurfaceProxyPriv.h>
 #include <src/gpu/GrSurfaceProxyView.h>
 #include <src/gpu/GrSwizzle.h>
+#include <src/gpu/GrTTopoSort.h>
 #include <src/gpu/GrTestUtils.h>
 #include <src/gpu/GrTexture.h>
 #include <src/gpu/GrTextureAdjuster.h>
@@ -612,12 +599,14 @@
 #include <src/gpu/GrTransferFromRenderTask.h>
 #include <src/gpu/GrTriangulator.h>
 #include <src/gpu/GrUniformDataManager.h>
-#include <src/gpu/GrUnrefDDLTask.h>
 #include <src/gpu/GrUserStencilSettings.h>
 #include <src/gpu/GrVertexWriter.h>
+#include <src/gpu/GrVx.h>
 #include <src/gpu/GrWaitRenderTask.h>
 #include <src/gpu/GrWindowRectangles.h>
+#include <src/gpu/GrWritePixelsRenderTask.h>
 #include <src/gpu/GrXferProcessor.h>
+#include <src/gpu/GrYUVATextureProxies.h>
 #include <src/gpu/SkGpuDevice.h>
 #include <src/gpu/SkGr.h>
 #include <src/gpu/ccpr/GrAutoMapVertexBuffer.h>
@@ -678,10 +667,7 @@
 #include <src/gpu/effects/generated/GrDitherEffect.h>
 #include <src/gpu/effects/generated/GrEllipseEffect.h>
 #include <src/gpu/effects/generated/GrHSLToRGBFilterEffect.h>
-#include <src/gpu/effects/generated/GrHighContrastFilterEffect.h>
-#include <src/gpu/effects/generated/GrLumaColorFilterEffect.h>
 #include <src/gpu/effects/generated/GrMagnifierEffect.h>
-#include <src/gpu/effects/generated/GrMixerEffect.h>
 #include <src/gpu/effects/generated/GrOverrideInputFragmentProcessor.h>
 #include <src/gpu/effects/generated/GrRGBToHSLFilterEffect.h>
 #include <src/gpu/effects/generated/GrRRectBlurEffect.h>
@@ -764,12 +750,15 @@
 #include <src/gpu/tessellate/GrFillPathShader.h>
 #include <src/gpu/tessellate/GrMiddleOutPolygonTriangulator.h>
 #include <src/gpu/tessellate/GrMidpointContourParser.h>
-#include <src/gpu/tessellate/GrPathTessellateOp.h>
-#include <src/gpu/tessellate/GrResolveLevelCounter.h>
+#include <src/gpu/tessellate/GrPathInnerTriangulateOp.h>
+#include <src/gpu/tessellate/GrPathTessellator.h>
 #include <src/gpu/tessellate/GrStencilPathShader.h>
-#include <src/gpu/tessellate/GrStrokeOp.h>
+#include <src/gpu/tessellate/GrStrokeHardwareTessellator.h>
+#include <src/gpu/tessellate/GrStrokeIndirectTessellator.h>
+#include <src/gpu/tessellate/GrStrokeIterator.h>
 #include <src/gpu/tessellate/GrStrokeTessellateOp.h>
 #include <src/gpu/tessellate/GrStrokeTessellateShader.h>
+#include <src/gpu/tessellate/GrTessellatingStencilFillOp.h>
 #include <src/gpu/tessellate/GrTessellationPathRenderer.h>
 #include <src/gpu/tessellate/GrWangsFormula.h>
 #include <src/gpu/text/GrAtlasManager.h>
@@ -793,8 +782,8 @@
 #include <src/gpu/vk/GrVkImageLayout.h>
 #include <src/gpu/vk/GrVkImageView.h>
 #include <src/gpu/vk/GrVkInterface.h>
+#include <src/gpu/vk/GrVkMSAALoadManager.h>
 #include <src/gpu/vk/GrVkMemory.h>
-#include <src/gpu/vk/GrVkMeshBuffer.h>
 #include <src/gpu/vk/GrVkOpsRenderPass.h>
 #include <src/gpu/vk/GrVkPipeline.h>
 #include <src/gpu/vk/GrVkPipelineState.h>
@@ -809,8 +798,6 @@
 #include <src/gpu/vk/GrVkSemaphore.h>
 #include <src/gpu/vk/GrVkTexture.h>
 #include <src/gpu/vk/GrVkTextureRenderTarget.h>
-#include <src/gpu/vk/GrVkTransferBuffer.h>
-#include <src/gpu/vk/GrVkUniformBuffer.h>
 #include <src/gpu/vk/GrVkUniformHandler.h>
 #include <src/gpu/vk/GrVkUtil.h>
 #include <src/gpu/vk/GrVkVaryingHandler.h>
@@ -874,13 +861,16 @@
 #include <src/sksl/GLSL.std.450.h>
 #include <src/sksl/SkSLASTNode.h>
 #include <src/sksl/SkSLAnalysis.h>
-#include <src/sksl/SkSLByteCode.h>
-#include <src/sksl/SkSLByteCodeGenerator.h>
+#include <src/sksl/SkSLBuiltinTypes.h>
 #include <src/sksl/SkSLCFGGenerator.h>
 #include <src/sksl/SkSLCPPCodeGenerator.h>
 #include <src/sksl/SkSLCPPUniformCTypes.h>
+#include <src/sksl/SkSLCodeGenerator.h>
 #include <src/sksl/SkSLCompiler.h>
+#include <src/sksl/SkSLConstantFolder.h>
 #include <src/sksl/SkSLContext.h>
+#include <src/sksl/SkSLDefines.h>
+#include <src/sksl/SkSLDefinitionMap.h>
 #include <src/sksl/SkSLDehydrator.h>
 #include <src/sksl/SkSLErrorReporter.h>
 #include <src/sksl/SkSLGLSLCodeGenerator.h>
@@ -888,11 +878,15 @@
 #include <src/sksl/SkSLIRGenerator.h>
 #include <src/sksl/SkSLInliner.h>
 #include <src/sksl/SkSLLexer.h>
+#include <src/sksl/SkSLMangler.h>
+#include <src/sksl/SkSLMemoryLayout.h>
 #include <src/sksl/SkSLMetalCodeGenerator.h>
+#include <src/sksl/SkSLOperators.h>
 #include <src/sksl/SkSLOutputStream.h>
 #include <src/sksl/SkSLParser.h>
 #include <src/sksl/SkSLPipelineStageCodeGenerator.h>
 #include <src/sksl/SkSLPool.h>
+#include <src/sksl/SkSLProgramSettings.h>
 #include <src/sksl/SkSLRehydrator.h>
 #include <src/sksl/SkSLSPIRVCodeGenerator.h>
 #include <src/sksl/SkSLSPIRVtoHLSL.h>
@@ -900,10 +894,12 @@
 #include <src/sksl/SkSLString.h>
 #include <src/sksl/SkSLStringStream.h>
 #include <src/sksl/SkSLUtil.h>
+#include <src/sksl/SkSLVMGenerator.h>
 #include <src/sksl/ir/SkSLBinaryExpression.h>
 #include <src/sksl/ir/SkSLBlock.h>
 #include <src/sksl/ir/SkSLBoolLiteral.h>
 #include <src/sksl/ir/SkSLBreakStatement.h>
+#include <src/sksl/ir/SkSLCodeStringExpression.h>
 #include <src/sksl/ir/SkSLConstructor.h>
 #include <src/sksl/ir/SkSLContinueStatement.h>
 #include <src/sksl/ir/SkSLDiscardStatement.h>
@@ -913,7 +909,7 @@
 #include <src/sksl/ir/SkSLExpressionStatement.h>
 #include <src/sksl/ir/SkSLExtension.h>
 #include <src/sksl/ir/SkSLExternalFunctionCall.h>
-#include <src/sksl/ir/SkSLExternalValueReference.h>
+#include <src/sksl/ir/SkSLExternalFunctionReference.h>
 #include <src/sksl/ir/SkSLField.h>
 #include <src/sksl/ir/SkSLFieldAccess.h>
 #include <src/sksl/ir/SkSLFloatLiteral.h>
@@ -932,7 +928,6 @@
 #include <src/sksl/ir/SkSLModifiers.h>
 #include <src/sksl/ir/SkSLModifiersDeclaration.h>
 #include <src/sksl/ir/SkSLNop.h>
-#include <src/sksl/ir/SkSLNullLiteral.h>
 #include <src/sksl/ir/SkSLPostfixExpression.h>
 #include <src/sksl/ir/SkSLPrefixExpression.h>
 #include <src/sksl/ir/SkSLProgram.h>
@@ -941,6 +936,7 @@
 #include <src/sksl/ir/SkSLSection.h>
 #include <src/sksl/ir/SkSLSetting.h>
 #include <src/sksl/ir/SkSLStatement.h>
+#include <src/sksl/ir/SkSLStructDefinition.h>
 #include <src/sksl/ir/SkSLSwitchCase.h>
 #include <src/sksl/ir/SkSLSwitchStatement.h>
 #include <src/sksl/ir/SkSLSwizzle.h>
@@ -954,7 +950,7 @@
 #include <src/sksl/ir/SkSLVarDeclarations.h>
 #include <src/sksl/ir/SkSLVariable.h>
 #include <src/sksl/ir/SkSLVariableReference.h>
-#include <src/sksl/ir/SkSLWhileStatement.h>
+#include <src/sksl/spirv.h>
 #include <src/utils/SkBitSet.h>
 #include <src/utils/SkCanvasStack.h>
 #include <src/utils/SkCharToGlyphCache.h>
diff --git a/external/skia/lerp.patch b/external/skia/lerp.patch
deleted file mode 100644
index 2062c21f2df0..000000000000
--- a/external/skia/lerp.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/src/shaders/SkPerlinNoiseShader.cpp b/src/shaders/SkPerlinNoiseShader.cpp
-index 812dc1694f..60b8d617c6 100644
---- a/src/shaders/SkPerlinNoiseShader.cpp
-+++ b/src/shaders/SkPerlinNoiseShader.cpp
-@@ -573,6 +573,7 @@ static SkScalar fade(SkScalar t) {
-     return t * t * t * (t * (t * 6 - 15) + 10);
- }
- 
-+#define lerp skia_lerp
- static SkScalar lerp(SkScalar t, SkScalar a, SkScalar b) {
-     return a + t * (b - a);
- }
diff --git a/vcl/inc/skia/salbmp.hxx b/vcl/inc/skia/salbmp.hxx
index ec8d4f3c7b82..2a1d309a7fec 100644
--- a/vcl/inc/skia/salbmp.hxx
+++ b/vcl/inc/skia/salbmp.hxx
@@ -26,6 +26,8 @@
 
 #include <boost/shared_ptr.hpp>
 
+#include <vcl/bitmap.hxx>
+
 class VCL_PLUGIN_PUBLIC SkiaSalBitmap final : public SalBitmap
 {
 public:
@@ -69,11 +71,11 @@ public:
 
     // Returns the contents as SkImage (possibly GPU-backed).
     const sk_sp<SkImage>& GetSkImage() const;
-    sk_sp<SkShader> GetSkShader() const;
+    sk_sp<SkShader> GetSkShader(const SkSamplingOptions& samplingOptions) const;
 
     // Returns the contents as alpha SkImage (possibly GPU-backed)
     const sk_sp<SkImage>& GetAlphaSkImage() const;
-    sk_sp<SkShader> GetAlphaSkShader() const;
+    sk_sp<SkShader> GetAlphaSkShader(const SkSamplingOptions& samplingOptions) const;
 
     // Key for caching/hashing.
     OString GetImageKey() const;
@@ -173,7 +175,7 @@ private:
     // Actual scaling triggered by scale() is done on-demand. This is the size of the pixel
     // data in mBuffer, if it differs from mSize, then there is a scaling operation pending.
     Size mPixelsSize;
-    SkFilterQuality mScaleQuality = kHigh_SkFilterQuality; // quality for on-demand scaling
+    BmpScaleFlag mScaleQuality = BmpScaleFlag::BestQuality; // quality for on-demand scaling
     // Erase() is delayed, just sets these two instead of filling the buffer.
     bool mEraseColorSet = false;
     Color mEraseColor;
diff --git a/vcl/inc/skia/utils.hxx b/vcl/inc/skia/utils.hxx
index b5412e9f9479..3baa749adb8b 100644
--- a/vcl/inc/skia/utils.hxx
+++ b/vcl/inc/skia/utils.hxx
@@ -24,6 +24,8 @@
 
 #include <tools/gen.hxx>
 #include <driverblocklist.hxx>
+#include <vcl/bitmap.hxx>
+#include <vcl/salgtype.hxx>
 
 #include <SkRegion.h>
 #include <SkSurface.h>
@@ -81,6 +83,29 @@ VCL_DLLPUBLIC const SkSurfaceProps* surfaceProps();
 // Set pixel geometry to be used by SkSurfaceProps.
 VCL_DLLPUBLIC void setPixelGeometry(SkPixelGeometry pixelGeometry);
 
+inline SkSamplingOptions makeSamplingOptions(BmpScaleFlag scaling)
+{
+    switch (scaling)
+    {
+        case BmpScaleFlag::BestQuality:
+            return SkSamplingOptions(SkCubicResampler::Mitchell());
+        case BmpScaleFlag::Default:
+            return SkSamplingOptions(SkFilterMode::kLinear, SkMipmapMode::kNone);
+        case BmpScaleFlag::Fast:
+            return SkSamplingOptions(SkFilterMode::kNearest, SkMipmapMode::kNone);
+        default:
+            assert(false);
+            return SkSamplingOptions();
+    }
+}
+
+inline SkSamplingOptions makeSamplingOptions(const SalTwoRect& rPosAry)
+{
+    if (rPosAry.mnSrcWidth != rPosAry.mnDestWidth || rPosAry.mnSrcHeight != rPosAry.mnDestHeight)
+        return SkSamplingOptions(SkCubicResampler::Mitchell()); // best
+    return SkSamplingOptions(); // none
+}
+
 #ifdef DBG_UTIL
 void prefillSurface(const sk_sp<SkSurface>& surface);
 VCL_DLLPUBLIC void dump(const SkBitmap& bitmap, const char* file);
diff --git a/vcl/skia/SkiaHelper.cxx b/vcl/skia/SkiaHelper.cxx
index b2da1e4b1ef8..0616c5060af0 100644
--- a/vcl/skia/SkiaHelper.cxx
+++ b/vcl/skia/SkiaHelper.cxx
@@ -445,7 +445,8 @@ sk_sp<SkImage> createSkImage(const SkBitmap& bitmap)
                 {
                     SkPaint paint;
                     paint.setBlendMode(SkBlendMode::kSrc); // set as is, including alpha
-                    surface->getCanvas()->drawBitmap(bitmap, 0, 0, &paint);
+                    surface->getCanvas()->drawImage(bitmap.asImage(), 0, 0, SkSamplingOptions(),
+                                                    &paint);
                     return makeCheckedImageSnapshot(surface);
                 }
                 // Try to fall back in non-debug builds.
@@ -606,7 +607,8 @@ void prefillSurface(const sk_sp<SkSurface>& surface)
     bitmap.setImmutable();
     SkPaint paint;
     paint.setBlendMode(SkBlendMode::kSrc); // set as is, including alpha
-    paint.setShader(bitmap.makeShader(SkTileMode::kRepeat, SkTileMode::kRepeat));
+    paint.setShader(
+        bitmap.makeShader(SkTileMode::kRepeat, SkTileMode::kRepeat, SkSamplingOptions()));
     surface->getCanvas()->drawPaint(paint);
 }
 
diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index c511b2ef2f45..36e10068afb6 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -45,6 +45,8 @@
 #include <o3tl/sorted_vector.hxx>
 #include <rtl/math.hxx>
 
+using namespace SkiaHelper;
+
 namespace
 {
 // Create Skia Path from B2DPolygon
@@ -493,7 +495,7 @@ void SkiaSalGraphicsImpl::checkSurface()
             {
                 SkPaint paint;
                 paint.setBlendMode(SkBlendMode::kSrc); // copy as is
-                mSurface->getCanvas()->drawImage(snapshot, 0, 0, &paint);
+                mSurface->getCanvas()->drawImage(snapshot, 0, 0, SkSamplingOptions(), &paint);
             }
             SAL_INFO("vcl.skia.trace", "recreate(" << this << "): old " << oldSize << " new "
                                                    << Size(mSurface->width(), mSurface->height())
@@ -651,8 +653,9 @@ void SkiaSalGraphicsImpl::applyXor()
     SkPaint paint;
     paint.setBlendMode(SkBlendMode::kSrc); // copy as is
     SkCanvas canvas(surfaceBitmap);
-    canvas.drawImageRect(SkiaHelper::makeCheckedImageSnapshot(mSurface), mXorRegion.getBounds(),
-                         SkRect::Make(mXorRegion.getBounds()), &paint);
+    SkRect area = SkRect::Make(mXorRegion.getBounds());
+    canvas.drawImageRect(SkiaHelper::makeCheckedImageSnapshot(mSurface), area, area,
+                         SkSamplingOptions(), &paint, SkCanvas::kFast_SrcRectConstraint);
     // xor to surfaceBitmap
     assert(surfaceBitmap.info().alphaType() == kUnpremul_SkAlphaType);
     assert(mXorBitmap.info().alphaType() == kUnpremul_SkAlphaType);
@@ -676,8 +679,9 @@ void SkiaSalGraphicsImpl::applyXor()
         }
     }
     surfaceBitmap.notifyPixelsChanged();
-    mSurface->getCanvas()->drawBitmapRect(surfaceBitmap, mXorRegion.getBounds(),
-                                          SkRect::Make(mXorRegion.getBounds()), &paint);
+    surfaceBitmap.setImmutable();
+    mSurface->getCanvas()->drawImageRect(surfaceBitmap.asImage(), area, area, SkSamplingOptions(),
+                                         &paint, SkCanvas::kFast_SrcRectConstraint);
     mXorCanvas.reset();
     mXorBitmap.reset();
     mXorRegion.setEmpty();
@@ -1189,8 +1193,9 @@ static void copyArea(SkCanvas* canvas, sk_sp<SkSurface> surface, tools::Long nDe
         SkPaint paint;
         paint.setBlendMode(SkBlendMode::kSrc); // copy as is, including alpha
         canvas->drawImageRect(SkiaHelper::makeCheckedImageSnapshot(surface),
-                              SkIRect::MakeXYWH(nSrcX, nSrcY, nSrcWidth, nSrcHeight),
-                              SkRect::MakeXYWH(nDestX, nDestY, nSrcWidth, nSrcHeight), &paint);
+                              SkRect::MakeXYWH(nSrcX, nSrcY, nSrcWidth, nSrcHeight),
+                              SkRect::MakeXYWH(nDestX, nDestY, nSrcWidth, nSrcHeight),
+                              SkSamplingOptions(), &paint, SkCanvas::kFast_SrcRectConstraint);
         return;
     }
     // SkCanvas::draw() cannot do a subrectangle, so clip.
@@ -1263,15 +1268,13 @@ void SkiaSalGraphicsImpl::copyBits(const SalTwoRect& rPosAry, SalGraphics* pSrcG
         sk_sp<SkImage> image = SkiaHelper::makeCheckedImageSnapshot(src->mSurface);
         SkPaint paint;
         paint.setBlendMode(SkBlendMode::kSrc); // copy as is, including alpha
-        if (rPosAry.mnSrcWidth != rPosAry.mnDestWidth
-            || rPosAry.mnSrcHeight != rPosAry.mnDestHeight)
-            paint.setFilterQuality(kHigh_SkFilterQuality);
         getDrawCanvas()->drawImageRect(image,
-                                       SkIRect::MakeXYWH(rPosAry.mnSrcX, rPosAry.mnSrcY,
-                                                         rPosAry.mnSrcWidth, rPosAry.mnSrcHeight),
+                                       SkRect::MakeXYWH(rPosAry.mnSrcX, rPosAry.mnSrcY,
+                                                        rPosAry.mnSrcWidth, rPosAry.mnSrcHeight),
                                        SkRect::MakeXYWH(rPosAry.mnDestX, rPosAry.mnDestY,
                                                         rPosAry.mnDestWidth, rPosAry.mnDestHeight),
-                                       &paint);
+                                       makeSamplingOptions(rPosAry), &paint,
+                                       SkCanvas::kFast_SrcRectConstraint);
     }
     postDraw();
 }
@@ -1334,14 +1337,15 @@ bool SkiaSalGraphicsImpl::blendAlphaBitmap(const SalTwoRect& rPosAry,
     // "result_alpha = 1.0 - (1.0 - floor(alpha)) * mask".
     // See also blendBitmap().
 
+    SkSamplingOptions samplingOptions = makeSamplingOptions(rPosAry);
     // First do the "( 1 - alpha ) * mask"
     // (no idea how to do "floor", but hopefully not needed in practice).
     sk_sp<SkShader> shaderAlpha
-        = SkShaders::Blend(SkBlendMode::kDstOut, rSkiaMaskBitmap.GetAlphaSkShader(),
-                           rSkiaAlphaBitmap.GetAlphaSkShader());
+        = SkShaders::Blend(SkBlendMode::kDstOut, rSkiaMaskBitmap.GetAlphaSkShader(samplingOptions),
+                           rSkiaAlphaBitmap.GetAlphaSkShader(samplingOptions));
     // And now draw the bitmap with "1 - x", where x is the "( 1 - alpha ) * mask".
-    sk_sp<SkShader> shader
-        = SkShaders::Blend(SkBlendMode::kSrcOut, shaderAlpha, rSkiaSourceBitmap.GetSkShader());
+    sk_sp<SkShader> shader = SkShaders::Blend(SkBlendMode::kSrcOut, shaderAlpha,
+                                              rSkiaSourceBitmap.GetSkShader(samplingOptions));
     drawShader(rPosAry, shader);
     return true;
 }
@@ -1371,7 +1375,7 @@ void SkiaSalGraphicsImpl::drawMask(const SalTwoRect& rPosAry, const SalBitmap& r
     drawShader(rPosAry,
                SkShaders::Blend(SkBlendMode::kDstOut, // VCL alpha is one-minus-alpha.
                                 SkShaders::Color(toSkColor(nMaskColor)),
-                                skiaBitmap.GetAlphaSkShader()));
+                                skiaBitmap.GetAlphaSkShader(makeSamplingOptions(rPosAry))));
 }
 
 std::shared_ptr<SalBitmap> SkiaSalGraphicsImpl::getBitmap(tools::Long nX, tools::Long nY,
@@ -1448,11 +1452,13 @@ void SkiaSalGraphicsImpl::invert(basegfx::B2DPolygon const& rPoly, SalInvert eFl
             copy.setBlendMode(SkBlendMode::kSrc);
             flushDrawing();
             surface->getCanvas()->drawImageRect(SkiaHelper::makeCheckedImageSnapshot(mSurface),
-                                                area, size, &copy);
+                                                area, size, SkSamplingOptions(), &copy,
+                                                SkCanvas::kFast_SrcRectConstraint);
             aPath.offset(-area.x(), -area.y());
             surface->getCanvas()->drawPath(aPath, aPaint);
             getDrawCanvas()->drawImageRect(SkiaHelper::makeCheckedImageSnapshot(surface), size,
-                                           area, &copy);
+                                           area, SkSamplingOptions(), &copy,
+                                           SkCanvas::kFast_SrcRectConstraint);
         }
     }
     else
@@ -1481,7 +1487,8 @@ void SkiaSalGraphicsImpl::invert(basegfx::B2DPolygon const& rPoly, SalInvert eFl
             aBitmap.setImmutable();
             // The bitmap is repeated in both directions the checker pattern is as big
             // as the polygon (usually rectangle)
-            aPaint.setShader(aBitmap.makeShader(SkTileMode::kRepeat, SkTileMode::kRepeat));
+            aPaint.setShader(
+                aBitmap.makeShader(SkTileMode::kRepeat, SkTileMode::kRepeat, SkSamplingOptions()));
         }
         if (!intelHack)
             getDrawCanvas()->drawPath(aPath, aPaint);
@@ -1496,11 +1503,13 @@ void SkiaSalGraphicsImpl::invert(basegfx::B2DPolygon const& rPoly, SalInvert eFl
             copy.setBlendMode(SkBlendMode::kSrc);
             flushDrawing();
             surface->getCanvas()->drawImageRect(SkiaHelper::makeCheckedImageSnapshot(mSurface),
-                                                area, size, &copy);
+                                                area, size, SkSamplingOptions(), &copy,
+                                                SkCanvas::kFast_SrcRectConstraint);
             aPath.offset(-area.x(), -area.y());
             surface->getCanvas()->drawPath(aPath, aPaint);
             getDrawCanvas()->drawImageRect(SkiaHelper::makeCheckedImageSnapshot(surface), size,
-                                           area, &copy);
+                                           area, SkSamplingOptions(), &copy,
+                                           SkCanvas::kFast_SrcRectConstraint);
         }
     }
     postDraw();
@@ -1606,28 +1615,29 @@ sk_sp<SkImage> SkiaSalGraphicsImpl::mergeCacheBitmaps(const SkiaSalBitmap& bitma
     SkCanvas* canvas = tmpSurface->getCanvas();
     SkAutoCanvasRestore autoRestore(canvas, true);
     SkPaint paint;
+    SkSamplingOptions samplingOptions;
     if (targetSize != bitmap.GetSize())
     {
         SkMatrix matrix;
         matrix.set(SkMatrix::kMScaleX, 1.0 * targetSize.Width() / bitmap.GetSize().Width());
         matrix.set(SkMatrix::kMScaleY, 1.0 * targetSize.Height() / bitmap.GetSize().Height());
         canvas->concat(matrix);
-        paint.setFilterQuality(kHigh_SkFilterQuality);
+        samplingOptions = makeSamplingOptions(BmpScaleFlag::BestQuality);
     }
     if (alphaBitmap != nullptr)
     {
         canvas->clear(SK_ColorTRANSPARENT);
-        paint.setShader(SkShaders::Blend(SkBlendMode::kDstOut, bitmap.GetSkShader(),
-                                         alphaBitmap->GetAlphaSkShader()));
+        paint.setShader(SkShaders::Blend(SkBlendMode::kDstOut, bitmap.GetSkShader(samplingOptions),
+                                         alphaBitmap->GetAlphaSkShader(samplingOptions)));
         canvas->drawPaint(paint);
     }
     else if (bitmap.PreferSkShader())
     {
-        paint.setShader(bitmap.GetSkShader());
+        paint.setShader(bitmap.GetSkShader(samplingOptions));
         canvas->drawPaint(paint);
     }
     else
-        canvas->drawImage(bitmap.GetSkImage(), 0, 0, &paint);
+        canvas->drawImage(bitmap.GetSkImage(), 0, 0, samplingOptions, &paint);
     image = SkiaHelper::makeCheckedImageSnapshot(tmpSurface);
     SkiaHelper::addCachedImage(key, image);
     return image;
@@ -1660,10 +1670,11 @@ bool SkiaSalGraphicsImpl::drawAlphaBitmap(const SalTwoRect& rPosAry, const SalBi
     else if (rSkiaAlphaBitmap.IsFullyOpaqueAsAlpha()) // alpha can be ignored
         drawBitmap(rPosAry, rSkiaSourceBitmap);
     else
-        drawShader(rPosAry,
-                   SkShaders::Blend(SkBlendMode::kDstOut, // VCL alpha is one-minus-alpha.
-                                    rSkiaSourceBitmap.GetSkShader(),
-                                    rSkiaAlphaBitmap.GetAlphaSkShader()));
+        drawShader(
+            rPosAry,
+            SkShaders::Blend(SkBlendMode::kDstOut, // VCL alpha is one-minus-alpha.
+                             rSkiaSourceBitmap.GetSkShader(makeSamplingOptions(rPosAry)),
+                             rSkiaAlphaBitmap.GetAlphaSkShader(makeSamplingOptions(rPosAry))));
     return true;
 }
 
@@ -1672,7 +1683,7 @@ void SkiaSalGraphicsImpl::drawBitmap(const SalTwoRect& rPosAry, const SkiaSalBit
 {
     if (bitmap.PreferSkShader())
     {
-        drawShader(rPosAry, bitmap.GetSkShader(), blendMode);
+        drawShader(rPosAry, bitmap.GetSkShader(makeSamplingOptions(rPosAry)), blendMode);
         return;
     }
     // In raster mode use mergeCacheBitmaps(), which will cache the result, avoiding repeated
@@ -1706,14 +1717,14 @@ void SkiaSalGraphicsImpl::drawImage(const SalTwoRect& rPosAry, const sk_sp<SkIma
 
     SkPaint aPaint;
     aPaint.setBlendMode(eBlendMode);
-    if (rPosAry.mnSrcWidth != rPosAry.mnDestWidth || rPosAry.mnSrcHeight != rPosAry.mnDestHeight)
-        aPaint.setFilterQuality(kHigh_SkFilterQuality);
 
     preDraw();
     SAL_INFO("vcl.skia.trace",
              "drawimage(" << this << "): " << rPosAry << ":" << SkBlendMode_Name(eBlendMode));
     addUpdateRegion(aDestinationRect);
-    getDrawCanvas()->drawImageRect(aImage, aSourceRect, aDestinationRect, &aPaint);
+    getDrawCanvas()->drawImageRect(aImage, aSourceRect, aDestinationRect,
+                                   makeSamplingOptions(rPosAry), &aPaint,
+                                   SkCanvas::kFast_SrcRectConstraint);
     ++mPendingOperationsToFlush; // tdf#136369
     postDraw();
 }
@@ -1731,8 +1742,6 @@ void SkiaSalGraphicsImpl::drawShader(const SalTwoRect& rPosAry, const sk_sp<SkSh
     SkPaint paint;
     paint.setBlendMode(blendMode);
     paint.setShader(shader);
-    if (rPosAry.mnSrcWidth != rPosAry.mnDestWidth || rPosAry.mnSrcHeight != rPosAry.mnDestHeight)
-        paint.setFilterQuality(kHigh_SkFilterQuality);
     SkCanvas* canvas = getDrawCanvas();
     // Scaling needs to be done explicitly using a matrix.
     SkAutoCanvasRestore autoRestore(canvas, true);
@@ -1842,15 +1851,16 @@ bool SkiaSalGraphicsImpl::drawTransformedBitmap(const basegfx::B2DPoint& rNull,
         SkCanvas* canvas = getDrawCanvas();
         SkAutoCanvasRestore autoRestore(canvas, true);
         canvas->concat(matrix);
-        SkPaint paint;
+        SkSamplingOptions samplingOptions;
         if (matrixNeedsHighQuality(matrix))
-            paint.setFilterQuality(kHigh_SkFilterQuality);
+            samplingOptions = makeSamplingOptions(BmpScaleFlag::BestQuality);
         if (fAlpha == 1.0)
-            canvas->drawImage(imageToDraw, 0, 0, &paint);
+            canvas->drawImage(imageToDraw, 0, 0, samplingOptions);
         else
         {
+            SkPaint paint;
             paint.setShader(
-                SkShaders::Blend(SkBlendMode::kDstIn, imageToDraw->makeShader(),
+                SkShaders::Blend(SkBlendMode::kDstIn, imageToDraw->makeShader(samplingOptions),
                                  SkShaders::Color(SkColorSetARGB(fAlpha * 255, 0, 0, 0))));
             canvas->drawRect(SkRect::MakeWH(imageToDraw->width(), imageToDraw->height()), paint);
         }
@@ -1868,14 +1878,15 @@ bool SkiaSalGraphicsImpl::drawTransformedBitmap(const basegfx::B2DPoint& rNull,
         SkCanvas* canvas = getDrawCanvas();
         SkAutoCanvasRestore autoRestore(canvas, true);
         canvas->concat(matrix);
-        SkPaint paint;
+        SkSamplingOptions samplingOptions;
         if (matrixNeedsHighQuality(matrix))
-            paint.setFilterQuality(kHigh_SkFilterQuality);
+            samplingOptions = makeSamplingOptions(BmpScaleFlag::BestQuality);
         if (pSkiaAlphaBitmap)
         {
+            SkPaint paint;
             paint.setShader(SkShaders::Blend(SkBlendMode::kDstOut, // VCL alpha is one-minus-alpha.
-                                             rSkiaBitmap.GetSkShader(),
-                                             pSkiaAlphaBitmap->GetAlphaSkShader()));
+                                             rSkiaBitmap.GetSkShader(samplingOptions),
+                                             pSkiaAlphaBitmap->GetAlphaSkShader(samplingOptions)));
             if (fAlpha != 1.0)
                 paint.setShader(
                     SkShaders::Blend(SkBlendMode::kDstIn, paint.refShader(),
@@ -1884,7 +1895,8 @@ bool SkiaSalGraphicsImpl::drawTransformedBitmap(const basegfx::B2DPoint& rNull,
         }
         else if (rSkiaBitmap.PreferSkShader() || fAlpha != 1.0)
         {
-            paint.setShader(rSkiaBitmap.GetSkShader());
+            SkPaint paint;
+            paint.setShader(rSkiaBitmap.GetSkShader(samplingOptions));
             if (fAlpha != 1.0)
                 paint.setShader(
                     SkShaders::Blend(SkBlendMode::kDstIn, paint.refShader(),
@@ -1893,7 +1905,7 @@ bool SkiaSalGraphicsImpl::drawTransformedBitmap(const basegfx::B2DPoint& rNull,
         }
         else
         {
-            canvas->drawImage(rSkiaBitmap.GetSkImage(), 0, 0, &paint);
+            canvas->drawImage(rSkiaBitmap.GetSkImage(), 0, 0, samplingOptions);
         }
     }
     postDraw();
diff --git a/vcl/skia/salbmp.cxx b/vcl/skia/salbmp.cxx
index 5d56abecbe79..1e15c04f8c76 100644
--- a/vcl/skia/salbmp.cxx
+++ b/vcl/skia/salbmp.cxx
@@ -47,6 +47,8 @@
 #define CANARY "skia-canary"
 #endif
 
+using namespace SkiaHelper;
+
 // As constexpr here, evaluating it directly in code makes Clang warn about unreachable code.
 constexpr bool kN32_SkColorTypeIsBGRA = (kN32_SkColorType == kBGRA_8888_SkColorType);
 
@@ -328,6 +330,15 @@ bool SkiaSalBitmap::Scale(const double& rScaleX, const double& rScaleY, BmpScale
         return true;
     }
 
+    if (mBitCount < 24 && !mPalette.IsGreyPalette8Bit())
+    {
+        // Scaling can introduce additional colors not present in the original
+        // bitmap (e.g. when smoothing). If the bitmap is indexed (has non-trivial palette),
+        // this would break the bitmap, because the actual scaling is done only somewhen later.
+        // Linear 8bit palette (grey) is ok, since there we use directly the values as colors.
+        SAL_INFO("vcl.skia.trace", "scale(" << this << "): indexed bitmap");
+        return false;
+    }
     // The idea here is that the actual scaling will be delayed until the result
     // is actually needed. Usually the scaled bitmap will be drawn somewhere,
     // so delaying will mean the scaling can be done as a part of GetSkImage().
@@ -335,34 +346,24 @@ bool SkiaSalBitmap::Scale(const double& rScaleX, const double& rScaleY, BmpScale
     // to be either done by CPU, or with the CPU->GPU->CPU roundtrip required
     // by GPU-accelerated scaling.
     // Pending scaling is detected by 'mSize != mPixelsSize'.
-    SkFilterQuality currentQuality;
+
+    // If there is already one scale() pending, use the lowest quality of all requested.
     switch (nScaleFlag)
     {
         case BmpScaleFlag::Fast:
-            currentQuality = kNone_SkFilterQuality;
+            mScaleQuality = nScaleFlag;
             break;
         case BmpScaleFlag::Default:
-            currentQuality = kMedium_SkFilterQuality;
+            if (mScaleQuality == BmpScaleFlag::BestQuality)
+                mScaleQuality = nScaleFlag;
             break;
         case BmpScaleFlag::BestQuality:
-            currentQuality = kHigh_SkFilterQuality;
+            // Best is the maximum, set by default.
             break;
         default:
             SAL_INFO("vcl.skia.trace", "scale(" << this << "): unsupported scale algorithm");
             return false;
     }
-    if (mBitCount < 24 && !mPalette.IsGreyPalette8Bit())
-    {
-        // Scaling can introduce additional colors not present in the original
-        // bitmap (e.g. when smoothing). If the bitmap is indexed (has non-trivial palette),
-        // this would break the bitmap, because the actual scaling is done only somewhen later.
-        // Linear 8bit palette (grey) is ok, since there we use directly the values as colors.
-        SAL_INFO("vcl.skia.trace", "scale(" << this << "): indexed bitmap");
-        return false;
-    }
-    // if there is already one scale() pending, use the lowest quality of all requested
-    static_assert(kMedium_SkFilterQuality < kHigh_SkFilterQuality);
-    mScaleQuality = std::min(mScaleQuality, currentQuality);
     // scaling will be actually done on-demand when needed, the need will be recognized
     // by mSize != mPixelsSize
     mSize = newSize;
@@ -409,7 +410,7 @@ bool SkiaSalBitmap::ConvertToGreyscale()
                                        77 / 256.0, 151 / 256.0, 28 / 256.0, 0, 0, // B column
                                        0, 0, 0, 1, 0); // don't modify alpha
         paint.setColorFilter(SkColorFilters::Matrix(toGray));
-        surface->getCanvas()->drawImage(mImage, 0, 0, &paint);
+        surface->getCanvas()->drawImage(mImage, 0, 0, SkSamplingOptions(), &paint);
         mBitCount = 8;
         ComputeScanlineSize();
         mPalette = Bitmap::GetGreyPalette(256);
@@ -519,9 +520,9 @@ bool SkiaSalBitmap::AlphaBlendWith(const SalBitmap& rSalBmp)
     sk_sp<SkSurface> surface = SkiaHelper::createSkSurface(mSize);
     SkPaint paint;
     paint.setBlendMode(SkBlendMode::kSrc); // set as is
-    surface->getCanvas()->drawImage(GetSkImage(), 0, 0, &paint);
+    surface->getCanvas()->drawImage(GetSkImage(), 0, 0, SkSamplingOptions(), &paint);
     paint.setBlendMode(SkBlendMode::kScreen); // src+dest - src*dest/255 (in 0..1)
-    surface->getCanvas()->drawImage(otherBitmap->GetSkImage(), 0, 0, &paint);
+    surface->getCanvas()->drawImage(otherBitmap->GetSkImage(), 0, 0, SkSamplingOptions(), &paint);
     ResetToSkImage(SkiaHelper::makeCheckedImageSnapshot(surface));
     SAL_INFO("vcl.skia.trace", "alphablendwith(" << this << ") : with image " << otherBitmap);
     return true;
@@ -550,7 +551,6 @@ SkBitmap SkiaSalBitmap::GetAsSkBitmap() const
                     data.release(), mScanlineSize,
                     [](void* addr, void*) { delete[] static_cast<sal_uInt8*>(addr); }, nullptr))
                 abort();
-            bitmap.setImmutable();
         }
         else if (mBitCount == 24)
         {
@@ -577,7 +577,6 @@ SkBitmap SkiaSalBitmap::GetAsSkBitmap() const
                     data.release(), mPixelsSize.Width() * 4,
                     [](void* addr, void*) { delete[] static_cast<sal_uInt8*>(addr); }, nullptr))
                 abort();
-            bitmap.setImmutable();
         }
         else if (mBitCount == 8 && mPalette.IsGreyPalette8Bit())
         {
@@ -606,7 +605,6 @@ SkBitmap SkiaSalBitmap::GetAsSkBitmap() const
                     data.release(), mPixelsSize.Width() * 4,
                     [](void* addr, void*) { delete[] static_cast<sal_uInt8*>(addr); }, nullptr))
                 abort();
-            bitmap.setImmutable();
         }
         else
         {
@@ -619,9 +617,9 @@ SkBitmap SkiaSalBitmap::GetAsSkBitmap() const
                     data.release(), mPixelsSize.Width() * 4,
                     [](void* addr, void*) { delete[] static_cast<sal_uInt8*>(addr); }, nullptr))
                 abort();
-            bitmap.setImmutable();
         }
     }
+    bitmap.setImmutable();
     return bitmap;
 }
 
@@ -709,10 +707,9 @@ const sk_sp<SkImage>& SkiaSalBitmap::GetSkImage() const
             assert(surface);
             SkPaint paint;
             paint.setBlendMode(SkBlendMode::kSrc); // set as is, including alpha
-            paint.setFilterQuality(mScaleQuality);
-            surface->getCanvas()->drawImageRect(
-                mImage, SkRect::MakeWH(mImage->width(), mImage->height()),
-                SkRect::MakeWH(mSize.Width(), mSize.Height()), &paint);
+            surface->getCanvas()->drawImageRect(mImage,
+                                                SkRect::MakeWH(mSize.Width(), mSize.Height()),
+                                                makeSamplingOptions(mScaleQuality), &paint);
             SAL_INFO("vcl.skia.trace", "getskimage(" << this << "): image scaled "
                                                      << Size(mImage->width(), mImage->height())
                                                      << "->" << mSize << ":"
@@ -813,16 +810,13 @@ const sk_sp<SkImage>& SkiaSalBitmap::GetAlphaSkImage() const
         SkPaint paint;
         paint.setColorFilter(SkColorFilters::Matrix(redToAlpha));
         if (scaling)
-        {
             assert(!mBuffer); // This code should be only called if only mImage holds data.
-            paint.setFilterQuality(mScaleQuality);
-        }
         sk_sp<SkSurface> surface = SkiaHelper::createSkSurface(mSize, kAlpha_8_SkColorType);
         assert(surface);
         paint.setBlendMode(SkBlendMode::kSrc); // set as is, including alpha
-        surface->getCanvas()->drawImageRect(mImage,
-                                            SkRect::MakeWH(mImage->width(), mImage->height()),
-                                            SkRect::MakeWH(mSize.Width(), mSize.Height()), &paint);
+        surface->getCanvas()->drawImageRect(
+            mImage, SkRect::MakeWH(mSize.Width(), mSize.Height()),
+            scaling ? makeSamplingOptions(mScaleQuality) : SkSamplingOptions(), &paint);
         if (scaling)
             SAL_INFO("vcl.skia.trace", "getalphaskimage(" << this << "): image scaled "
                                                           << Size(mImage->width(), mImage->height())
@@ -871,7 +865,8 @@ const sk_sp<SkImage>& SkiaSalBitmap::GetAlphaSkImage() const
                                            0, 0, 0, 0, 0, // B column
                                            1, 0, 0, 0, 0); // A column
         paint.setColorFilter(SkColorFilters::Matrix(redToAlpha));
-        surface->getCanvas()->drawBitmap(GetAsSkBitmap(), 0, 0, &paint);
+        surface->getCanvas()->drawImage(GetAsSkBitmap().asImage(), 0, 0, SkSamplingOptions(),
+                                        &paint);
         SkiaSalBitmap* thisPtr = const_cast<SkiaSalBitmap*>(this);
         thisPtr->mAlphaImage = SkiaHelper::makeCheckedImageSnapshot(surface);
     }
@@ -892,18 +887,18 @@ const sk_sp<SkImage>& SkiaSalBitmap::GetAlphaSkImage() const
 // than creating an image filled with the color.
 bool SkiaSalBitmap::PreferSkShader() const { return mEraseColorSet; }
 
-sk_sp<SkShader> SkiaSalBitmap::GetSkShader() const
+sk_sp<SkShader> SkiaSalBitmap::GetSkShader(const SkSamplingOptions& samplingOptions) const
 {
     if (mEraseColorSet)
         return SkShaders::Color(toSkColor(mEraseColor));
-    return GetSkImage()->makeShader();
+    return GetSkImage()->makeShader(samplingOptions);
 }
 
-sk_sp<SkShader> SkiaSalBitmap::GetAlphaSkShader() const
+sk_sp<SkShader> SkiaSalBitmap::GetAlphaSkShader(const SkSamplingOptions& samplingOptions) const
 {
     if (mEraseColorSet)
         return SkShaders::Color(fromEraseColorToAlphaImageColor(mEraseColor));
-    return GetAlphaSkImage()->makeShader();
+    return GetAlphaSkImage()->makeShader(samplingOptions);
 }
 
 bool SkiaSalBitmap::IsFullyOpaqueAsAlpha() const
@@ -966,7 +961,7 @@ void SkiaSalBitmap::EnsureBitmapData()
             ComputeScanlineSize();
             mBuffer.reset();
         }
-        mScaleQuality = kHigh_SkFilterQuality;
+        mScaleQuality = BmpScaleFlag::BestQuality;
         if (!mBuffer)
             CreateBitmapData();
         // Unset now, so that repeated call will return mBuffer.
@@ -1005,7 +1000,7 @@ void SkiaSalBitmap::EnsureBitmapData()
         SkCanvas canvas(bitmap);
         SkPaint paint;
         paint.setBlendMode(SkBlendMode::kSrc); // set as is, including alpha
-        canvas.drawImage(mAlphaImage, 0, 0, &paint);
+        canvas.drawImage(mAlphaImage, 0, 0, SkSamplingOptions(), &paint);
         canvas.flush();
         bitmap.setImmutable();
         CreateBitmapData();
@@ -1064,22 +1059,22 @@ void SkiaSalBitmap::EnsureBitmapData()
     paint.setBlendMode(SkBlendMode::kSrc); // set as is, including alpha
     if (mSize != mPixelsSize) // pending scaling?
     {
-        paint.setFilterQuality(mScaleQuality);
-        canvas.drawImageRect(mImage,
-                             SkRect::MakeWH(mPixelsSize.getWidth(), mPixelsSize.getHeight()),
-                             SkRect::MakeWH(mSize.getWidth(), mSize.getHeight()), &paint);
+        assert(mImage->width() == mPixelsSize.getWidth()
+               && mImage->height() == mPixelsSize.getHeight());
+        canvas.drawImageRect(mImage, SkRect::MakeWH(mSize.getWidth(), mSize.getHeight()),
+                             makeSamplingOptions(mScaleQuality), &paint);
         SAL_INFO("vcl.skia.trace", "ensurebitmapdata(" << this << "): image scaled " << mPixelsSize
                                                        << "->" << mSize << ":"
                                                        << static_cast<int>(mScaleQuality));
         mPixelsSize = mSize;
         ComputeScanlineSize();
-        mScaleQuality = kHigh_SkFilterQuality;
+        mScaleQuality = BmpScaleFlag::BestQuality;
         // Information about the pending scaling has been discarded, so make sure we do not
         // keep around any cached images that would still need scaling.
         ResetCachedDataBySize();
     }
     else
-        canvas.drawImage(mImage, 0, 0, &paint);
+        canvas.drawImage(mImage, 0, 0, SkSamplingOptions(), &paint);
     canvas.flush();
     bitmap.setImmutable();
     CreateBitmapData();
diff --git a/vcl/skia/win/gdiimpl.cxx b/vcl/skia/win/gdiimpl.cxx
index d296747936f5..242ff5891393 100644
--- a/vcl/skia/win/gdiimpl.cxx
+++ b/vcl/skia/win/gdiimpl.cxx
@@ -323,7 +323,7 @@ sk_sp<SkImage> SkiaCompatibleDC::getAsImageDiff(const SkiaCompatibleDC& white) c
     matrix.preTranslate(0, tmpBitmap.height());
     matrix.setConcat(matrix, SkMatrix::Scale(1, -1));
     canvas->concat(matrix);
-    canvas->drawBitmap(tmpBitmap, 0, 0, &paint);
+    canvas->drawImage(tmpBitmap.asImage(), 0, 0, SkSamplingOptions(), &paint);
     canvas->restore();
     return SkiaHelper::makeCheckedImageSnapshot(surface);
 }
diff --git a/vcl/skia/zone.cxx b/vcl/skia/zone.cxx
index 34e3f80f8b78..798e6de46d45 100644
--- a/vcl/skia/zone.cxx
+++ b/vcl/skia/zone.cxx
@@ -20,6 +20,8 @@
 
 #include <config_skia.h>
 
+using namespace SkiaHelper;
+
 /**
  * Called from a signal handler or watchdog thread if we get
  * a crash or hang in some driver.


More information about the Libreoffice-commits mailing list