From 40a355a42d4a9444dc753c04c6608dade2f06a23 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:27 +0200 Subject: Adding upstream version 125.0.1. Signed-off-by: Daniel Baumann --- dom/canvas/WebGLQueueParamTraits.h | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'dom/canvas/WebGLQueueParamTraits.h') diff --git a/dom/canvas/WebGLQueueParamTraits.h b/dom/canvas/WebGLQueueParamTraits.h index db3ef0a44b..3c74f08750 100644 --- a/dom/canvas/WebGLQueueParamTraits.h +++ b/dom/canvas/WebGLQueueParamTraits.h @@ -67,8 +67,6 @@ inline constexpr bool IsEnumCase(const dom::WebGLPowerPreference raw) { case dom::WebGLPowerPreference::Low_power: case dom::WebGLPowerPreference::High_performance: return true; - case dom::WebGLPowerPreference::EndGuard_: - break; } return false; } @@ -78,8 +76,6 @@ inline constexpr bool IsEnumCase(const dom::PredefinedColorSpace raw) { case dom::PredefinedColorSpace::Srgb: case dom::PredefinedColorSpace::Display_p3: return true; - case dom::PredefinedColorSpace::EndGuard_: - break; } return false; } @@ -114,23 +110,21 @@ USE_IS_ENUM_CASE(webgl::ProvokingVertex) // Custom QueueParamTraits template -struct QueueParamTraits> { - using ParamType = RawBuffer; - +struct QueueParamTraits> { template - static bool Write(ProducerView& view, const ParamType& in) { + static bool Write(ProducerView& view, const Span& in) { const auto& elemCount = in.size(); auto status = view.WriteParam(elemCount); if (!status) return status; if (!elemCount) return status; - status = view.WriteFromRange(in.Data()); + status = view.WriteFromRange(Range{in}); return status; } template - static bool Read(ConsumerView& view, ParamType* const out) { + static bool Read(ConsumerView& view, Span* const out) { size_t elemCount = 0; auto status = view.ReadParam(&elemCount); if (!status) return status; @@ -140,9 +134,9 @@ struct QueueParamTraits> { return true; } - auto data = view.template ReadRange(elemCount); + auto data = view.template ReadRange(elemCount); if (!data) return false; - *out = std::move(RawBuffer{*data}); + *out = Span{*data}; return true; } }; -- cgit v1.2.3