diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-11-27 12:48:08 +0100 |
---|---|---|
committer | Michael Stahl <michael.stahl@cib.de> | 2019-11-27 14:13:11 +0100 |
commit | 59ef53fb95b19a22dd1d761a277809f3aff3fb2c (patch) | |
tree | dfd97bd5a932cc1413ec7d76e3f068e5aa189e46 /external | |
parent | ba7ecfabfef579f27025603bceaac7c6a69e56cb (diff) |
external/skia: C++20 comparison operator fix
Missing const leads to overload resolution ambiguity when a synthesized
candidate of operator == for a reversed-argument rewrite conflicts with the
actual operator ==, due to the asymmetric const-ness of the implicit object
parameter and the RHS parameter:
> In file included from workdir/UnpackedTarball/skia/src/shaders/SkLightingShader.cpp:15:
> In file included from workdir/UnpackedTarball/skia/src/core/SkReadBuffer.h:13:
> In file included from workdir/UnpackedTarball/skia/include/core/SkFont.h:13:
> In file included from workdir/UnpackedTarball/skia/include/core/SkTypeface.h:16:
> In file included from workdir/UnpackedTarball/skia/include/core/SkString.h:15:
> workdir/UnpackedTarball/skia/include/private/SkTArray.h:389:35: error: use of overloaded operator '!=' is ambiguous (with operand types 'SkLights::Light' and 'SkLights::Light')
> if (fItemArray[index] != right.fItemArray[index]) {
> ~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~
> workdir/UnpackedTarball/skia/src/shaders/SkLightingShader.cpp:268:35: note: in instantiation of member function 'SkTArray<SkLights::Light, false>::operator==' requested here
> return fDirectionalLights == lightingFP.fDirectionalLights &&
> ^
> workdir/UnpackedTarball/skia/src/shaders/SkLights.h:90:14: note: candidate function
> bool operator!=(const Light& other) { return !(this->operator==(other)); }
> ^
> workdir/UnpackedTarball/skia/src/shaders/SkLights.h:83:14: note: candidate function
> bool operator==(const Light& other) {
> ^
> workdir/UnpackedTarball/skia/src/shaders/SkLights.h:83:14: note: candidate function (with reversed parameter order)
Change-Id: I61b28e191b36f84df6920b4143809d1f497b9113
Reviewed-on: https://gerrit.libreoffice.org/83900
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Tested-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'external')
-rw-r--r-- | external/skia/UnpackedTarball_skia.mk | 3 | ||||
-rw-r--r-- | external/skia/c++20-comparison.patch.0 | 19 |
2 files changed, 21 insertions, 1 deletions
diff --git a/external/skia/UnpackedTarball_skia.mk b/external/skia/UnpackedTarball_skia.mk index 1d2da19c2b5b..22a1a0d40720 100644 --- a/external/skia/UnpackedTarball_skia.mk +++ b/external/skia/UnpackedTarball_skia.mk @@ -21,7 +21,8 @@ skia_patches := \ no-trace-resources-on-exit.patch.1 \ fix-alpha-difference-copy.patch.1 \ libvulkan-name.patch.1 \ - share-grcontext.patch.1 + share-grcontext.patch.1 \ + c++20-comparison.patch.0 \ $(eval $(call gb_UnpackedTarball_set_patchlevel,skia,1)) diff --git a/external/skia/c++20-comparison.patch.0 b/external/skia/c++20-comparison.patch.0 new file mode 100644 index 000000000000..86f0d7ff16e0 --- /dev/null +++ b/external/skia/c++20-comparison.patch.0 @@ -0,0 +1,19 @@ +--- src/shaders/SkLights.h ++++ src/shaders/SkLights.h +@@ -80,14 +80,14 @@ + return *this; + } + +- bool operator==(const Light& other) { ++ bool operator==(const Light& other) const { + return (fType == other.fType) && + (fColor == other.fColor) && + (fDirOrPos == other.fDirOrPos) && + (fIntensity == other.fIntensity); + } + +- bool operator!=(const Light& other) { return !(this->operator==(other)); } ++ bool operator!=(const Light& other) const { return !(this->operator==(other)); } + + private: + friend class SkLights; |