Files
loongoffice/external/skia/constexpr-debug-std-max.patch.1
Luboš Luňák 302fb4c1ec Revert "update Skia to chrome/m91" (tdf#141680)
The m91 snapshot seems to cause a number of Vulkan problems.
My commit already worked around one, but there are apparently
others, such as very slow startup, or a failed Skia assertion
triggered by VCL Skia's copyArea().

This reverts commit 09d850e46903a528d4b08d3fdf03c3964d79fbc5.

Change-Id: I4f1832ba76db15cab8eccbe115d21c989da3c841
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114089
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-04-14 18:54:32 +02:00

33 lines
884 B
Groff

diff --git a/src/sksl/SkSLASTNode.h b/src/sksl/SkSLASTNode.h
index e6d3015d33..d95b43a778 100644
--- a/src/sksl/SkSLASTNode.h
+++ b/src/sksl/SkSLASTNode.h
@@ -18,6 +18,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.
@@ -251,7 +263,7 @@ struct ASTNode {
};
struct NodeData {
- char fBytes[std::max({sizeof(Token::Kind),
+ char fBytes[skia_max({sizeof(Token::Kind),
sizeof(StringFragment),
sizeof(bool),
sizeof(SKSL_INT),