summaryrefslogtreecommitdiffstats
path: root/external/skia
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2020-06-30 17:58:12 +0200
committerLuboš Luňák <l.lunak@collabora.com>2020-07-01 11:35:08 +0200
commit3dfc6d42edfd469436ad177ad1ebc5526679aa99 (patch)
treea879d9a9156c78ea119d6d56133c2c5b292ddfd3 /external/skia
parentUpcoming improved loplugin:staticanonymous -> redundantstatic: io (diff)
downloadcore-3dfc6d42edfd469436ad177ad1ebc5526679aa99.tar.gz
core-3dfc6d42edfd469436ad177ad1ebc5526679aa99.zip
update Skia to chrome/m85 snapshot
Change-Id: I3af3517c9c213e0db8365aecd0a008d817ca4dcf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97592 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'external/skia')
-rw-r--r--external/skia/Library_skia.mk17
-rw-r--r--external/skia/UnpackedTarball_skia.mk4
-rw-r--r--external/skia/c++20.patch.010
-rw-r--r--external/skia/inc/pch/precompiled_skia.hxx32
-rw-r--r--external/skia/make-api-visible.patch.111
-rw-r--r--external/skia/operator-eq-bool.patch.021
-rw-r--r--external/skia/operator-eq-bool.patch.125
-rw-r--r--external/skia/public-make-from-backend-texture.patch.144
-rw-r--r--external/skia/share-grcontext.patch.137
9 files changed, 133 insertions, 68 deletions
diff --git a/external/skia/Library_skia.mk b/external/skia/Library_skia.mk
index 47140da4e50e..1cd4adac9f79 100644
--- a/external/skia/Library_skia.mk
+++ b/external/skia/Library_skia.mk
@@ -204,6 +204,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
UnpackedTarball/skia/src/core/SkImageInfo \
UnpackedTarball/skia/src/core/SkLatticeIter \
UnpackedTarball/skia/src/core/SkLineClipper \
+ UnpackedTarball/skia/src/core/SkLegacyGpuBlurUtils \
UnpackedTarball/skia/src/core/SkLocalMatrixImageFilter \
UnpackedTarball/skia/src/core/SkMalloc \
UnpackedTarball/skia/src/core/SkMallocPixelRef \
@@ -227,6 +228,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
UnpackedTarball/skia/src/core/SkPaint \
UnpackedTarball/skia/src/core/SkPaintPriv \
UnpackedTarball/skia/src/core/SkPath \
+ UnpackedTarball/skia/src/core/SkPathBuilder \
UnpackedTarball/skia/src/core/SkPathEffect \
UnpackedTarball/skia/src/core/SkPathMeasure \
UnpackedTarball/skia/src/core/SkPathRef \
@@ -515,10 +517,8 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
UnpackedTarball/skia/src/gpu/effects/generated/GrHSLToRGBFilterEffect \
UnpackedTarball/skia/src/gpu/effects/generated/GrLumaColorFilterEffect \
UnpackedTarball/skia/src/gpu/effects/generated/GrMagnifierEffect \
- UnpackedTarball/skia/src/gpu/effects/generated/GrMatrixEffect \
UnpackedTarball/skia/src/gpu/effects/generated/GrMixerEffect \
UnpackedTarball/skia/src/gpu/effects/generated/GrOverrideInputFragmentProcessor \
- UnpackedTarball/skia/src/gpu/effects/generated/GrPremulInputFragmentProcessor \
UnpackedTarball/skia/src/gpu/effects/generated/GrRectBlurEffect \
UnpackedTarball/skia/src/gpu/effects/generated/GrRGBToHSLFilterEffect \
UnpackedTarball/skia/src/gpu/effects/generated/GrRRectBlurEffect \
@@ -532,6 +532,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
UnpackedTarball/skia/src/gpu/effects/GrDistanceFieldGeoProc \
UnpackedTarball/skia/src/gpu/effects/GrGaussianConvolutionFragmentProcessor \
UnpackedTarball/skia/src/gpu/effects/GrMatrixConvolutionEffect \
+ UnpackedTarball/skia/src/gpu/effects/GrMatrixEffect \
UnpackedTarball/skia/src/gpu/effects/GrOvalEffect \
UnpackedTarball/skia/src/gpu/effects/GrPorterDuffXferProcessor \
UnpackedTarball/skia/src/gpu/effects/GrRRectEffect \
@@ -629,6 +630,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
UnpackedTarball/skia/src/gpu/GrProgramInfo \
UnpackedTarball/skia/src/gpu/GrProxyProvider \
UnpackedTarball/skia/src/gpu/GrRecordingContext \
+ UnpackedTarball/skia/src/gpu/GrRectanizerPow2 \
UnpackedTarball/skia/src/gpu/GrRectanizerSkyline \
UnpackedTarball/skia/src/gpu/GrRenderTask \
UnpackedTarball/skia/src/gpu/GrReducedClip \
@@ -638,6 +640,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
UnpackedTarball/skia/src/gpu/GrResourceAllocator \
UnpackedTarball/skia/src/gpu/GrResourceCache \
UnpackedTarball/skia/src/gpu/GrResourceProvider \
+ UnpackedTarball/skia/src/gpu/GrRingBuffer \
UnpackedTarball/skia/src/gpu/GrSamplePatternDictionary \
UnpackedTarball/skia/src/gpu/GrShaderCaps \
UnpackedTarball/skia/src/gpu/GrShaderUtils \
@@ -657,6 +660,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
UnpackedTarball/skia/src/gpu/GrSWMaskHelper \
UnpackedTarball/skia/src/gpu/GrTestUtils \
UnpackedTarball/skia/src/gpu/GrTriangulator \
+ UnpackedTarball/skia/src/gpu/GrUniformDataManager \
UnpackedTarball/skia/src/gpu/GrTextureAdjuster \
UnpackedTarball/skia/src/gpu/GrTexture \
UnpackedTarball/skia/src/gpu/GrTextureMaker \
@@ -677,7 +681,6 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
UnpackedTarball/skia/src/gpu/ops/GrAALinearizingConvexPathRenderer \
UnpackedTarball/skia/src/gpu/ops/GrAtlasTextOp \
UnpackedTarball/skia/src/gpu/ops/GrClearOp \
- UnpackedTarball/skia/src/gpu/ops/GrClearStencilClipOp \
UnpackedTarball/skia/src/gpu/ops/GrDashLinePathRenderer \
UnpackedTarball/skia/src/gpu/ops/GrDashOp \
UnpackedTarball/skia/src/gpu/ops/GrDefaultPathRenderer \
@@ -708,15 +711,16 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
UnpackedTarball/skia/src/gpu/tessellate/GrDrawAtlasPathOp \
UnpackedTarball/skia/src/gpu/tessellate/GrFillPathShader \
UnpackedTarball/skia/src/gpu/tessellate/GrStencilPathShader \
+ UnpackedTarball/skia/src/gpu/tessellate/GrStrokeGeometry \
UnpackedTarball/skia/src/gpu/tessellate/GrTessellatePathOp \
UnpackedTarball/skia/src/gpu/tessellate/GrTessellationPathRenderer \
UnpackedTarball/skia/src/gpu/text/GrAtlasManager \
UnpackedTarball/skia/src/gpu/text/GrDistanceFieldAdjustTable \
UnpackedTarball/skia/src/gpu/text/GrSDFMaskFilter \
+ UnpackedTarball/skia/src/gpu/text/GrSDFTOptions \
UnpackedTarball/skia/src/gpu/text/GrStrikeCache \
UnpackedTarball/skia/src/gpu/text/GrTextBlobCache \
UnpackedTarball/skia/src/gpu/text/GrTextBlob \
- UnpackedTarball/skia/src/gpu/text/GrTextContext \
UnpackedTarball/skia/src/image/SkImage_GpuBase \
UnpackedTarball/skia/src/image/SkImage_Gpu \
UnpackedTarball/skia/src/image/SkImage_GpuYUVA \
@@ -788,11 +792,8 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
UnpackedTarball/skia/src/opts/SkOpts_crc32 \
))
-# This one needs to #define some things before #include <immintrin.h>, but the header would get introduced
-# already by the PCH. Add a dummy flag to avoid PCH use.
$(eval $(call gb_Library_add_generated_exception_objects,skia,\
- UnpackedTarball/skia/src/core/SkOpts_skx, \
- -DDUMMY_AVOID_PCH=1 \
+ UnpackedTarball/skia/src/opts/SkOpts_skx, $(CXXFLAGS_INTRINSICS_AVX512) $(CLANG_CXXFLAGS_INTRINSICS_AVX512)\
))
$(eval $(call gb_Library_add_generated_exception_objects,skia,\
diff --git a/external/skia/UnpackedTarball_skia.mk b/external/skia/UnpackedTarball_skia.mk
index 20b81c35ce39..5caeff270e0c 100644
--- a/external/skia/UnpackedTarball_skia.mk
+++ b/external/skia/UnpackedTarball_skia.mk
@@ -32,13 +32,13 @@ skia_patches := \
windows-do-not-modify-logfont.patch.0 \
windows-text-gamma.patch.0 \
windows-force-unicode-api.patch.0 \
- operator-eq-bool.patch.0 \
+ operator-eq-bool.patch.1 \
fix-without-gl.patch.0 \
extend-rgb-to-rgba.patch.0 \
windows-typeface-directwrite.patch.0 \
windows-raster-surface-no-copies.patch.1 \
fix-windows-dwrite.patch.1 \
- c++20.patch.0 \
+ public-make-from-backend-texture.patch.1 \
$(eval $(call gb_UnpackedTarball_set_patchlevel,skia,1))
diff --git a/external/skia/c++20.patch.0 b/external/skia/c++20.patch.0
deleted file mode 100644
index 167c8d89c92d..000000000000
--- a/external/skia/c++20.patch.0
+++ /dev/null
@@ -1,10 +0,0 @@
---- src/core/SkVM.h
-+++ src/core/SkVM.h
-@@ -909,6 +909,7 @@
- static inline F32 max(float x, F32 y) { return y->max(x,y); }
-
- static inline I32 operator==(F32 x, F32a y) { return x->eq(x,y); }
-+ static inline I32 operator==(F32 x, float y) { return x->eq(x,y); }
- static inline I32 operator==(float x, F32 y) { return y->eq(x,y); }
- static inline I32 eq_op(float x, F32 y) { return y->eq(x,y); }
-
diff --git a/external/skia/inc/pch/precompiled_skia.hxx b/external/skia/inc/pch/precompiled_skia.hxx
index e3d41a03f41a..a28dd583e72a 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-05-18 11:43:55 using:
+ Generated on 2020-06-30 17:38:10 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:
@@ -70,7 +70,7 @@
#include <rtl/alloc.h>
#include <sal/log.hxx>
#endif // PCH_LEVEL >= 2
-#if PCH_LEVEL >= 3
+// PCH_LEVEL >= 3
#include <include/c/sk_canvas.h>
#include <include/c/sk_colorspace.h>
#include <include/c/sk_data.h>
@@ -125,6 +125,7 @@
#include <include/core/SkOverdrawCanvas.h>
#include <include/core/SkPaint.h>
#include <include/core/SkPath.h>
+#include <include/core/SkPathBuilder.h>
#include <include/core/SkPathEffect.h>
#include <include/core/SkPathMeasure.h>
#include <include/core/SkPicture.h>
@@ -150,6 +151,7 @@
#include <include/core/SkStrokeRec.h>
#include <include/core/SkSurface.h>
#include <include/core/SkSurfaceCharacterization.h>
+#include <include/core/SkSurfaceProps.h>
#include <include/core/SkSwizzle.h>
#include <include/core/SkTextBlob.h>
#include <include/core/SkTileMode.h>
@@ -195,6 +197,7 @@
#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>
@@ -320,6 +323,7 @@
#include <src/core/SkClipOpPriv.h>
#include <src/core/SkClipStack.h>
#include <src/core/SkClipStackDevice.h>
+#include <src/core/SkColorFilterBase.h>
#include <src/core/SkColorFilterPriv.h>
#include <src/core/SkColorFilter_Matrix.h>
#include <src/core/SkColorSpacePriv.h>
@@ -330,6 +334,7 @@
#include <src/core/SkCoverageModePriv.h>
#include <src/core/SkCpu.h>
#include <src/core/SkCubicClipper.h>
+#include <src/core/SkDeferredDisplayListPriv.h>
#include <src/core/SkDescriptor.h>
#include <src/core/SkDevice.h>
#include <src/core/SkDiscardableMemory.h>
@@ -407,7 +412,6 @@
#include <src/core/SkRasterClip.h>
#include <src/core/SkRasterPipeline.h>
#include <src/core/SkReadBuffer.h>
-#include <src/core/SkReader32.h>
#include <src/core/SkRecord.h>
#include <src/core/SkRecordDraw.h>
#include <src/core/SkRecordOpts.h>
@@ -480,7 +484,9 @@
#include <src/gpu/GrAppliedClip.h>
#include <src/gpu/GrAuditTrail.h>
#include <src/gpu/GrAutoLocaleSetter.h>
+#include <src/gpu/GrBackendSurfaceMutableStateImpl.h>
#include <src/gpu/GrBackendTextureImageGenerator.h>
+#include <src/gpu/GrBackendUtils.h>
#include <src/gpu/GrBaseContextPriv.h>
#include <src/gpu/GrBitmapTextureMaker.h>
#include <src/gpu/GrBlend.h>
@@ -547,6 +553,7 @@
#include <src/gpu/GrProgramInfo.h>
#include <src/gpu/GrProxyProvider.h>
#include <src/gpu/GrRecordingContextPriv.h>
+#include <src/gpu/GrRectanizerPow2.h>
#include <src/gpu/GrRectanizerSkyline.h>
#include <src/gpu/GrReducedClip.h>
#include <src/gpu/GrRenderTarget.h>
@@ -560,11 +567,13 @@
#include <src/gpu/GrResourceCache.h>
#include <src/gpu/GrResourceProvider.h>
#include <src/gpu/GrResourceProviderPriv.h>
+#include <src/gpu/GrRingBuffer.h>
#include <src/gpu/GrSPIRVUniformHandler.h>
#include <src/gpu/GrSPIRVVaryingHandler.h>
#include <src/gpu/GrSWMaskHelper.h>
#include <src/gpu/GrSamplePatternDictionary.h>
#include <src/gpu/GrSamplerState.h>
+#include <src/gpu/GrScissorState.h>
#include <src/gpu/GrSemaphore.h>
#include <src/gpu/GrShaderCaps.h>
#include <src/gpu/GrShaderUtils.h>
@@ -599,6 +608,7 @@
#include <src/gpu/GrTracing.h>
#include <src/gpu/GrTransferFromRenderTask.h>
#include <src/gpu/GrTriangulator.h>
+#include <src/gpu/GrUniformDataManager.h>
#include <src/gpu/GrUserStencilSettings.h>
#include <src/gpu/GrVertexWriter.h>
#include <src/gpu/GrWaitRenderTask.h>
@@ -641,6 +651,7 @@
#include <src/gpu/effects/GrDistanceFieldGeoProc.h>
#include <src/gpu/effects/GrGaussianConvolutionFragmentProcessor.h>
#include <src/gpu/effects/GrMatrixConvolutionEffect.h>
+#include <src/gpu/effects/GrMatrixEffect.h>
#include <src/gpu/effects/GrOvalEffect.h>
#include <src/gpu/effects/GrPorterDuffXferProcessor.h>
#include <src/gpu/effects/GrRRectEffect.h>
@@ -664,10 +675,8 @@
#include <src/gpu/effects/generated/GrHSLToRGBFilterEffect.h>
#include <src/gpu/effects/generated/GrLumaColorFilterEffect.h>
#include <src/gpu/effects/generated/GrMagnifierEffect.h>
-#include <src/gpu/effects/generated/GrMatrixEffect.h>
#include <src/gpu/effects/generated/GrMixerEffect.h>
#include <src/gpu/effects/generated/GrOverrideInputFragmentProcessor.h>
-#include <src/gpu/effects/generated/GrPremulInputFragmentProcessor.h>
#include <src/gpu/effects/generated/GrRGBToHSLFilterEffect.h>
#include <src/gpu/effects/generated/GrRRectBlurEffect.h>
#include <src/gpu/effects/generated/GrRectBlurEffect.h>
@@ -719,7 +728,6 @@
#include <src/gpu/ops/GrAALinearizingConvexPathRenderer.h>
#include <src/gpu/ops/GrAtlasTextOp.h>
#include <src/gpu/ops/GrClearOp.h>
-#include <src/gpu/ops/GrClearStencilClipOp.h>
#include <src/gpu/ops/GrDashLinePathRenderer.h>
#include <src/gpu/ops/GrDashOp.h>
#include <src/gpu/ops/GrDefaultPathRenderer.h>
@@ -749,16 +757,19 @@
#include <src/gpu/tessellate/GrFillPathShader.h>
#include <src/gpu/tessellate/GrMiddleOutPolygonTriangulator.h>
#include <src/gpu/tessellate/GrMidpointContourParser.h>
+#include <src/gpu/tessellate/GrResolveLevelCounter.h>
#include <src/gpu/tessellate/GrStencilPathShader.h>
+#include <src/gpu/tessellate/GrStrokeGeometry.h>
#include <src/gpu/tessellate/GrTessellatePathOp.h>
#include <src/gpu/tessellate/GrTessellationPathRenderer.h>
+#include <src/gpu/tessellate/GrWangsFormula.h>
#include <src/gpu/text/GrAtlasManager.h>
#include <src/gpu/text/GrDistanceFieldAdjustTable.h>
#include <src/gpu/text/GrSDFMaskFilter.h>
+#include <src/gpu/text/GrSDFTOptions.h>
#include <src/gpu/text/GrStrikeCache.h>
#include <src/gpu/text/GrTextBlob.h>
#include <src/gpu/text/GrTextBlobCache.h>
-#include <src/gpu/text/GrTextContext.h>
#include <src/gpu/text/GrTextTarget.h>
#include <src/gpu/vk/GrVkBuffer.h>
#include <src/gpu/vk/GrVkCaps.h>
@@ -907,6 +918,7 @@
#include <src/sksl/ir/SkSLNullLiteral.h>
#include <src/sksl/ir/SkSLPostfixExpression.h>
#include <src/sksl/ir/SkSLPrefixExpression.h>
+#include <src/sksl/ir/SkSLProgram.h>
#include <src/sksl/ir/SkSLReturnStatement.h>
#include <src/sksl/ir/SkSLSection.h>
#include <src/sksl/ir/SkSLSetting.h>
@@ -941,8 +953,8 @@
#include <tools/gpu/vk/VkTestUtils.h>
#include <tools/sk_app/VulkanWindowContext.h>
#include <vulkan/vulkan_core.h>
-#endif // PCH_LEVEL >= 3
-#if PCH_LEVEL >= 4
-#endif // PCH_LEVEL >= 4
+#include <skia_compiler.hxx>
+// PCH_LEVEL >= 4
+// PCH_LEVEL >= 5
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/external/skia/make-api-visible.patch.1 b/external/skia/make-api-visible.patch.1
index 2bf3a0f3d73a..bb574b762f5b 100644
--- a/external/skia/make-api-visible.patch.1
+++ b/external/skia/make-api-visible.patch.1
@@ -1,5 +1,5 @@
diff --git a/tools/sk_app/unix/WindowContextFactory_unix.h b/tools/sk_app/unix/WindowContextFactory_unix.h
-index 47310970d5..e02e6eb5b7 100644
+index 11bd2d2ac2..09c92dc417 100644
--- a/tools/sk_app/unix/WindowContextFactory_unix.h
+++ b/tools/sk_app/unix/WindowContextFactory_unix.h
@@ -36,15 +36,15 @@ struct XlibWindowInfo {
@@ -23,10 +23,10 @@ index 47310970d5..e02e6eb5b7 100644
} // namespace window_context_factory
diff --git a/tools/sk_app/win/WindowContextFactory_win.h b/tools/sk_app/win/WindowContextFactory_win.h
-index 33dd6d413b..647e5ff81a 100644
+index c05a4f0acf..fc27cd2afb 100644
--- a/tools/sk_app/win/WindowContextFactory_win.h
+++ b/tools/sk_app/win/WindowContextFactory_win.h
-@@ -20,17 +20,17 @@ struct DisplayParams;
+@@ -20,21 +20,21 @@ struct DisplayParams;
namespace window_context_factory {
@@ -39,6 +39,11 @@ index 33dd6d413b..647e5ff81a 100644
-std::unique_ptr<WindowContext> MakeANGLEForWin(HWND, const DisplayParams&);
+SK_API std::unique_ptr<WindowContext> MakeANGLEForWin(HWND, const DisplayParams&);
+ #ifdef SK_DIRECT3D
+-std::unique_ptr<WindowContext> MakeD3D12ForWin(HWND, const DisplayParams&);
++SK_API std::unique_ptr<WindowContext> MakeD3D12ForWin(HWND, const DisplayParams&);
+ #endif
+
#ifdef SK_DAWN
-std::unique_ptr<WindowContext> MakeDawnD3D12ForWin(HWND, const DisplayParams&);
+SK_API std::unique_ptr<WindowContext> MakeDawnD3D12ForWin(HWND, const DisplayParams&);
diff --git a/external/skia/operator-eq-bool.patch.0 b/external/skia/operator-eq-bool.patch.0
deleted file mode 100644
index 1c2c77beb96f..000000000000
--- a/external/skia/operator-eq-bool.patch.0
+++ /dev/null
@@ -1,21 +0,0 @@
---- ./src/core/SkVM.cpp.sav 2020-04-06 12:42:22.976205876 +0200
-+++ ./src/core/SkVM.cpp 2020-04-06 12:50:57.465941063 +0200
-@@ -1162,7 +1162,7 @@ namespace skvm {
- // Map min channel to 0, max channel to s, and scale the middle proportionally.
- auto scale = [&](auto c) {
- // TODO: better to divide and check for non-finite result?
-- return select(sat == 0.0f, 0.0f
-+ return select(eq_op(0.0f, sat), 0.0f
- , ((c - mn) * s) / sat);
- };
- *r = scale(*r);
---- ./src/core/SkVM.h.sav 2020-04-06 12:08:50.833128845 +0200
-+++ ./src/core/SkVM.h 2020-04-06 12:51:13.369987701 +0200
-@@ -875,6 +875,7 @@ namespace skvm {
-
- static inline I32 operator==(F32 x, F32a y) { return x->eq(x,y); }
- static inline I32 operator==(float x, F32 y) { return y->eq(x,y); }
-+ static inline I32 eq_op(float x, F32 y) { return y->eq(x,y); }
-
- static inline I32 operator!=(F32 x, F32a y) { return x->neq(x,y); }
- static inline I32 operator!=(float x, F32 y) { return y->neq(x,y); }
diff --git a/external/skia/operator-eq-bool.patch.1 b/external/skia/operator-eq-bool.patch.1
new file mode 100644
index 000000000000..d6dc3c139d36
--- /dev/null
+++ b/external/skia/operator-eq-bool.patch.1
@@ -0,0 +1,25 @@
+diff --git a/src/core/SkVM.cpp b/src/core/SkVM.cpp
+index 654ab8f97c..e7b3137d8e 100644
+--- a/src/core/SkVM.cpp
++++ b/src/core/SkVM.cpp
+@@ -1173,7 +1173,7 @@ namespace skvm {
+ // Map min channel to 0, max channel to s, and scale the middle proportionally.
+ auto scale = [&](auto c) {
+ // TODO: better to divide and check for non-finite result?
+- return select(sat == 0.0f, 0.0f
++ return select(eq_op(0.0f, sat), 0.0f
+ , ((c - mn) * s) / sat);
+ };
+ *r = scale(*r);
+diff --git a/src/core/SkVM.h b/src/core/SkVM.h
+index db5b273c45..5cf1ebba3c 100644
+--- a/src/core/SkVM.h
++++ b/src/core/SkVM.h
+@@ -882,6 +882,7 @@ namespace skvm {
+ static inline I32 operator==(I32 x, I32 y) { return x->eq(x,y); }
+ static inline I32 operator==(I32 x, int y) { return x->eq(x,y); }
+ static inline I32 operator==(int x, I32 y) { return y->eq(x,y); }
++ static inline I32 eq_op(float x, F32 y) { return y->eq(x,y); }
+
+ static inline I32 operator!=(I32 x, I32 y) { return x->neq(x,y); }
+ static inline I32 operator!=(I32 x, int y) { return x->neq(x,y); }
diff --git a/external/skia/public-make-from-backend-texture.patch.1 b/external/skia/public-make-from-backend-texture.patch.1
new file mode 100644
index 000000000000..7543ff816bcd
--- /dev/null
+++ b/external/skia/public-make-from-backend-texture.patch.1
@@ -0,0 +1,44 @@
+diff --git a/include/core/SkSurface.h b/include/core/SkSurface.h
+index bf151c05de..95e84022d4 100644
+--- a/include/core/SkSurface.h
++++ b/include/core/SkSurface.h
+@@ -243,7 +243,7 @@ public:
+ RenderTargetReleaseProc releaseProc = nullptr,
+ ReleaseContext releaseContext = nullptr);
+
+-#if GR_TEST_UTILS
++//#if GR_TEST_UTILS
+ // TODO: Remove this.
+ static sk_sp<SkSurface> MakeFromBackendTextureAsRenderTarget(GrContext* context,
+ const GrBackendTexture& backendTexture,
+@@ -252,7 +252,7 @@ public:
+ SkColorType colorType,
+ sk_sp<SkColorSpace> colorSpace,
+ const SkSurfaceProps* surfaceProps);
+-#endif
++//#endif
+
+ #if defined(SK_BUILD_FOR_ANDROID) && __ANDROID_API__ >= 26
+ /** Private.
+diff --git a/src/image/SkSurface_Gpu.cpp b/src/image/SkSurface_Gpu.cpp
+index 87c7a81b16..1842487030 100644
+--- a/src/image/SkSurface_Gpu.cpp
++++ b/src/image/SkSurface_Gpu.cpp
+@@ -666,7 +666,7 @@ sk_sp<SkSurface> SkSurface::MakeFromBackendRenderTarget(GrContext* context,
+ return sk_make_sp<SkSurface_Gpu>(std::move(device));
+ }
+
+-#if GR_TEST_UTILS
++//#if GR_TEST_UTILS
+ sk_sp<SkSurface> SkSurface::MakeFromBackendTextureAsRenderTarget(GrContext* context,
+ const GrBackendTexture& tex,
+ GrSurfaceOrigin origin,
+@@ -700,7 +700,7 @@ sk_sp<SkSurface> SkSurface::MakeFromBackendTextureAsRenderTarget(GrContext* cont
+ }
+ return sk_make_sp<SkSurface_Gpu>(std::move(device));
+ }
+-#endif
++//#endif
+
+ #if defined(SK_BUILD_FOR_ANDROID) && __ANDROID_API__ >= 26
+ sk_sp<SkSurface> SkSurface::MakeFromAHardwareBuffer(GrContext* context,
diff --git a/external/skia/share-grcontext.patch.1 b/external/skia/share-grcontext.patch.1
index a6d815d0024a..1c7da21d6b6c 100644
--- a/external/skia/share-grcontext.patch.1
+++ b/external/skia/share-grcontext.patch.1
@@ -1,5 +1,5 @@
diff --git a/tools/sk_app/VulkanWindowContext.cpp b/tools/sk_app/VulkanWindowContext.cpp
-index c2b26b4254..fe1afd30a1 100644
+index 970c67ec0c..371bd8ab0c 100644
--- a/tools/sk_app/VulkanWindowContext.cpp
+++ b/tools/sk_app/VulkanWindowContext.cpp
@@ -24,8 +24,10 @@
@@ -228,11 +228,11 @@ index c2b26b4254..fe1afd30a1 100644
+ fDestroySwapchainKHR(fShared->fDevice, swapchainCreateInfo.oldSwapchain, nullptr);
}
- this->createBuffers(swapchainCreateInfo.imageFormat, colorType);
-@@ -323,10 +340,10 @@ bool VulkanWindowContext::createSwapchain(int width, int height,
- }
+ this->createBuffers(swapchainCreateInfo.imageFormat, colorType,
+@@ -325,10 +342,10 @@ bool VulkanWindowContext::createSwapchain(int width, int height,
- void VulkanWindowContext::createBuffers(VkFormat format, SkColorType colorType) {
+ void VulkanWindowContext::createBuffers(VkFormat format, SkColorType colorType,
+ VkSharingMode sharingMode) {
- fGetSwapchainImagesKHR(fDevice, fSwapchain, &fImageCount, nullptr);
+ fGetSwapchainImagesKHR(fShared->fDevice, fSwapchain, &fImageCount, nullptr);
SkASSERT(fImageCount);
@@ -242,16 +242,16 @@ index c2b26b4254..fe1afd30a1 100644
// set up initial image layouts and create surfaces
fImageLayouts = new VkImageLayout[fImageCount];
-@@ -341,7 +358,7 @@ void VulkanWindowContext::createBuffers(VkFormat format, SkColorType colorType)
+@@ -343,7 +360,7 @@ void VulkanWindowContext::createBuffers(VkFormat format, SkColorType colorType,
info.fImageTiling = VK_IMAGE_TILING_OPTIMAL;
info.fFormat = format;
info.fLevelCount = 1;
- info.fCurrentQueueFamily = fPresentQueueIndex;
+ info.fCurrentQueueFamily = fShared->fPresentQueueIndex;
+ info.fSharingMode = sharingMode;
if (fSampleCount == 1) {
- GrBackendRenderTarget backendRT(fWidth, fHeight, fSampleCount, info);
-@@ -372,8 +389,8 @@ void VulkanWindowContext::createBuffers(VkFormat format, SkColorType colorType)
+@@ -375,8 +392,8 @@ void VulkanWindowContext::createBuffers(VkFormat format, SkColorType colorType,
fBackbuffers = new BackbufferInfo[fImageCount + 1];
for (uint32_t i = 0; i < fImageCount + 1; ++i) {
fBackbuffers[i].fImageIndex = -1;
@@ -262,7 +262,7 @@ index c2b26b4254..fe1afd30a1 100644
&fBackbuffers[i].fRenderSemaphore));
SkASSERT(result == VK_SUCCESS);
}
-@@ -385,8 +402,8 @@ void VulkanWindowContext::destroyBuffers() {
+@@ -388,8 +405,8 @@ void VulkanWindowContext::destroyBuffers() {
if (fBackbuffers) {
for (uint32_t i = 0; i < fImageCount + 1; ++i) {
fBackbuffers[i].fImageIndex = -1;
@@ -273,7 +273,7 @@ index c2b26b4254..fe1afd30a1 100644
fBackbuffers[i].fRenderSemaphore,
nullptr));
}
-@@ -411,41 +428,59 @@ VulkanWindowContext::~VulkanWindowContext() {
+@@ -414,41 +431,59 @@ VulkanWindowContext::~VulkanWindowContext() {
void VulkanWindowContext::destroyContext() {
if (this->isValid()) {
fQueueWaitIdle(fPresentQueue);
@@ -346,7 +346,7 @@ index c2b26b4254..fe1afd30a1 100644
}
VulkanWindowContext::BackbufferInfo* VulkanWindowContext::getAvailableBackbuffer() {
-@@ -471,35 +506,35 @@ sk_sp<SkSurface> VulkanWindowContext::getBackbufferSurface() {
+@@ -474,35 +509,35 @@ sk_sp<SkSurface> VulkanWindowContext::getBackbufferSurface() {
semaphoreInfo.pNext = nullptr;
semaphoreInfo.flags = 0;
VkSemaphore semaphore;
@@ -388,7 +388,16 @@ index c2b26b4254..fe1afd30a1 100644
return nullptr;
}
}
-@@ -543,4 +578,6 @@ void VulkanWindowContext::swapBuffers() {
+@@ -528,7 +563,7 @@ void VulkanWindowContext::swapBuffers() {
+ GrFlushInfo info;
+ info.fNumSemaphores = 1;
+ info.fSignalSemaphores = &beSemaphore;
+- GrBackendSurfaceMutableState presentState(VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, fPresentQueueIndex);
++ GrBackendSurfaceMutableState presentState(VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, fShared->fPresentQueueIndex);
+ surface->flush(info, &presentState);
+ surface->getContext()->submit();
+
+@@ -548,4 +583,6 @@ void VulkanWindowContext::swapBuffers() {
fQueuePresentKHR(fPresentQueue, &presentInfo);
}
@@ -396,7 +405,7 @@ index c2b26b4254..fe1afd30a1 100644
+
} //namespace sk_app
diff --git a/tools/sk_app/VulkanWindowContext.h b/tools/sk_app/VulkanWindowContext.h
-index 2db9e79ae6..aa48fc2951 100644
+index 5e245aff70..c6c866372f 100644
--- a/tools/sk_app/VulkanWindowContext.h
+++ b/tools/sk_app/VulkanWindowContext.h
@@ -19,18 +19,36 @@
@@ -455,7 +464,7 @@ index 2db9e79ae6..aa48fc2951 100644
struct BackbufferInfo {
uint32_t fImageIndex; // image this is associated with
@@ -64,11 +88,6 @@ private:
- void createBuffers(VkFormat format, SkColorType colorType);
+ void createBuffers(VkFormat format, SkColorType colorType, VkSharingMode);
void destroyBuffers();
- VkInstance fInstance = VK_NULL_HANDLE;