From bb862a2bd2a7ff0680313553de2abf5239fed27b Mon Sep 17 00:00:00 2001 From: Brandon DeRosier Date: Tue, 2 Aug 2022 18:14:04 -0700 Subject: [PATCH 1/2] [Impeller] Move color-only blending functions and utilities into the shader library (#35111) --- ci/licenses_golden/licenses_flutter | 2 +- .../shader_lib/impeller/blending.glsl | 193 ++++++++++++++++++ .../shaders/blending/advanced_blend.glsl | 2 +- .../blending/advanced_blend_color.frag | 5 +- .../blending/advanced_blend_colorburn.frag | 24 +-- .../blending/advanced_blend_colordodge.frag | 24 +-- .../blending/advanced_blend_darken.frag | 5 +- .../blending/advanced_blend_difference.frag | 5 +- .../blending/advanced_blend_exclusion.frag | 5 +- .../blending/advanced_blend_hardlight.frag | 5 +- .../shaders/blending/advanced_blend_hue.frag | 5 +- .../blending/advanced_blend_lighten.frag | 5 +- .../blending/advanced_blend_luminosity.frag | 5 +- .../blending/advanced_blend_multiply.frag | 5 +- .../blending/advanced_blend_overlay.frag | 6 +- .../blending/advanced_blend_saturation.frag | 5 +- .../blending/advanced_blend_screen.frag | 5 +- .../blending/advanced_blend_softlight.frag | 13 +- .../blending/advanced_blend_utils.glsl | 55 ----- 19 files changed, 230 insertions(+), 144 deletions(-) create mode 100644 impeller/compiler/shader_lib/impeller/blending.glsl delete mode 100644 impeller/entity/shaders/blending/advanced_blend_utils.glsl diff --git a/ci/licenses_golden/licenses_flutter b/ci/licenses_golden/licenses_flutter index 2cfa26d8964bb..6d6fab596ba64 100644 --- a/ci/licenses_golden/licenses_flutter +++ b/ci/licenses_golden/licenses_flutter @@ -487,6 +487,7 @@ FILE: ../../../flutter/impeller/compiler/reflector.cc FILE: ../../../flutter/impeller/compiler/reflector.h FILE: ../../../flutter/impeller/compiler/runtime_stage_data.cc FILE: ../../../flutter/impeller/compiler/runtime_stage_data.h +FILE: ../../../flutter/impeller/compiler/shader_lib/impeller/blending.glsl FILE: ../../../flutter/impeller/compiler/shader_lib/impeller/branching.glsl FILE: ../../../flutter/impeller/compiler/shader_lib/impeller/color.glsl FILE: ../../../flutter/impeller/compiler/shader_lib/impeller/constants.glsl @@ -614,7 +615,6 @@ FILE: ../../../flutter/impeller/entity/shaders/blending/advanced_blend_overlay.f FILE: ../../../flutter/impeller/entity/shaders/blending/advanced_blend_saturation.frag FILE: ../../../flutter/impeller/entity/shaders/blending/advanced_blend_screen.frag FILE: ../../../flutter/impeller/entity/shaders/blending/advanced_blend_softlight.frag -FILE: ../../../flutter/impeller/entity/shaders/blending/advanced_blend_utils.glsl FILE: ../../../flutter/impeller/entity/shaders/blending/blend.frag FILE: ../../../flutter/impeller/entity/shaders/blending/blend.vert FILE: ../../../flutter/impeller/entity/shaders/border_mask_blur.frag diff --git a/impeller/compiler/shader_lib/impeller/blending.glsl b/impeller/compiler/shader_lib/impeller/blending.glsl new file mode 100644 index 0000000000000..f92e6bc4ab9a0 --- /dev/null +++ b/impeller/compiler/shader_lib/impeller/blending.glsl @@ -0,0 +1,193 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef BLENDING_GLSL_ +#define BLENDING_GLSL_ + +#include +#include + +//------------------------------------------------------------------------------ +/// HSV utilities. +/// + +float IPLuminosity(vec3 color) { + return color.r * 0.3 + color.g * 0.59 + color.b * 0.11; +} + +/// Scales the color's luma by the amount necessary to place the color +/// components in a 1-0 range. +vec3 IPClipColor(vec3 color) { + float lum = IPLuminosity(color); + float mn = min(min(color.r, color.g), color.b); + float mx = max(max(color.r, color.g), color.b); + // `lum - mn` and `mx - lum` will always be >= 0 in the following conditions, + // so adding a tiny value is enough to make these divisions safe. + if (mn < 0) { + color = lum + (((color - lum) * lum) / (lum - mn + kEhCloseEnough)); + } + if (mx > 1) { + color = lum + (((color - lum) * (1 - lum)) / (mx - lum + kEhCloseEnough)); + } + return color; +} + +vec3 IPSetLuminosity(vec3 color, float luminosity) { + float relative_lum = luminosity - IPLuminosity(color); + return IPClipColor(color + relative_lum); +} + +float IPSaturation(vec3 color) { + return max(max(color.r, color.g), color.b) - + min(min(color.r, color.g), color.b); +} + +vec3 IPSetSaturation(vec3 color, float saturation) { + float mn = min(min(color.r, color.g), color.b); + float mx = max(max(color.r, color.g), color.b); + return (mn < mx) ? ((color - mn) * saturation) / (mx - mn) : vec3(0); +} + +//------------------------------------------------------------------------------ +/// Color blend functions. +/// +/// These routines take two unpremultiplied RGB colors and output a third color. +/// They can be combined with any alpha compositing operation. When these blend +/// functions are used for drawing Entities in Impeller, the output is always +/// applied to the destination using `SourceOver` alpha compositing. +/// + +vec3 IPBlendScreen(vec3 dst, vec3 src) { + // https://www.w3.org/TR/compositing-1/#blendingscreen + return dst + src - (dst * src); +} + +vec3 IPBlendHardLight(vec3 dst, vec3 src) { + // https://www.w3.org/TR/compositing-1/#blendinghardlight + return IPVec3Choose(dst * (2 * src), IPBlendScreen(dst, 2 * src - 1), src); +} + +vec3 IPBlendOverlay(vec3 dst, vec3 src) { + // https://www.w3.org/TR/compositing-1/#blendingoverlay + // HardLight, but with reversed parameters. + return IPBlendHardLight(src, dst); +} + +vec3 IPBlendDarken(vec3 dst, vec3 src) { + // https://www.w3.org/TR/compositing-1/#blendingdarken + return min(dst, src); +} + +vec3 IPBlendLighten(vec3 dst, vec3 src) { + // https://www.w3.org/TR/compositing-1/#blendinglighten + return max(dst, src); +} + +vec3 IPBlendColorDodge(vec3 dst, vec3 src) { + // https://www.w3.org/TR/compositing-1/#blendingcolordodge + + vec3 color = min(vec3(1), dst / (1 - src)); + + if (dst.r < kEhCloseEnough) { + color.r = 0; + } + if (dst.g < kEhCloseEnough) { + color.g = 0; + } + if (dst.b < kEhCloseEnough) { + color.b = 0; + } + + if (1 - src.r < kEhCloseEnough) { + color.r = 1; + } + if (1 - src.g < kEhCloseEnough) { + color.g = 1; + } + if (1 - src.b < kEhCloseEnough) { + color.b = 1; + } + + return color; +} + +vec3 IPBlendColorBurn(vec3 dst, vec3 src) { + // https://www.w3.org/TR/compositing-1/#blendingcolorburn + + vec3 color = 1 - min(vec3(1), (1 - dst) / src); + + if (1 - dst.r < kEhCloseEnough) { + color.r = 1; + } + if (1 - dst.g < kEhCloseEnough) { + color.g = 1; + } + if (1 - dst.b < kEhCloseEnough) { + color.b = 1; + } + + if (src.r < kEhCloseEnough) { + color.r = 0; + } + if (src.g < kEhCloseEnough) { + color.g = 0; + } + if (src.b < kEhCloseEnough) { + color.b = 0; + } + + return color; +} + +vec3 IPBlendSoftLight(vec3 dst, vec3 src) { + // https://www.w3.org/TR/compositing-1/#blendingsoftlight + + vec3 D = IPVec3ChooseCutoff(((16 * dst - 12) * dst + 4) * dst, // + sqrt(dst), // + dst, // + 0.25); + + return IPVec3Choose(dst - (1 - 2 * src) * dst * (1 - dst), // + dst + (2 * src - 1) * (D - dst), // + src); +} + +vec3 IPBlendDifference(vec3 dst, vec3 src) { + // https://www.w3.org/TR/compositing-1/#blendingdifference + return abs(dst - src); +} + +vec3 IPBlendExclusion(vec3 dst, vec3 src) { + // https://www.w3.org/TR/compositing-1/#blendingexclusion + return dst + src - 2 * dst * src; +} + +vec3 IPBlendMultiply(vec3 dst, vec3 src) { + // https://www.w3.org/TR/compositing-1/#blendingmultiply + return dst * src; +} + +vec3 IPBlendHue(vec3 dst, vec3 src) { + // https://www.w3.org/TR/compositing-1/#blendinghue + return IPSetLuminosity(IPSetSaturation(src, IPSaturation(dst)), + IPLuminosity(dst)); +} + +vec3 IPBlendSaturation(vec3 dst, vec3 src) { + // https://www.w3.org/TR/compositing-1/#blendingsaturation + return IPSetLuminosity(IPSetSaturation(dst, IPSaturation(src)), + IPLuminosity(dst)); +} + +vec3 IPBlendColor(vec3 dst, vec3 src) { + // https://www.w3.org/TR/compositing-1/#blendingcolor + return IPSetLuminosity(src, IPLuminosity(dst)); +} + +vec3 IPBlendLuminosity(vec3 dst, vec3 src) { + // https://www.w3.org/TR/compositing-1/#blendingluminosity + return IPSetLuminosity(dst, IPLuminosity(src)); +} + +#endif diff --git a/impeller/entity/shaders/blending/advanced_blend.glsl b/impeller/entity/shaders/blending/advanced_blend.glsl index 64476c3fbdae9..57547ca5fe5f3 100644 --- a/impeller/entity/shaders/blending/advanced_blend.glsl +++ b/impeller/entity/shaders/blending/advanced_blend.glsl @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include +#include #include #include diff --git a/impeller/entity/shaders/blending/advanced_blend_color.frag b/impeller/entity/shaders/blending/advanced_blend_color.frag index 290e20adc72e5..225bd3f098122 100644 --- a/impeller/entity/shaders/blending/advanced_blend_color.frag +++ b/impeller/entity/shaders/blending/advanced_blend_color.frag @@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "advanced_blend_utils.glsl" +#include vec3 Blend(vec3 dst, vec3 src) { - // https://www.w3.org/TR/compositing-1/#blendingcolor - return SetLuminosity(src, Luminosity(dst)); + return IPBlendColor(dst, src); } #include "advanced_blend.glsl" diff --git a/impeller/entity/shaders/blending/advanced_blend_colorburn.frag b/impeller/entity/shaders/blending/advanced_blend_colorburn.frag index 464728895562c..95aac01645999 100644 --- a/impeller/entity/shaders/blending/advanced_blend_colorburn.frag +++ b/impeller/entity/shaders/blending/advanced_blend_colorburn.frag @@ -2,30 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "advanced_blend_utils.glsl" +#include vec3 Blend(vec3 dst, vec3 src) { - // https://www.w3.org/TR/compositing-1/#blendingcolorburn - vec3 color = 1 - min(vec3(1), (1 - dst) / src); - if (1 - dst.r < kEhCloseEnough) { - color.r = 1; - } - if (1 - dst.g < kEhCloseEnough) { - color.g = 1; - } - if (1 - dst.b < kEhCloseEnough) { - color.b = 1; - } - if (src.r < kEhCloseEnough) { - color.r = 0; - } - if (src.g < kEhCloseEnough) { - color.g = 0; - } - if (src.b < kEhCloseEnough) { - color.b = 0; - } - return color; + return IPBlendColorBurn(dst, src); } #include "advanced_blend.glsl" diff --git a/impeller/entity/shaders/blending/advanced_blend_colordodge.frag b/impeller/entity/shaders/blending/advanced_blend_colordodge.frag index f28a4f1026359..f11fc5e68584d 100644 --- a/impeller/entity/shaders/blending/advanced_blend_colordodge.frag +++ b/impeller/entity/shaders/blending/advanced_blend_colordodge.frag @@ -2,30 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "advanced_blend_utils.glsl" +#include vec3 Blend(vec3 dst, vec3 src) { - // https://www.w3.org/TR/compositing-1/#blendingcolordodge - vec3 color = min(vec3(1), dst / (1 - src)); - if (dst.r < kEhCloseEnough) { - color.r = 0; - } - if (dst.g < kEhCloseEnough) { - color.g = 0; - } - if (dst.b < kEhCloseEnough) { - color.b = 0; - } - if (1 - src.r < kEhCloseEnough) { - color.r = 1; - } - if (1 - src.g < kEhCloseEnough) { - color.g = 1; - } - if (1 - src.b < kEhCloseEnough) { - color.b = 1; - } - return color; + return IPBlendColorDodge(dst, src); } #include "advanced_blend.glsl" diff --git a/impeller/entity/shaders/blending/advanced_blend_darken.frag b/impeller/entity/shaders/blending/advanced_blend_darken.frag index bfc8cb20e22b9..286b7ff2912e6 100644 --- a/impeller/entity/shaders/blending/advanced_blend_darken.frag +++ b/impeller/entity/shaders/blending/advanced_blend_darken.frag @@ -2,9 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include + vec3 Blend(vec3 dst, vec3 src) { - // https://www.w3.org/TR/compositing-1/#blendingdarken - return min(dst, src); + return IPBlendDarken(dst, src); } #include "advanced_blend.glsl" diff --git a/impeller/entity/shaders/blending/advanced_blend_difference.frag b/impeller/entity/shaders/blending/advanced_blend_difference.frag index 7545bc08b55cd..9d9320fdffd78 100644 --- a/impeller/entity/shaders/blending/advanced_blend_difference.frag +++ b/impeller/entity/shaders/blending/advanced_blend_difference.frag @@ -2,9 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include + vec3 Blend(vec3 dst, vec3 src) { - // https://www.w3.org/TR/compositing-1/#blendingdifference - return abs(dst - src); + return IPBlendDifference(dst, src); } #include "advanced_blend.glsl" diff --git a/impeller/entity/shaders/blending/advanced_blend_exclusion.frag b/impeller/entity/shaders/blending/advanced_blend_exclusion.frag index a12e47e3d043b..7c2f9f92996ca 100644 --- a/impeller/entity/shaders/blending/advanced_blend_exclusion.frag +++ b/impeller/entity/shaders/blending/advanced_blend_exclusion.frag @@ -2,9 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include + vec3 Blend(vec3 dst, vec3 src) { - // https://www.w3.org/TR/compositing-1/#blendingexclusion - return dst + src - 2 * dst * src; + return IPBlendExclusion(dst, src); } #include "advanced_blend.glsl" diff --git a/impeller/entity/shaders/blending/advanced_blend_hardlight.frag b/impeller/entity/shaders/blending/advanced_blend_hardlight.frag index cbd109fc660fc..aa126dfdc7cc7 100644 --- a/impeller/entity/shaders/blending/advanced_blend_hardlight.frag +++ b/impeller/entity/shaders/blending/advanced_blend_hardlight.frag @@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "advanced_blend_utils.glsl" +#include vec3 Blend(vec3 dst, vec3 src) { - // https://www.w3.org/TR/compositing-1/#blendinghardlight - return BlendHardLight(dst, src); + return IPBlendHardLight(dst, src); } #include "advanced_blend.glsl" diff --git a/impeller/entity/shaders/blending/advanced_blend_hue.frag b/impeller/entity/shaders/blending/advanced_blend_hue.frag index bdcf6e2daf106..c0355b4b00d34 100644 --- a/impeller/entity/shaders/blending/advanced_blend_hue.frag +++ b/impeller/entity/shaders/blending/advanced_blend_hue.frag @@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "advanced_blend_utils.glsl" +#include vec3 Blend(vec3 dst, vec3 src) { - // https://www.w3.org/TR/compositing-1/#blendinghue - return SetLuminosity(SetSaturation(src, Saturation(dst)), Luminosity(dst)); + return IPBlendHue(dst, src); } #include "advanced_blend.glsl" diff --git a/impeller/entity/shaders/blending/advanced_blend_lighten.frag b/impeller/entity/shaders/blending/advanced_blend_lighten.frag index 1aca8cc4b7fcd..32f2df082b4f5 100644 --- a/impeller/entity/shaders/blending/advanced_blend_lighten.frag +++ b/impeller/entity/shaders/blending/advanced_blend_lighten.frag @@ -2,9 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include + vec3 Blend(vec3 dst, vec3 src) { - // https://www.w3.org/TR/compositing-1/#blendinglighten - return max(dst, src); + return IPBlendLighten(dst, src); } #include "advanced_blend.glsl" diff --git a/impeller/entity/shaders/blending/advanced_blend_luminosity.frag b/impeller/entity/shaders/blending/advanced_blend_luminosity.frag index 5faecd9e509aa..4ceae64493947 100644 --- a/impeller/entity/shaders/blending/advanced_blend_luminosity.frag +++ b/impeller/entity/shaders/blending/advanced_blend_luminosity.frag @@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "advanced_blend_utils.glsl" +#include vec3 Blend(vec3 dst, vec3 src) { - // https://www.w3.org/TR/compositing-1/#blendingluminosity - return SetLuminosity(dst, Luminosity(src)); + return IPBlendLuminosity(dst, src); } #include "advanced_blend.glsl" diff --git a/impeller/entity/shaders/blending/advanced_blend_multiply.frag b/impeller/entity/shaders/blending/advanced_blend_multiply.frag index 92656d23fa0a7..a2fd42b6c7d2e 100644 --- a/impeller/entity/shaders/blending/advanced_blend_multiply.frag +++ b/impeller/entity/shaders/blending/advanced_blend_multiply.frag @@ -2,9 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include + vec3 Blend(vec3 dst, vec3 src) { - // https://www.w3.org/TR/compositing-1/#blendingmultiply - return dst * src; + return IPBlendMultiply(dst, src); } #include "advanced_blend.glsl" diff --git a/impeller/entity/shaders/blending/advanced_blend_overlay.frag b/impeller/entity/shaders/blending/advanced_blend_overlay.frag index d6197f1103147..0837b91d8bfbd 100644 --- a/impeller/entity/shaders/blending/advanced_blend_overlay.frag +++ b/impeller/entity/shaders/blending/advanced_blend_overlay.frag @@ -2,12 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "advanced_blend_utils.glsl" +#include vec3 Blend(vec3 dst, vec3 src) { - // https://www.w3.org/TR/compositing-1/#blendinghardlight - // HardLight, but with reversed parameters. - return BlendHardLight(src, dst); + return IPBlendOverlay(dst, src); } #include "advanced_blend.glsl" diff --git a/impeller/entity/shaders/blending/advanced_blend_saturation.frag b/impeller/entity/shaders/blending/advanced_blend_saturation.frag index a127446db4aad..c3fd3bebc87d7 100644 --- a/impeller/entity/shaders/blending/advanced_blend_saturation.frag +++ b/impeller/entity/shaders/blending/advanced_blend_saturation.frag @@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "advanced_blend_utils.glsl" +#include vec3 Blend(vec3 dst, vec3 src) { - // https://www.w3.org/TR/compositing-1/#blendingsaturation - return SetLuminosity(SetSaturation(dst, Saturation(src)), Luminosity(dst)); + return IPBlendSaturation(dst, src); } #include "advanced_blend.glsl" diff --git a/impeller/entity/shaders/blending/advanced_blend_screen.frag b/impeller/entity/shaders/blending/advanced_blend_screen.frag index 7f059766abcf7..f65ab5db1d563 100644 --- a/impeller/entity/shaders/blending/advanced_blend_screen.frag +++ b/impeller/entity/shaders/blending/advanced_blend_screen.frag @@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "advanced_blend_utils.glsl" +#include vec3 Blend(vec3 dst, vec3 src) { - // https://www.w3.org/TR/compositing-1/#blendingscreen - return BlendScreen(dst, src); + return IPBlendScreen(dst, src); } #include "advanced_blend.glsl" diff --git a/impeller/entity/shaders/blending/advanced_blend_softlight.frag b/impeller/entity/shaders/blending/advanced_blend_softlight.frag index 2d7427ae89166..3a504afbb99c6 100644 --- a/impeller/entity/shaders/blending/advanced_blend_softlight.frag +++ b/impeller/entity/shaders/blending/advanced_blend_softlight.frag @@ -2,19 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "advanced_blend_utils.glsl" +#include vec3 Blend(vec3 dst, vec3 src) { - // https://www.w3.org/TR/compositing-1/#blendingsoftlight - - vec3 D = IPVec3ChooseCutoff(((16 * dst - 12) * dst + 4) * dst, // - sqrt(dst), // - dst, // - 0.25); - - return IPVec3Choose(dst - (1 - 2 * src) * dst * (1 - dst), // - dst + (2 * src - 1) * (D - dst), // - src); + return IPBlendSoftLight(dst, src); } #include "advanced_blend.glsl" diff --git a/impeller/entity/shaders/blending/advanced_blend_utils.glsl b/impeller/entity/shaders/blending/advanced_blend_utils.glsl deleted file mode 100644 index 55645331bba8f..0000000000000 --- a/impeller/entity/shaders/blending/advanced_blend_utils.glsl +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include -#include - -vec3 BlendScreen(vec3 dst, vec3 src) { - return dst + src - (dst * src); -} - -vec3 BlendHardLight(vec3 dst, vec3 src) { - return IPVec3Choose(dst * (2 * src), BlendScreen(dst, 2 * src - 1), src); -} - -//------------------------------------------------------------------------------ -// HSV utilities. -// - -float Luminosity(vec3 color) { - return color.r * 0.3 + color.g * 0.59 + color.b * 0.11; -} - -/// Scales the color's luma by the amount necessary to place the color -/// components in a 1-0 range. -vec3 ClipColor(vec3 color) { - float lum = Luminosity(color); - float mn = min(min(color.r, color.g), color.b); - float mx = max(max(color.r, color.g), color.b); - // `lum - mn` and `mx - lum` will always be >= 0 in the following conditions, - // so adding a tiny value is enough to make these divisions safe. - if (mn < 0) { - color = lum + (((color - lum) * lum) / (lum - mn + kEhCloseEnough)); - } - if (mx > 1) { - color = lum + (((color - lum) * (1 - lum)) / (mx - lum + kEhCloseEnough)); - } - return color; -} - -vec3 SetLuminosity(vec3 color, float luminosity) { - float relative_lum = luminosity - Luminosity(color); - return ClipColor(color + relative_lum); -} - -float Saturation(vec3 color) { - return max(max(color.r, color.g), color.b) - - min(min(color.r, color.g), color.b); -} - -vec3 SetSaturation(vec3 color, float saturation) { - float mn = min(min(color.r, color.g), color.b); - float mx = max(max(color.r, color.g), color.b); - return (mn < mx) ? ((color - mn) * saturation) / (mx - mn) : vec3(0); -} From c4564762773fb865d204475e10359c07de80ec60 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll Date: Tue, 2 Aug 2022 21:57:04 -0400 Subject: [PATCH 2/2] Roll Dart SDK from b2093ad90d66 to a8d90480d8ff (1 revision) (#35112) --- DEPS | 16 ++++++++-------- ci/licenses_golden/licenses_third_party | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/DEPS b/DEPS index 90c632e675329..790e5ffc085fe 100644 --- a/DEPS +++ b/DEPS @@ -36,7 +36,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/main/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': 'b2093ad90d6694b4b27bf6bb7362879b10a28d6f', + 'dart_revision': 'a8d90480d8ff19da05c6aa82307a38ee2b294326', # WARNING: DO NOT EDIT MANUALLY # The lines between blank lines above and below are generated by a script. See create_updated_flutter_deps.py @@ -46,11 +46,11 @@ vars = { 'dart_clock_rev': '2507a228773c5e877fc9e3330080b234aad965c0', 'dart_collection_rev': '414ffa1bc8ba18bd608bbf916d95715311d89ac1', 'dart_devtools_rev': 'd131d19091f6b89ac89486bd92440a25a523e8b0', - 'dart_protobuf_rev': '9aad6aadcc0fc616051c7e0eaef78c26b3dd7b60', + 'dart_protobuf_rev': '504eefeae9892602ea50c20159db1db3768012a9', 'dart_pub_rev': '9bf4289d6fd5d6872a8929d6312bbd7098f3ea9c', 'dart_root_certificates_rev': '692f6d6488af68e0121317a9c2c9eb393eb0ee50', 'dart_watcher_rev': 'e00c0ea769e32821d91c0880da8eb736839a6e6d', - 'dart_webdev_rev': '27cc5c9228ca59e721bc41fe7028e0fd6b995748', + 'dart_webdev_rev': '37bf4af1b0961f053e7cf4990a34ca5fd0ad0fd4', 'dart_webkit_inspection_protocol_rev': '57522d6b29d94903b765c757079d906555d5a171', 'dart_yaml_edit_rev': '01589b3ce447b03aed991db49f1ec6445ad5476d', 'dart_zlib_rev': '27c2f474b71d0d20764f86f60ef8b00da1a16cda', @@ -203,7 +203,7 @@ deps = { Var('dart_git') + '/dart_style.git@d7b73536a8079331c888b7da539b80e6825270ea', 'src/third_party/dart/third_party/pkg/dartdoc': - Var('dart_git') + '/dartdoc.git@d7513b2ee0a9bad6c9526f6b0ba970b4fcca17d0', + Var('dart_git') + '/dartdoc.git@7edeeeb20a506cadec3788c273fdee6cad91e07c', 'src/third_party/dart/third_party/pkg/ffi': Var('dart_git') + '/ffi.git@18b2b549d55009ff594600b04705ff6161681e07', @@ -227,7 +227,7 @@ deps = { Var('dart_git') + '/http_multi_server.git@20bf079c8955d1250a45afb9cb096472a724a551', 'src/third_party/dart/third_party/pkg/http_parser': - Var('dart_git') + '/http_parser.git@d25b3c9e7f23e31ac388a03361737110768597f6', + Var('dart_git') + '/http_parser.git@b968f7ddde0588273a6cbd1d2eb6569f418606ac', 'src/third_party/dart/third_party/pkg/json_rpc_2': Var('dart_git') + '/json_rpc_2.git@805e6536dd961d66f6b8cd46d8f3e61774f957c9', @@ -248,7 +248,7 @@ deps = { Var('dart_git') + '/mime.git@0a75a41445eb642674a0a271eecde78cb025ee60', 'src/third_party/dart/third_party/pkg/mockito': - Var('dart_git') + '/mockito.git@d8a2ddd2054390bd03d34bf64c940884e6f7a596', + Var('dart_git') + '/mockito.git@2acf22f4d400c6e1eee0f6ca595092220fba8b34', 'src/third_party/dart/third_party/pkg/oauth2': Var('dart_git') + '/oauth2.git@199ebf15cbd5b07958438184f32e41c4447a57bf', @@ -269,7 +269,7 @@ deps = { Var('dart_git') + '/pub.git' + '@' + Var('dart_pub_rev'), 'src/third_party/dart/third_party/pkg/pub_semver': - Var('dart_git') + '/pub_semver.git@5c0b4bfd5ca57fe16f1319c581dc8c882e9b8cb2', + Var('dart_git') + '/pub_semver.git@9fd28757ba45961ac5449e0f2b0020670e921475', 'src/third_party/dart/third_party/pkg/shelf': Var('dart_git') + '/shelf.git@0371a64bd3b99044ee3158bacf8813bba735a9c7', @@ -299,7 +299,7 @@ deps = { Var('dart_git') + '/term_glyph.git@ec7cf7bb51ebb7d55760a1359f6697690dbc06ba', 'src/third_party/dart/third_party/pkg/test': - Var('dart_git') + '/test.git@b144a336776eaa1f9420f3ab38214d8c061c663e', + Var('dart_git') + '/test.git@aba7de5851ace64f1f887369ae9424582d9d4d7f', 'src/third_party/dart/third_party/pkg/test_reflective_loader': Var('dart_git') + '/test_reflective_loader.git@8d0de01bbe852fea1f8e33aba907abcba50a8a1e', diff --git a/ci/licenses_golden/licenses_third_party b/ci/licenses_golden/licenses_third_party index cde3f12d8524e..2eeb58079ed3f 100644 --- a/ci/licenses_golden/licenses_third_party +++ b/ci/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 203f630cf725dd2a8c057dd8436dcb7c +Signature: 8311def9aedab010bc3f43706fd18193 UNUSED LICENSES: