⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 284767 in webkit


Ignore:
Timestamp:
Oct 24, 2021, 1:43:41 PM (5 years ago)
Author:
Fujii Hironori
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.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r284763 r284767  
     12021-10-24  Fujii Hironori  <Hironori.Fujii@sony.com>
     2
     3        The code decoding std::optional<ImagePaintingOptions> can't be compiled by PlayStation due to the ImagePaintingOptions template constructor
     4        https://bugs.webkit.org/show_bug.cgi?id=231980
     5        <rdar://problem/84478389>
     6
     7        Reviewed by Darin Adler.
     8
     9        r284566 didn't actually fix the problem. The problem was that the
     10        first template argument of ImagePaintingOptions template construct
     11        can instantiated with std::optional<ImagePaintingOptions>. It
     12        should be a type of that setOption can take.
     13
     14        * platform/graphics/ImagePaintingOptions.h: Added a template
     15        variable isOptionType, and use it for SFINAE.
     16
    1172021-10-24  Darin Adler  <darin@apple.com>
    218
  • trunk/Source/WebCore/platform/graphics/ImagePaintingOptions.h

    r284566 r284767  
    3333
    3434struct ImagePaintingOptions {
    35     template<typename First, typename... Rest, typename = std::enable_if_t<!std::is_same_v<std::decay_t<First>, ImagePaintingOptions>>>
     35    template<typename Type> static constexpr bool isOptionType =
     36        std::is_same_v<Type, CompositeOperator>
     37        || std::is_same_v<Type, BlendMode>
     38        || std::is_same_v<Type, DecodingMode>
     39        || std::is_same_v<Type, ImageOrientation>
     40        || std::is_same_v<Type, ImageOrientation::Orientation>
     41        || std::is_same_v<Type, InterpolationQuality>;
     42
     43    template<typename First, typename... Rest, typename = std::enable_if_t<isOptionType<std::decay_t<First>>>>
    3644    ImagePaintingOptions(First first, Rest... rest)
    3745    {
Note: See TracChangeset for help on using the changeset viewer.