Title: [284767] trunk/Source/WebCore
Revision
284767
Author
[email protected]
Date
2021-10-24 13:43:41 -0700 (Sun, 24 Oct 2021)

Log Message

The code decoding std::optional<ImagePaintingOptions> can't be compiled by PlayStation due to the ImagePaintingOptions template constructor
https://bugs.webkit.org/show_bug.cgi?id=231980
<rdar://problem/84478389>

Reviewed by Darin Adler.

r284566 didn't actually fix the problem. The problem was that the
first template argument of ImagePaintingOptions template construct
can instantiated with std::optional<ImagePaintingOptions>. It
should be a type of that setOption can take.

* platform/graphics/ImagePaintingOptions.h: Added a template
variable isOptionType, and use it for SFINAE.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (284766 => 284767)


--- trunk/Source/WebCore/ChangeLog	2021-10-24 20:39:35 UTC (rev 284766)
+++ trunk/Source/WebCore/ChangeLog	2021-10-24 20:43:41 UTC (rev 284767)
@@ -1,3 +1,19 @@
+2021-10-24  Fujii Hironori  <[email protected]>
+
+        The code decoding std::optional<ImagePaintingOptions> can't be compiled by PlayStation due to the ImagePaintingOptions template constructor
+        https://bugs.webkit.org/show_bug.cgi?id=231980
+        <rdar://problem/84478389>
+
+        Reviewed by Darin Adler.
+
+        r284566 didn't actually fix the problem. The problem was that the
+        first template argument of ImagePaintingOptions template construct
+        can instantiated with std::optional<ImagePaintingOptions>. It
+        should be a type of that setOption can take.
+
+        * platform/graphics/ImagePaintingOptions.h: Added a template
+        variable isOptionType, and use it for SFINAE.
+
 2021-10-24  Darin Adler  <[email protected]>
 
         [Cocoa] Adopt bridge_cast and makeVector in a few more places, including cases where adoptCF/NS was used incorrectly

Modified: trunk/Source/WebCore/platform/graphics/ImagePaintingOptions.h (284766 => 284767)


--- trunk/Source/WebCore/platform/graphics/ImagePaintingOptions.h	2021-10-24 20:39:35 UTC (rev 284766)
+++ trunk/Source/WebCore/platform/graphics/ImagePaintingOptions.h	2021-10-24 20:43:41 UTC (rev 284767)
@@ -32,7 +32,15 @@
 namespace WebCore {
 
 struct ImagePaintingOptions {
-    template<typename First, typename... Rest, typename = std::enable_if_t<!std::is_same_v<std::decay_t<First>, ImagePaintingOptions>>>
+    template<typename Type> static constexpr bool isOptionType =
+        std::is_same_v<Type, CompositeOperator>
+        || std::is_same_v<Type, BlendMode>
+        || std::is_same_v<Type, DecodingMode>
+        || std::is_same_v<Type, ImageOrientation>
+        || std::is_same_v<Type, ImageOrientation::Orientation>
+        || std::is_same_v<Type, InterpolationQuality>;
+
+    template<typename First, typename... Rest, typename = std::enable_if_t<isOptionType<std::decay_t<First>>>>
     ImagePaintingOptions(First first, Rest... rest)
     {
         setOption(first, rest...);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to