[webkit-changes] [WebKit/WebKit] fd9772: Build fix around std::variant in SourceBrush for C...

Žan Doberšek noreply at github.com
Thu Mar 30 10:38:03 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: fd977228c791d5cf767a1e5b4ed3596add8ed6d5
      https://github.com/WebKit/WebKit/commit/fd977228c791d5cf767a1e5b4ed3596add8ed6d5
  Author: Žan Doberšek <zdobersek at igalia.com>
  Date:   2023-03-30 (Thu, 30 Mar 2023)

  Changed paths:
    M Source/WebCore/platform/graphics/SourceBrush.cpp
    M Source/WebCore/platform/graphics/SourceBrush.h
    M Source/WebKit/Platform/IPC/ArgumentCoders.h

  Log Message:
  -----------
  Build fix around std::variant in SourceBrush for Clang/libstdc++
https://bugs.webkit.org/show_bug.cgi?id=254742

Unreviewed, build fix for the SourceBrush::Brush std::variant construction when
using Clang with libstdc++.

Things get mixed up when using Ref<Pattern> for constructing the variant, with
the compiler using it as initialization for the LogicalGradient type, the other
possible type in the variant, which ends up in a compile-time error.

This can be avoided by using the in-place tag when constructing the variant in
the SourceBrush::setPattern() method, specifying which variant-alternative type
should be used.

Similar fix for the same reasons is also needed in the decoding part of the
ArgumentCoder<std::variant<>> specialization, this being problematic due to the
SourceBrush::Brush decoding produced for the generated serializers purpose.
There the variant is constructed with the in-place tag that's based on the index
value of the alternative.

* Source/WebCore/platform/graphics/SourceBrush.cpp:
(WebCore::SourceBrush::setPattern):
* Source/WebCore/platform/graphics/SourceBrush.h:
* Source/WebKit/Platform/IPC/ArgumentCoders.h:

Canonical link: https://commits.webkit.org/262339@main




More information about the webkit-changes mailing list