summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2020-11-13 20:22:32 +0100
committerLuboš Luňák <l.lunak@collabora.com>2020-11-17 10:54:55 +0100
commit319a03fe3975f24f1bccc88019a92217bc1df53b (patch)
tree92cacf562614295cb56e333ceb1461ff8aa2358e
parenttdf#138018 don't show leader lines inside pie chart (diff)
downloadcore-319a03fe3975f24f1bccc88019a92217bc1df53b.tar.gz
core-319a03fe3975f24f1bccc88019a92217bc1df53b.zip
update Skia to chrome/m88
Change-Id: I74c19597b07e9d07ee90e4191b75787241fdd845 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105829 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
-rw-r--r--config_host/config_skia.h.in3
-rw-r--r--download.lst4
-rw-r--r--external/skia/Library_skia.mk22
-rw-r--r--external/skia/UnpackedTarball_skia.mk3
-rw-r--r--external/skia/Wdeprecated-copy-dtor.patch.010
-rw-r--r--external/skia/constexpr-debug-std-max.patch.132
-rw-r--r--external/skia/fix-sse.patch.123
-rw-r--r--external/skia/fix-windows-dwrite.patch.120
-rw-r--r--external/skia/fix-without-gl.patch.020
-rw-r--r--external/skia/inc/pch/precompiled_skia.hxx36
-rw-r--r--external/skia/public-make-from-backend-texture.patch.144
-rw-r--r--external/skia/share-grcontext.patch.175
-rw-r--r--vcl/inc/skia/win/gdiimpl.hxx6
-rw-r--r--vcl/skia/gdiimpl.cxx8
-rw-r--r--vcl/skia/win/gdiimpl.cxx31
15 files changed, 187 insertions, 150 deletions
diff --git a/config_host/config_skia.h.in b/config_host/config_skia.h.in
index c302dbcca3e6..10fd4374b9c5 100644
--- a/config_host/config_skia.h.in
+++ b/config_host/config_skia.h.in
@@ -38,6 +38,9 @@ are the same.
// Memory allocator for Vulkan.
#define SK_USE_VMA 1
+// Set by Skia's BUILD.gn.
+#define GR_OP_ALLOCATE_USE_NEW
+
#define SK_CODEC_DECODES_PNG 1
#define SK_ENCODE_PNG 1
diff --git a/download.lst b/download.lst
index 46a8d3066cc1..759dfc6650dc 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 := d6fe401003854f0487473f5692a4d37998c5eb82b501b2e4de72ad263467a0e6
-export SKIA_TARBALL := skia-m86-e1e24080421116cf5d63b55cd5042176bebc0a43.tar.xz
+export SKIA_SHA256SUM := f293656a15342a53bb407b932fc907c6894178a162f09728bd383e24d84b1301
+export SKIA_TARBALL := skia-m88-59bafeeaa7de9eb753e3778c414e01dcf013dcd8.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 ec2d2a3f3f45..87ae0c64552f 100644
--- a/external/skia/Library_skia.mk
+++ b/external/skia/Library_skia.mk
@@ -193,7 +193,6 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
UnpackedTarball/skia/src/core/SkFont \
UnpackedTarball/skia/src/core/SkFont_serial \
UnpackedTarball/skia/src/core/SkFontDescriptor \
- UnpackedTarball/skia/src/core/SkFontLCDConfig \
UnpackedTarball/skia/src/core/SkFontMgr \
UnpackedTarball/skia/src/core/SkFontStream \
UnpackedTarball/skia/src/core/SkGaussFilter \
@@ -214,7 +213,6 @@ $(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 \
@@ -323,6 +321,8 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
UnpackedTarball/skia/src/core/SkWriter32 \
UnpackedTarball/skia/src/core/SkXfermode \
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 \
@@ -429,6 +429,8 @@ $(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/ir/SkSLConstructor \
+ UnpackedTarball/skia/src/sksl/ir/SkSLPrefixExpression \
UnpackedTarball/skia/src/sksl/ir/SkSLSetting \
UnpackedTarball/skia/src/sksl/ir/SkSLSymbolTable \
UnpackedTarball/skia/src/sksl/ir/SkSLType \
@@ -445,10 +447,12 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
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/SkSLMetalCodeGenerator \
UnpackedTarball/skia/src/sksl/SkSLOutputStream \
UnpackedTarball/skia/src/sksl/SkSLParser \
+ UnpackedTarball/skia/src/sksl/SkSLPool \
UnpackedTarball/skia/src/sksl/SkSLPipelineStageCodeGenerator \
UnpackedTarball/skia/src/sksl/SkSLRehydrator \
UnpackedTarball/skia/src/sksl/SkSLSampleUsage \
@@ -588,28 +592,31 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
UnpackedTarball/skia/src/gpu/gradients/GrGradientShader \
UnpackedTarball/skia/src/gpu/GrAHardwareBufferImageGenerator \
UnpackedTarball/skia/src/gpu/GrAHardwareBufferUtils \
+ UnpackedTarball/skia/src/gpu/GrAttachment \
UnpackedTarball/skia/src/gpu/GrAuditTrail \
UnpackedTarball/skia/src/gpu/GrBackendSemaphore \
+ UnpackedTarball/skia/src/gpu/GrBackendSurfaceMutableState \
UnpackedTarball/skia/src/gpu/GrBackendSurface \
UnpackedTarball/skia/src/gpu/GrBackendTextureImageGenerator \
+ UnpackedTarball/skia/src/gpu/GrBackendUtils \
UnpackedTarball/skia/src/gpu/GrBitmapTextureMaker \
UnpackedTarball/skia/src/gpu/GrBlockAllocator \
UnpackedTarball/skia/src/gpu/GrBlurUtils \
UnpackedTarball/skia/src/gpu/GrBufferAllocPool \
UnpackedTarball/skia/src/gpu/GrCaps \
UnpackedTarball/skia/src/gpu/GrClientMappedBufferManager \
+ UnpackedTarball/skia/src/gpu/GrClipStack \
UnpackedTarball/skia/src/gpu/GrClipStackClip \
UnpackedTarball/skia/src/gpu/GrColorInfo \
UnpackedTarball/skia/src/gpu/GrColorSpaceXform \
UnpackedTarball/skia/src/gpu/GrContext_Base \
- UnpackedTarball/skia/src/gpu/GrContext \
- UnpackedTarball/skia/src/gpu/GrContextPriv \
UnpackedTarball/skia/src/gpu/GrContextThreadSafeProxy \
UnpackedTarball/skia/src/gpu/GrCopyRenderTask \
UnpackedTarball/skia/src/gpu/GrDataUtils \
UnpackedTarball/skia/src/gpu/GrDDLContext \
UnpackedTarball/skia/src/gpu/GrDefaultGeoProcFactory \
UnpackedTarball/skia/src/gpu/GrDirectContext \
+ UnpackedTarball/skia/src/gpu/GrDirectContextPriv \
UnpackedTarball/skia/src/gpu/GrDistanceFieldGenFromVector \
UnpackedTarball/skia/src/gpu/GrDrawingManager \
UnpackedTarball/skia/src/gpu/GrDrawOpAtlas \
@@ -666,7 +673,6 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
UnpackedTarball/skia/src/gpu/GrSPIRVUniformHandler \
UnpackedTarball/skia/src/gpu/GrSPIRVVaryingHandler \
UnpackedTarball/skia/src/gpu/GrStagingBufferManager \
- UnpackedTarball/skia/src/gpu/GrStencilAttachment \
UnpackedTarball/skia/src/gpu/GrStencilMaskHelper \
UnpackedTarball/skia/src/gpu/GrStencilSettings \
UnpackedTarball/skia/src/gpu/GrStyle \
@@ -685,10 +691,12 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
UnpackedTarball/skia/src/gpu/GrTextureProxy \
UnpackedTarball/skia/src/gpu/GrTextureRenderTargetProxy \
UnpackedTarball/skia/src/gpu/GrTextureResolveRenderTask \
+ UnpackedTarball/skia/src/gpu/GrThreadSafeCache \
UnpackedTarball/skia/src/gpu/GrTransferFromRenderTask \
UnpackedTarball/skia/src/gpu/GrUtil \
UnpackedTarball/skia/src/gpu/GrWaitRenderTask \
UnpackedTarball/skia/src/gpu/GrXferProcessor \
+ UnpackedTarball/skia/src/gpu/GrYUVABackendTextures \
UnpackedTarball/skia/src/gpu/mock/GrMockCaps \
UnpackedTarball/skia/src/gpu/mock/GrMockGpu \
UnpackedTarball/skia/src/gpu/mock/GrMockTypes \
@@ -731,7 +739,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
UnpackedTarball/skia/src/gpu/tessellate/GrFillPathShader \
UnpackedTarball/skia/src/gpu/tessellate/GrPathTessellateOp \
UnpackedTarball/skia/src/gpu/tessellate/GrStencilPathShader \
- UnpackedTarball/skia/src/gpu/tessellate/GrStrokePatchBuilder \
+ UnpackedTarball/skia/src/gpu/tessellate/GrStrokeOp \
UnpackedTarball/skia/src/gpu/tessellate/GrStrokeTessellateOp \
UnpackedTarball/skia/src/gpu/tessellate/GrStrokeTessellateShader \
UnpackedTarball/skia/src/gpu/tessellate/GrTessellationPathRenderer \
@@ -747,6 +755,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
UnpackedTarball/skia/src/image/SkImage_GpuYUVA \
UnpackedTarball/skia/src/image/SkSurface_Gpu \
UnpackedTarball/skia/src/gpu/vk/GrVkAMDMemoryAllocator \
+ UnpackedTarball/skia/src/gpu/vk/GrVkAttachment \
UnpackedTarball/skia/src/gpu/vk/GrVkBuffer \
UnpackedTarball/skia/src/gpu/vk/GrVkCaps \
UnpackedTarball/skia/src/gpu/vk/GrVkCommandBuffer \
@@ -775,7 +784,6 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
UnpackedTarball/skia/src/gpu/vk/GrVkSamplerYcbcrConversion \
UnpackedTarball/skia/src/gpu/vk/GrVkSecondaryCBDrawContext \
UnpackedTarball/skia/src/gpu/vk/GrVkSemaphore \
- UnpackedTarball/skia/src/gpu/vk/GrVkStencilAttachment \
UnpackedTarball/skia/src/gpu/vk/GrVkTexture \
UnpackedTarball/skia/src/gpu/vk/GrVkTextureRenderTarget \
UnpackedTarball/skia/src/gpu/vk/GrVkTransferBuffer \
diff --git a/external/skia/UnpackedTarball_skia.mk b/external/skia/UnpackedTarball_skia.mk
index dfafc00d66ec..b4aab05a80c5 100644
--- a/external/skia/UnpackedTarball_skia.mk
+++ b/external/skia/UnpackedTarball_skia.mk
@@ -22,9 +22,7 @@ skia_patches := \
fix-alpha-difference-copy.patch.1 \
libvulkan-name.patch.1 \
share-grcontext.patch.1 \
- Wdeprecated-copy-dtor.patch.0 \
fix-gcc-x86.patch.1 \
- fix-sse.patch.1 \
clang11-flax-vector-conversion.patch.0 \
clang-attributes-warning.patch.1 \
fontconfig-get-typeface.patch.0 \
@@ -35,7 +33,6 @@ skia_patches := \
windows-typeface-directwrite.patch.0 \
windows-raster-surface-no-copies.patch.1 \
fix-windows-dwrite.patch.1 \
- public-make-from-backend-texture.patch.1 \
c++20.patch.0 \
constexpr-debug-std-max.patch.1 \
swap-buffers-rect.patch.1
diff --git a/external/skia/Wdeprecated-copy-dtor.patch.0 b/external/skia/Wdeprecated-copy-dtor.patch.0
deleted file mode 100644
index 7c49627d8714..000000000000
--- a/external/skia/Wdeprecated-copy-dtor.patch.0
+++ /dev/null
@@ -1,10 +0,0 @@
---- include/gpu/GrDriverBugWorkarounds.h
-+++ include/gpu/GrDriverBugWorkarounds.h
-@@ -35,6 +35,7 @@
- public:
- GrDriverBugWorkarounds();
- explicit GrDriverBugWorkarounds(const std::vector<int32_t>& workarounds);
-+ GrDriverBugWorkarounds(GrDriverBugWorkarounds const &) = default;
-
- GrDriverBugWorkarounds& operator=(const GrDriverBugWorkarounds&) = default;
-
diff --git a/external/skia/constexpr-debug-std-max.patch.1 b/external/skia/constexpr-debug-std-max.patch.1
index b35b978e4041..9f3784836c70 100644
--- a/external/skia/constexpr-debug-std-max.patch.1
+++ b/external/skia/constexpr-debug-std-max.patch.1
@@ -35,3 +35,35 @@ index 52dda13e29..cafe2e672a 100755
alignof(GrTextureAdjuster ),
alignof(GrImageTextureMaker ),
alignof(GrBitmapTextureMaker )});
+diff --git a/src/sksl/SkSLASTNode.h b/src/sksl/SkSLASTNode.h
+index 5922cd5fb3..17a877ee21 100644
+--- a/src/sksl/SkSLASTNode.h
++++ b/src/sksl/SkSLASTNode.h
+@@ -17,6 +17,18 @@
+
+ namespace SkSL {
+
++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;
++}
++}
++
+ /**
+ * 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 {
+ };
+
+ struct NodeData {
+- char fBytes[std::max({sizeof(Token),
++ char fBytes[skia_max({sizeof(Token),
+ sizeof(StringFragment),
+ sizeof(bool),
+ sizeof(SKSL_INT),
diff --git a/external/skia/fix-sse.patch.1 b/external/skia/fix-sse.patch.1
deleted file mode 100644
index 8a731725e488..000000000000
--- a/external/skia/fix-sse.patch.1
+++ /dev/null
@@ -1,23 +0,0 @@
---- a/src/opts/SkRasterPipeline_opts.h
-+++ b/src/opts/SkRasterPipeline_opts.h
-@@ -1047,7 +1047,7 @@ static const size_t N = sizeof(F) / sizeof(float);
- // TODO: crashes during compilation :(
- #define ABI __attribute__((sysv_abi))
- #define JUMPER_NARROW_STAGES 0
--#elif defined(_MSC_VER)
-+#elif defined(_MSC_VER) && SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2
- // Even if not vectorized, this lets us pass {r,g,b,a} as registers,
- // instead of {b,a} on the stack. Narrow stages work best for __vectorcall.
- #define ABI __vectorcall
---- a/include/private/SkVx.h
-+++ b/include/private/SkVx.h
-@@ -515,9 +515,6 @@ static inline Vec<N,uint8_t> approx_scale(const Vec<N,uint8_t>& x, const Vec<N,u
- static inline Vec<4,float> rcp(const Vec<4,float>& x) {
- return bit_pun<Vec<4,float>>(_mm_rcp_ps(bit_pun<__m128>(x)));
- }
-- static inline Vec<4,int> lrint(const Vec<4,float>& x) {
-- return bit_pun<Vec<4,int>>(_mm_cvtps_epi32(bit_pun<__m128>(x)));
-- }
-
- static inline Vec<2,float> sqrt(const Vec<2,float>& x) {
- return shuffle<0,1>( sqrt(shuffle<0,1,0,1>(x)));
diff --git a/external/skia/fix-windows-dwrite.patch.1 b/external/skia/fix-windows-dwrite.patch.1
index 482fa8b40411..b5f216a5258d 100644
--- a/external/skia/fix-windows-dwrite.patch.1
+++ b/external/skia/fix-windows-dwrite.patch.1
@@ -18,3 +18,23 @@ index 6a4748f91c..50086a7780 100644
bool same;
+diff --git a/src/ports/SkScalerContext_win_dw.cpp b/src/ports/SkScalerContext_win_dw.cpp
+index b2df467b22..385094e506 100644
+--- a/src/ports/SkScalerContext_win_dw.cpp
++++ b/src/ports/SkScalerContext_win_dw.cpp
+@@ -778,6 +778,7 @@ void SkScalerContext_DW::generateFontMetrics(SkFontMetrics* metrics) {
+ metrics->fFlags |= SkFontMetrics::kStrikeoutThicknessIsValid_Flag;
+ metrics->fFlags |= SkFontMetrics::kStrikeoutPositionIsValid_Flag;
+
++#if defined(NTDDI_WIN10_RS3) && NTDDI_VERSION >= NTDDI_WIN10_RS3
+ SkTScopedComPtr<IDWriteFontFace5> fontFace5;
+ if (SUCCEEDED(this->getDWriteTypeface()->fDWriteFontFace->QueryInterface(&fontFace5))) {
+ if (fontFace5->HasVariations()) {
+@@ -785,6 +786,7 @@ void SkScalerContext_DW::generateFontMetrics(SkFontMetrics* metrics) {
+ metrics->fFlags |= SkFontMetrics::kBoundsInvalid_Flag;
+ }
+ }
++#endif
+
+ if (this->getDWriteTypeface()->fDWriteFontFace1.get()) {
+ DWRITE_FONT_METRICS1 dwfm1;
diff --git a/external/skia/fix-without-gl.patch.0 b/external/skia/fix-without-gl.patch.0
index 0729162b2aa0..476978ff2b33 100644
--- a/external/skia/fix-without-gl.patch.0
+++ b/external/skia/fix-without-gl.patch.0
@@ -45,3 +45,23 @@ index 66bfe29331..034cd21838 100644
const GrGLExtensions& extensions() const { return fInterface->fExtensions; }
protected:
+diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h
+index 8e550c36e6..27fb5efe9b 100644
+--- ./src/gpu/gl/GrGLGpu.h
++++ ./src/gpu/gl/GrGLGpu.h
+@@ -259,6 +259,7 @@ private:
+ // compatible stencil format, or negative if there is no compatible stencil format.
+ int getCompatibleStencilIndex(GrGLFormat format);
+
++#ifdef SK_GL
+ GrBackendFormat getPreferredStencilFormat(const GrBackendFormat& format) override {
+ int idx = this->getCompatibleStencilIndex(format.asGLFormat());
+ if (idx < 0) {
+@@ -267,6 +268,7 @@ private:
+ return GrBackendFormat::MakeGL(GrGLFormatToEnum(this->glCaps().stencilFormats()[idx]),
+ GR_GL_TEXTURE_NONE);
+ }
++#endif
+
+ void onFBOChanged();
+
diff --git a/external/skia/inc/pch/precompiled_skia.hxx b/external/skia/inc/pch/precompiled_skia.hxx
index 7ed0d78c28be..b4f9ea92f0af 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-08-27 16:26:03 using:
+ Generated on 2020-11-13 19:45:52 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:
@@ -47,6 +47,7 @@
#include <limits.h>
#include <limits>
#include <locale>
+#include <map>
#include <memory>
#include <new>
#include <png.h>
@@ -108,7 +109,6 @@
#include <include/core/SkFilterQuality.h>
#include <include/core/SkFlattenable.h>
#include <include/core/SkFont.h>
-#include <include/core/SkFontLCDConfig.h>
#include <include/core/SkFontMetrics.h>
#include <include/core/SkFontMgr.h>
#include <include/core/SkGraphics.h>
@@ -164,6 +164,8 @@
#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>
@@ -211,14 +213,15 @@
#include <include/gpu/GrBackendDrawableInfo.h>
#include <include/gpu/GrBackendSemaphore.h>
#include <include/gpu/GrBackendSurface.h>
+#include <include/gpu/GrBackendSurfaceMutableState.h>
#include <include/gpu/GrConfig.h>
-#include <include/gpu/GrContext.h>
#include <include/gpu/GrContextOptions.h>
#include <include/gpu/GrContextThreadSafeProxy.h>
#include <include/gpu/GrDirectContext.h>
#include <include/gpu/GrDriverBugWorkarounds.h>
#include <include/gpu/GrRecordingContext.h>
#include <include/gpu/GrTypes.h>
+#include <include/gpu/GrYUVABackendTextures.h>
#include <include/gpu/mock/GrMockTypes.h>
#include <include/gpu/vk/GrVkBackendContext.h>
#include <include/gpu/vk/GrVkExtensions.h>
@@ -257,6 +260,7 @@
#include <include/private/SkTDArray.h>
#include <include/private/SkTFitsIn.h>
#include <include/private/SkTHash.h>
+#include <include/private/SkTPin.h>
#include <include/private/SkTemplates.h>
#include <include/private/SkThreadAnnotations.h>
#include <include/private/SkThreadID.h>
@@ -302,6 +306,7 @@
#include <src/codec/SkWbmpCodec.h>
#include <src/codec/SkWebpCodec.h>
#include <src/core/SkAAClip.h>
+#include <src/core/SkASAN.h>
#include <src/core/SkATrace.h>
#include <src/core/SkAdvancedTypefaceMetrics.h>
#include <src/core/SkAnalyticEdge.h>
@@ -320,7 +325,6 @@
#include <src/core/SkBlitRow.h>
#include <src/core/SkBlitter.h>
#include <src/core/SkBlurMask.h>
-#include <src/core/SkBlurPriv.h>
#include <src/core/SkBuffer.h>
#include <src/core/SkCachedData.h>
#include <src/core/SkCanvasPriv.h>
@@ -399,7 +403,6 @@
#include <src/core/SkPathMakers.h>
#include <src/core/SkPathMeasurePriv.h>
#include <src/core/SkPathPriv.h>
-#include <src/core/SkPathView.h>
#include <src/core/SkPictureCommon.h>
#include <src/core/SkPictureData.h>
#include <src/core/SkPictureFlat.h>
@@ -476,7 +479,6 @@
#include <src/core/SkXfermodePriv.h>
#include <src/core/SkYUVMath.h>
#include <src/core/SkYUVPlanesCache.h>
-#include <src/core/SkZip.h>
#include <src/effects/SkDashImpl.h>
#include <src/effects/SkEmbossMask.h>
#include <src/effects/SkEmbossMaskFilter.h>
@@ -486,6 +488,7 @@
#include <src/gpu/GrAHardwareBufferImageGenerator.h>
#include <src/gpu/GrAHardwareBufferUtils.h>
#include <src/gpu/GrAppliedClip.h>
+#include <src/gpu/GrAttachment.h>
#include <src/gpu/GrAuditTrail.h>
#include <src/gpu/GrAutoLocaleSetter.h>
#include <src/gpu/GrBackendSurfaceMutableStateImpl.h>
@@ -501,17 +504,18 @@
#include <src/gpu/GrCaps.h>
#include <src/gpu/GrClientMappedBufferManager.h>
#include <src/gpu/GrClip.h>
+#include <src/gpu/GrClipStack.h>
#include <src/gpu/GrClipStackClip.h>
#include <src/gpu/GrColor.h>
#include <src/gpu/GrColorInfo.h>
#include <src/gpu/GrColorSpaceXform.h>
-#include <src/gpu/GrContextPriv.h>
#include <src/gpu/GrContextThreadSafeProxyPriv.h>
#include <src/gpu/GrCopyRenderTask.h>
#include <src/gpu/GrCpuBuffer.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/GrDrawOpAtlas.h>
#include <src/gpu/GrDrawOpTest.h>
@@ -563,7 +567,6 @@
#include <src/gpu/GrRenderTargetContext.h>
#include <src/gpu/GrRenderTargetContextPriv.h>
#include <src/gpu/GrRenderTargetProxy.h>
-#include <src/gpu/GrRenderTargetProxyPriv.h>
#include <src/gpu/GrRenderTask.h>
#include <src/gpu/GrResourceAllocator.h>
#include <src/gpu/GrResourceCache.h>
@@ -583,7 +586,6 @@
#include <src/gpu/GrSimpleMesh.h>
#include <src/gpu/GrSoftwarePathRenderer.h>
#include <src/gpu/GrStagingBufferManager.h>
-#include <src/gpu/GrStencilAttachment.h>
#include <src/gpu/GrStencilClip.h>
#include <src/gpu/GrStencilMaskHelper.h>
#include <src/gpu/GrStencilSettings.h>
@@ -605,6 +607,7 @@
#include <src/gpu/GrTextureProxyPriv.h>
#include <src/gpu/GrTextureRenderTargetProxy.h>
#include <src/gpu/GrTextureResolveRenderTask.h>
+#include <src/gpu/GrThreadSafeCache.h>
#include <src/gpu/GrTracing.h>
#include <src/gpu/GrTransferFromRenderTask.h>
#include <src/gpu/GrTriangulator.h>
@@ -718,11 +721,11 @@
#include <src/gpu/gradients/generated/GrTiledGradientEffect.h>
#include <src/gpu/gradients/generated/GrTwoPointConicalGradientLayout.h>
#include <src/gpu/gradients/generated/GrUnrolledBinaryGradientColorizer.h>
+#include <src/gpu/mock/GrMockAttachment.h>
#include <src/gpu/mock/GrMockBuffer.h>
#include <src/gpu/mock/GrMockCaps.h>
#include <src/gpu/mock/GrMockGpu.h>
#include <src/gpu/mock/GrMockOpsRenderPass.h>
-#include <src/gpu/mock/GrMockStencilAttachment.h>
#include <src/gpu/mock/GrMockTexture.h>
#include <src/gpu/ops/GrAAConvexPathRenderer.h>
#include <src/gpu/ops/GrAAConvexTessellator.h>
@@ -764,11 +767,10 @@
#include <src/gpu/tessellate/GrPathTessellateOp.h>
#include <src/gpu/tessellate/GrResolveLevelCounter.h>
#include <src/gpu/tessellate/GrStencilPathShader.h>
-#include <src/gpu/tessellate/GrStrokePatchBuilder.h>
+#include <src/gpu/tessellate/GrStrokeOp.h>
#include <src/gpu/tessellate/GrStrokeTessellateOp.h>
#include <src/gpu/tessellate/GrStrokeTessellateShader.h>
#include <src/gpu/tessellate/GrTessellationPathRenderer.h>
-#include <src/gpu/tessellate/GrVectorXform.h>
#include <src/gpu/tessellate/GrWangsFormula.h>
#include <src/gpu/text/GrAtlasManager.h>
#include <src/gpu/text/GrDistanceFieldAdjustTable.h>
@@ -777,6 +779,7 @@
#include <src/gpu/text/GrStrikeCache.h>
#include <src/gpu/text/GrTextBlob.h>
#include <src/gpu/text/GrTextBlobCache.h>
+#include <src/gpu/vk/GrVkAttachment.h>
#include <src/gpu/vk/GrVkBuffer.h>
#include <src/gpu/vk/GrVkCaps.h>
#include <src/gpu/vk/GrVkCommandBuffer.h>
@@ -804,7 +807,6 @@
#include <src/gpu/vk/GrVkSamplerYcbcrConversion.h>
#include <src/gpu/vk/GrVkSecondaryCBDrawContext.h>
#include <src/gpu/vk/GrVkSemaphore.h>
-#include <src/gpu/vk/GrVkStencilAttachment.h>
#include <src/gpu/vk/GrVkTexture.h>
#include <src/gpu/vk/GrVkTextureRenderTarget.h>
#include <src/gpu/vk/GrVkTransferBuffer.h>
@@ -880,14 +882,17 @@
#include <src/sksl/SkSLCompiler.h>
#include <src/sksl/SkSLContext.h>
#include <src/sksl/SkSLDehydrator.h>
+#include <src/sksl/SkSLErrorReporter.h>
#include <src/sksl/SkSLGLSLCodeGenerator.h>
#include <src/sksl/SkSLHCodeGenerator.h>
#include <src/sksl/SkSLIRGenerator.h>
+#include <src/sksl/SkSLInliner.h>
#include <src/sksl/SkSLLexer.h>
#include <src/sksl/SkSLMetalCodeGenerator.h>
#include <src/sksl/SkSLOutputStream.h>
#include <src/sksl/SkSLParser.h>
#include <src/sksl/SkSLPipelineStageCodeGenerator.h>
+#include <src/sksl/SkSLPool.h>
#include <src/sksl/SkSLRehydrator.h>
#include <src/sksl/SkSLSPIRVCodeGenerator.h>
#include <src/sksl/SkSLSPIRVtoHLSL.h>
@@ -916,9 +921,11 @@
#include <src/sksl/ir/SkSLFunctionCall.h>
#include <src/sksl/ir/SkSLFunctionDeclaration.h>
#include <src/sksl/ir/SkSLFunctionDefinition.h>
+#include <src/sksl/ir/SkSLFunctionPrototype.h>
#include <src/sksl/ir/SkSLFunctionReference.h>
#include <src/sksl/ir/SkSLIfStatement.h>
#include <src/sksl/ir/SkSLIndexExpression.h>
+#include <src/sksl/ir/SkSLInlineMarker.h>
#include <src/sksl/ir/SkSLIntLiteral.h>
#include <src/sksl/ir/SkSLInterfaceBlock.h>
#include <src/sksl/ir/SkSLLayout.h>
@@ -938,16 +945,17 @@
#include <src/sksl/ir/SkSLSwitchStatement.h>
#include <src/sksl/ir/SkSLSwizzle.h>
#include <src/sksl/ir/SkSLSymbol.h>
+#include <src/sksl/ir/SkSLSymbolAlias.h>
#include <src/sksl/ir/SkSLSymbolTable.h>
#include <src/sksl/ir/SkSLTernaryExpression.h>
#include <src/sksl/ir/SkSLType.h>
#include <src/sksl/ir/SkSLTypeReference.h>
#include <src/sksl/ir/SkSLUnresolvedFunction.h>
#include <src/sksl/ir/SkSLVarDeclarations.h>
-#include <src/sksl/ir/SkSLVarDeclarationsStatement.h>
#include <src/sksl/ir/SkSLVariable.h>
#include <src/sksl/ir/SkSLVariableReference.h>
#include <src/sksl/ir/SkSLWhileStatement.h>
+#include <src/utils/SkBitSet.h>
#include <src/utils/SkCanvasStack.h>
#include <src/utils/SkCharToGlyphCache.h>
#include <src/utils/SkDashPathPriv.h>
diff --git a/external/skia/public-make-from-backend-texture.patch.1 b/external/skia/public-make-from-backend-texture.patch.1
deleted file mode 100644
index 7543ff816bcd..000000000000
--- a/external/skia/public-make-from-backend-texture.patch.1
+++ /dev/null
@@ -1,44 +0,0 @@
-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 9713a7dbdea6..3cf2133aa1a9 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 968b4ac82e..66670c892e 100644
+index d07d5a4274..2b36d60076 100644
--- a/tools/sk_app/VulkanWindowContext.cpp
+++ b/tools/sk_app/VulkanWindowContext.cpp
@@ -24,8 +24,10 @@
@@ -196,7 +196,7 @@ index 968b4ac82e..66670c892e 100644
presentModes);
if (VK_SUCCESS != res) {
return false;
-@@ -287,8 +304,8 @@ bool VulkanWindowContext::createSwapchain(int width, int height,
+@@ -293,8 +310,8 @@ bool VulkanWindowContext::createSwapchain(int width, int height,
swapchainCreateInfo.imageArrayLayers = 1;
swapchainCreateInfo.imageUsage = usageFlags;
@@ -207,7 +207,7 @@ index 968b4ac82e..66670c892e 100644
swapchainCreateInfo.imageSharingMode = VK_SHARING_MODE_CONCURRENT;
swapchainCreateInfo.queueFamilyIndexCount = 2;
swapchainCreateInfo.pQueueFamilyIndices = queueFamilies;
-@@ -304,18 +321,18 @@ bool VulkanWindowContext::createSwapchain(int width, int height,
+@@ -310,27 +327,27 @@ bool VulkanWindowContext::createSwapchain(int width, int height,
swapchainCreateInfo.clipped = true;
swapchainCreateInfo.oldSwapchain = fSwapchain;
@@ -228,10 +228,21 @@ index 968b4ac82e..66670c892e 100644
+ fDestroySwapchainKHR(fShared->fDevice, swapchainCreateInfo.oldSwapchain, nullptr);
}
- this->createBuffers(swapchainCreateInfo.imageFormat, colorType,
-@@ -326,10 +343,10 @@ bool VulkanWindowContext::createSwapchain(int width, int height,
+ if (!this->createBuffers(swapchainCreateInfo.imageFormat, usageFlags, colorType,
+ swapchainCreateInfo.imageSharingMode)) {
+- fDeviceWaitIdle(fDevice);
++ fDeviceWaitIdle(fShared->fDevice);
- void VulkanWindowContext::createBuffers(VkFormat format, SkColorType colorType,
+ this->destroyBuffers();
+
+- fDestroySwapchainKHR(fDevice, swapchainCreateInfo.oldSwapchain, nullptr);
++ fDestroySwapchainKHR(fShared->fDevice, swapchainCreateInfo.oldSwapchain, nullptr);
+ }
+
+ return true;
+@@ -339,10 +356,10 @@ bool VulkanWindowContext::createSwapchain(int width, int height,
+ bool VulkanWindowContext::createBuffers(VkFormat format, VkImageUsageFlags usageFlags,
+ SkColorType colorType,
VkSharingMode sharingMode) {
- fGetSwapchainImagesKHR(fDevice, fSwapchain, &fImageCount, nullptr);
+ fGetSwapchainImagesKHR(fShared->fDevice, fSwapchain, &fImageCount, nullptr);
@@ -242,16 +253,16 @@ index 968b4ac82e..66670c892e 100644
// set up initial image layouts and create surfaces
fImageLayouts = new VkImageLayout[fImageCount];
-@@ -344,7 +361,7 @@ void VulkanWindowContext::createBuffers(VkFormat format, SkColorType colorType,
- info.fImageTiling = VK_IMAGE_TILING_OPTIMAL;
+@@ -358,7 +375,7 @@ bool VulkanWindowContext::createBuffers(VkFormat format, VkImageUsageFlags usage
info.fFormat = format;
+ info.fImageUsageFlags = usageFlags;
info.fLevelCount = 1;
- info.fCurrentQueueFamily = fPresentQueueIndex;
+ info.fCurrentQueueFamily = fShared->fPresentQueueIndex;
info.fSharingMode = sharingMode;
- if (fSampleCount == 1) {
-@@ -376,8 +393,8 @@ void VulkanWindowContext::createBuffers(VkFormat format, SkColorType colorType,
+ if (usageFlags & VK_IMAGE_USAGE_SAMPLED_BIT) {
+@@ -394,8 +411,8 @@ bool VulkanWindowContext::createBuffers(VkFormat format, VkImageUsageFlags usage
fBackbuffers = new BackbufferInfo[fImageCount + 1];
for (uint32_t i = 0; i < fImageCount + 1; ++i) {
fBackbuffers[i].fImageIndex = -1;
@@ -262,7 +273,7 @@ index 968b4ac82e..66670c892e 100644
&fBackbuffers[i].fRenderSemaphore));
SkASSERT(result == VK_SUCCESS);
}
-@@ -389,8 +406,8 @@ void VulkanWindowContext::destroyBuffers() {
+@@ -408,8 +425,8 @@ void VulkanWindowContext::destroyBuffers() {
if (fBackbuffers) {
for (uint32_t i = 0; i < fImageCount + 1; ++i) {
fBackbuffers[i].fImageIndex = -1;
@@ -273,7 +284,7 @@ index 968b4ac82e..66670c892e 100644
fBackbuffers[i].fRenderSemaphore,
nullptr));
}
-@@ -415,41 +432,59 @@ VulkanWindowContext::~VulkanWindowContext() {
+@@ -434,42 +451,59 @@ VulkanWindowContext::~VulkanWindowContext() {
void VulkanWindowContext::destroyContext() {
if (this->isValid()) {
fQueueWaitIdle(fPresentQueue);
@@ -295,6 +306,7 @@ index 968b4ac82e..66670c892e 100644
}
}
+- SkASSERT(fContext->unique());
fContext.reset();
- fInterface.reset();
+ fShared.reset();
@@ -346,7 +358,7 @@ index 968b4ac82e..66670c892e 100644
}
VulkanWindowContext::BackbufferInfo* VulkanWindowContext::getAvailableBackbuffer() {
-@@ -475,35 +510,35 @@ sk_sp<SkSurface> VulkanWindowContext::getBackbufferSurface() {
+@@ -495,35 +529,35 @@ sk_sp<SkSurface> VulkanWindowContext::getBackbufferSurface() {
semaphoreInfo.pNext = nullptr;
semaphoreInfo.flags = 0;
VkSemaphore semaphore;
@@ -388,7 +400,7 @@ index 968b4ac82e..66670c892e 100644
return nullptr;
}
}
-@@ -529,7 +564,7 @@ void VulkanWindowContext::swapBuffers() {
+@@ -549,7 +583,7 @@ void VulkanWindowContext::swapBuffers() {
GrFlushInfo info;
info.fNumSemaphores = 1;
info.fSignalSemaphores = &beSemaphore;
@@ -397,7 +409,7 @@ index 968b4ac82e..66670c892e 100644
surface->flush(info, &presentState);
surface->recordingContext()->asDirectContext()->submit();
-@@ -549,4 +584,6 @@ void VulkanWindowContext::swapBuffers() {
+@@ -569,4 +603,6 @@ void VulkanWindowContext::swapBuffers() {
fQueuePresentKHR(fPresentQueue, &presentInfo);
}
@@ -405,7 +417,7 @@ index 968b4ac82e..66670c892e 100644
+
} //namespace sk_app
diff --git a/tools/sk_app/VulkanWindowContext.h b/tools/sk_app/VulkanWindowContext.h
-index 5e245aff70..07a18a46a9 100644
+index 580dba2733..16f6b3fd51 100644
--- a/tools/sk_app/VulkanWindowContext.h
+++ b/tools/sk_app/VulkanWindowContext.h
@@ -19,18 +19,38 @@
@@ -466,7 +478,7 @@ index 5e245aff70..07a18a46a9 100644
struct BackbufferInfo {
uint32_t fImageIndex; // image this is associated with
@@ -64,11 +90,6 @@ private:
- void createBuffers(VkFormat format, SkColorType colorType, VkSharingMode);
+ bool createBuffers(VkFormat format, VkImageUsageFlags, SkColorType colorType, VkSharingMode);
void destroyBuffers();
- VkInstance fInstance = VK_NULL_HANDLE;
@@ -527,6 +539,21 @@ index 5e245aff70..07a18a46a9 100644
VkQueue fPresentQueue;
uint32_t fImageCount;
+diff --git a/tools/sk_app/WindowContext.h b/tools/sk_app/WindowContext.h
+index 0fec5e7366..1d62cea433 100644
+--- a/tools/sk_app/WindowContext.h
++++ b/tools/sk_app/WindowContext.h
+@@ -10,9 +10,9 @@
+ #include "include/core/SkRefCnt.h"
+ #include "include/core/SkSurfaceProps.h"
+ #include "include/gpu/GrTypes.h"
++#include "include/gpu/GrDirectContext.h"
+ #include "tools/sk_app/DisplayParams.h"
+
+-class GrDirectContext;
+ class SkSurface;
+
+ namespace sk_app {
diff --git a/tools/sk_app/unix/VulkanWindowContext_unix.cpp b/tools/sk_app/unix/VulkanWindowContext_unix.cpp
index 34f6640c76..5478b75dac 100644
--- a/tools/sk_app/unix/VulkanWindowContext_unix.cpp
@@ -591,17 +618,3 @@ index 909c96127b..35e063ae28 100644
return nullptr;
}
return ctx;
-diff --git a/tools/sk_app/WindowContext.h b/tools/sk_app/WindowContext.h
---- a/tools/sk_app/WindowContext.h
-+++ b/tools/sk_app/WindowContext.h
-@@ -10,9 +10,9 @@
- #include "include/core/SkRefCnt.h"
- #include "include/core/SkSurfaceProps.h"
- #include "include/gpu/GrTypes.h"
-+#include "include/gpu/GrDirectContext.h"
- #include "tools/sk_app/DisplayParams.h"
-
--class GrDirectContext;
- class SkSurface;
-
- namespace sk_app {
diff --git a/vcl/inc/skia/win/gdiimpl.hxx b/vcl/inc/skia/win/gdiimpl.hxx
index bcdf6874f4d5..26ca29eaee7b 100644
--- a/vcl/inc/skia/win/gdiimpl.hxx
+++ b/vcl/inc/skia/win/gdiimpl.hxx
@@ -77,12 +77,14 @@ protected:
virtual void performFlush() override;
sk_sp<SkTypeface> createDirectWriteTypeface(const LOGFONTW& logFont);
SkFont::Edging getFontEdging();
+ void initFontInfo();
IDWriteFactory* dwriteFactory;
IDWriteGdiInterop* dwriteGdiInterop;
sk_sp<SkFontMgr> dwriteFontMgr;
bool dwriteDone = false;
- SkFont::Edging fontEdging;
- bool fontEdgingDone = false;
+ static SkFont::Edging fontEdging;
+ static SkPixelGeometry pixelGeometry;
+ static bool fontInfoDone;
};
typedef std::pair<ControlCacheKey, sk_sp<SkImage>> SkiaControlCachePair;
diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index a489d0385cfa..c2e96cd44576 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -321,7 +321,7 @@ void SkiaSalGraphicsImpl::createWindowSurface(bool forceRaster)
abort(); // This should not really happen, do not even try to cope with it.
}
}
- mIsGPU = mSurface->getCanvas()->getGrContext() != nullptr;
+ mIsGPU = mSurface->getCanvas()->recordingContext() != nullptr;
#ifdef DBG_UTIL
SkiaHelper::prefillSurface(mSurface);
#endif
@@ -346,7 +346,7 @@ void SkiaSalGraphicsImpl::createOffscreenSurface()
mSurface = SkiaHelper::createSkSurface(width, height);
if (mSurface)
{
- mIsGPU = mSurface->getCanvas()->getGrContext() != nullptr;
+ mIsGPU = mSurface->getCanvas()->recordingContext() != nullptr;
return;
}
}
@@ -358,7 +358,7 @@ void SkiaSalGraphicsImpl::createOffscreenSurface()
// Create raster surface as a fallback.
mSurface = SkiaHelper::createSkSurface(width, height);
assert(mSurface);
- assert(!mSurface->getCanvas()->getGrContext()); // is not GPU-backed
+ assert(!mSurface->getCanvas()->recordingContext()); // is not GPU-backed
mIsGPU = false;
}
@@ -410,7 +410,7 @@ void SkiaSalGraphicsImpl::postDraw()
}
SkiaZone::leave(); // matched in preDraw()
// If there's a problem with the GPU context, abort.
- if (GrContext* context = mSurface->getCanvas()->getGrContext())
+ if (GrDirectContext* context = GrAsDirectContext(mSurface->getCanvas()->recordingContext()))
{
// Running out of memory on the GPU technically could be possibly recoverable,
// but we don't know the exact status of the surface (and what has or has not been drawn to it),
diff --git a/vcl/skia/win/gdiimpl.cxx b/vcl/skia/win/gdiimpl.cxx
index 6b68571d6ab1..759ff1d477ec 100644
--- a/vcl/skia/win/gdiimpl.cxx
+++ b/vcl/skia/win/gdiimpl.cxx
@@ -22,7 +22,6 @@
#include <SkTypeface_win.h>
#include <SkFont.h>
#include <SkFontMgr.h>
-#include <SkFontLCDConfig.h>
#include <tools/sk_app/win/WindowContextFactory_win.h>
#include <tools/sk_app/WindowContext.h>
@@ -39,6 +38,9 @@ void WinSkiaSalGraphicsImpl::createWindowContext(bool forceRaster)
{
SkiaZone zone;
sk_app::DisplayParams displayParams;
+ initFontInfo();
+ displayParams.fSurfaceProps
+ = SkSurfaceProps(displayParams.fSurfaceProps.flags(), pixelGeometry);
switch (forceRaster ? SkiaHelper::RenderRaster : SkiaHelper::renderMethodToUse())
{
case SkiaHelper::RenderRaster:
@@ -209,10 +211,20 @@ bool WinSkiaSalGraphicsImpl::DrawTextLayout(const GenericSalLayout& rLayout)
return true;
}
+SkFont::Edging WinSkiaSalGraphicsImpl::fontEdging;
+SkPixelGeometry WinSkiaSalGraphicsImpl::pixelGeometry;
+bool WinSkiaSalGraphicsImpl::fontInfoDone = false;
+
SkFont::Edging WinSkiaSalGraphicsImpl::getFontEdging()
{
- if (fontEdgingDone)
- return fontEdging;
+ initFontInfo();
+ return fontEdging;
+}
+
+void WinSkiaSalGraphicsImpl::initFontInfo()
+{
+ if (fontInfoDone)
+ return;
// Skia needs to be explicitly told what kind of antialiasing should be used,
// get it from system settings. This does not actually matter for the text
// rendering itself, since Skia has been patched to simply use the setting
@@ -222,7 +234,7 @@ SkFont::Edging WinSkiaSalGraphicsImpl::getFontEdging()
// the glyphs will be rendered based on this setting (subpixel AA requires colors,
// others do not).
fontEdging = SkFont::Edging::kAlias;
- SkFontLCDConfig::LCDOrder lcdOrder = SkFontLCDConfig::kNONE_LCDOrder;
+ pixelGeometry = kUnknown_SkPixelGeometry;
BOOL set;
if (SystemParametersInfo(SPI_GETFONTSMOOTHING, 0, &set, 0) && set)
{
@@ -233,24 +245,23 @@ SkFont::Edging WinSkiaSalGraphicsImpl::getFontEdging()
fontEdging = SkFont::Edging::kSubpixelAntiAlias;
if (SystemParametersInfo(SPI_GETFONTSMOOTHINGORIENTATION, 0, &set2, 0)
&& set2 == FE_FONTSMOOTHINGORIENTATIONBGR)
- lcdOrder = SkFontLCDConfig::kBGR_LCDOrder;
+ // No idea how to tell if it's horizontal or vertical.
+ pixelGeometry = kBGR_H_SkPixelGeometry;
else
- lcdOrder = SkFontLCDConfig::kRGB_LCDOrder; // default
+ pixelGeometry = kRGB_H_SkPixelGeometry; // default
}
else
fontEdging = SkFont::Edging::kAntiAlias;
}
- SkFontLCDConfig::SetSubpixelOrder(lcdOrder);
// Cache this, it is actually visible a little bit when profiling.
- fontEdgingDone = true;
- return fontEdging;
+ fontInfoDone = true;
}
void WinSkiaSalGraphicsImpl::ClearDevFontCache()
{
dwriteFontMgr.reset();
dwriteDone = false;
- fontEdgingDone = false;
+ fontInfoDone = false;
}
SkiaCompatibleDC::SkiaCompatibleDC(SalGraphics& rGraphics, int x, int y, int width, int height)