diff --git a/ci/bin/format.dart b/ci/bin/format.dart index 6c49016737f56..9f6674c1ef69a 100644 --- a/ci/bin/format.dart +++ b/ci/bin/format.dart @@ -71,7 +71,7 @@ FormatCheck nameToFormatCheck(String name) { String formatCheckToName(FormatCheck check) { switch (check) { case FormatCheck.clang: - return 'C++/ObjC'; + return 'C++/ObjC/Shader'; case FormatCheck.gn: return 'GN'; case FormatCheck.java: @@ -301,7 +301,7 @@ abstract class FormatChecker { } } -/// Checks and formats C++/ObjC files using clang-format. +/// Checks and formats C++/ObjC/Shader files using clang-format. class ClangFormatChecker extends FormatChecker { ClangFormatChecker({ ProcessManager processManager = const LocalProcessManager(), @@ -350,7 +350,7 @@ class ClangFormatChecker extends FormatChecker { @override Future fixFormatting() async { - message('Fixing C++/ObjC formatting...'); + message('Fixing C++/ObjC/Shader formatting...'); final List failures = await _getCFormatFailures(fixing: true); if (failures.isEmpty) { return true; @@ -365,7 +365,7 @@ class ClangFormatChecker extends FormatChecker { } Future> _getCFormatFailures({bool fixing = false}) async { - message('Checking C++/ObjC formatting...'); + message('Checking C++/ObjC/Shader formatting...'); const List clangFiletypes = [ '*.c', '*.cc', @@ -374,10 +374,17 @@ class ClangFormatChecker extends FormatChecker { '*.h', '*.m', '*.mm', + '*.glsl', + '*.hlsl', + '*.comp', + '*.tese', + '*.tesc', + '*.vert', + '*.frag', ]; final List files = await getFileList(clangFiletypes); if (files.isEmpty) { - message('No C++/ObjC files with changes, skipping C++/ObjC format check.'); + message('No C++/ObjC/Shader files with changes, skipping C++/ObjC/Shader format check.'); return []; } if (verbose) { @@ -416,10 +423,10 @@ class ClangFormatChecker extends FormatChecker { if (failed.isNotEmpty) { final bool plural = failed.length > 1; if (fixing) { - message('Fixing ${failed.length} C++/ObjC file${plural ? 's' : ''}' + message('Fixing ${failed.length} C++/ObjC/Shader file${plural ? 's' : ''}' ' which ${plural ? 'were' : 'was'} formatted incorrectly.'); } else { - error('Found ${failed.length} C++/ObjC file${plural ? 's' : ''}' + error('Found ${failed.length} C++/ObjC/Shader file${plural ? 's' : ''}' ' which ${plural ? 'were' : 'was'} formatted incorrectly.'); stdout.writeln('To fix, run:'); stdout.writeln(); @@ -431,7 +438,7 @@ class ClangFormatChecker extends FormatChecker { stdout.writeln(); } } else { - message('Completed checking ${diffJobs.length} C++/ObjC files with no formatting problems.'); + message('Completed checking ${diffJobs.length} C++/ObjC/Shader files with no formatting problems.'); } return failed.map((WorkerJob job) { return job.result.stdout; diff --git a/impeller/compiler/shader_lib/impeller/texture.glsl b/impeller/compiler/shader_lib/impeller/texture.glsl index 447bedc22158d..d478a3a268cca 100644 --- a/impeller/compiler/shader_lib/impeller/texture.glsl +++ b/impeller/compiler/shader_lib/impeller/texture.glsl @@ -24,8 +24,12 @@ vec4 IPSample(sampler2D texture_sampler, vec2 coords, float y_coord_scale) { /// If `y_coord_scale` < 0.0, the Y coordinate is flipped. This is useful /// for Impeller graphics backends that use a flipped framebuffer coordinate /// space. -/// The range of `coods` will be mapped from [0, 1] to [half_texel, 1 - half_texel] -vec4 IPSampleLinear(sampler2D texture_sampler, vec2 coords, float y_coord_scale, vec2 half_texel) { +/// The range of `coods` will be mapped from [0, 1] to [half_texel, 1 - +/// half_texel] +vec4 IPSampleLinear(sampler2D texture_sampler, + vec2 coords, + float y_coord_scale, + vec2 half_texel) { coords.x = mix(half_texel.x, 1 - half_texel.x, coords.x); coords.y = mix(half_texel.y, 1 - half_texel.y, coords.y); return IPSample(texture_sampler, coords, y_coord_scale); @@ -79,7 +83,8 @@ vec4 IPSampleWithTileMode(sampler2D tex, return vec4(0); } - return IPSample(tex, IPVec2Tile(coords, x_tile_mode, y_tile_mode), y_coord_scale); + return IPSample(tex, IPVec2Tile(coords, x_tile_mode, y_tile_mode), + y_coord_scale); } /// Sample a texture, emulating a specific tile mode. @@ -97,7 +102,8 @@ vec4 IPSampleWithTileMode(sampler2D tex, /// /// This is useful for Impeller graphics backend that don't have native support /// for Decal. -/// The range of `coods` will be mapped from [0, 1] to [half_texel, 1 - half_texel] +/// The range of `coods` will be mapped from [0, 1] to [half_texel, 1 - +/// half_texel] vec4 IPSampleLinearWithTileMode(sampler2D tex, vec2 coords, float y_coord_scale, @@ -109,20 +115,23 @@ vec4 IPSampleLinearWithTileMode(sampler2D tex, return vec4(0); } - return IPSampleLinear(tex, IPVec2Tile(coords, x_tile_mode, y_tile_mode), y_coord_scale, half_texel); + return IPSampleLinear(tex, IPVec2Tile(coords, x_tile_mode, y_tile_mode), + y_coord_scale, half_texel); } /// Sample a texture, emulating a specific tile mode. /// /// This is useful for Impeller graphics backend that don't have native support /// for Decal. -/// The range of `coods` will be mapped from [0, 1] to [half_texel, 1 - half_texel] +/// The range of `coods` will be mapped from [0, 1] to [half_texel, 1 - +/// half_texel] vec4 IPSampleLinearWithTileMode(sampler2D tex, vec2 coords, float y_coord_scale, vec2 half_texel, float tile_mode) { - return IPSampleLinearWithTileMode(tex, coords, y_coord_scale, half_texel, tile_mode, tile_mode); + return IPSampleLinearWithTileMode(tex, coords, y_coord_scale, half_texel, + tile_mode, tile_mode); } #endif diff --git a/impeller/entity/shaders/blending/advanced_blend.glsl b/impeller/entity/shaders/blending/advanced_blend.glsl index 6ff1d93ab6810..a2b1650f904a2 100644 --- a/impeller/entity/shaders/blending/advanced_blend.glsl +++ b/impeller/entity/shaders/blending/advanced_blend.glsl @@ -12,7 +12,8 @@ uniform BlendInfo { float src_y_coord_scale; float color_factor; vec4 color; // This color input is expected to be unpremultiplied. -} blend_info; +} +blend_info; uniform sampler2D texture_sampler_dst; uniform sampler2D texture_sampler_src; @@ -28,7 +29,8 @@ void main() { v_dst_texture_coords, // texture coordinates blend_info.dst_y_coord_scale, // y coordinate scale kTileModeDecal // tile mode - ) * blend_info.dst_input_alpha; + ) * + blend_info.dst_input_alpha; vec4 dst = IPUnpremultiply(dst_sample); vec4 src = blend_info.color_factor > 0 @@ -43,5 +45,5 @@ void main() { vec4 blended = vec4(Blend(dst.rgb, src.rgb), 1) * dst.a; frag_color = mix(dst_sample, blended, src.a); - //frag_color = dst_sample; + // frag_color = dst_sample; } diff --git a/impeller/entity/shaders/blending/blend.frag b/impeller/entity/shaders/blending/blend.frag index c3f89be765349..468a9bb67f7ce 100644 --- a/impeller/entity/shaders/blending/blend.frag +++ b/impeller/entity/shaders/blending/blend.frag @@ -9,7 +9,8 @@ uniform sampler2D texture_sampler_src; uniform FragInfo { float texture_sampler_y_coord_scale; float input_alpha; -} frag_info; +} +frag_info; in vec2 v_texture_coords; @@ -18,5 +19,5 @@ out vec4 frag_color; void main() { frag_color = IPSample(texture_sampler_src, v_texture_coords, frag_info.texture_sampler_y_coord_scale) * - frag_info.input_alpha; + frag_info.input_alpha; } diff --git a/impeller/entity/shaders/blending/blend.vert b/impeller/entity/shaders/blending/blend.vert index daa30f5650a3f..36bea41e390d8 100644 --- a/impeller/entity/shaders/blending/blend.vert +++ b/impeller/entity/shaders/blending/blend.vert @@ -4,7 +4,8 @@ uniform FrameInfo { mat4 mvp; -} frame_info; +} +frame_info; in vec2 vertices; in vec2 texture_coords; diff --git a/impeller/entity/shaders/border_mask_blur.frag b/impeller/entity/shaders/border_mask_blur.frag index e9b56fa3cfe0a..85da0df8cdb76 100644 --- a/impeller/entity/shaders/border_mask_blur.frag +++ b/impeller/entity/shaders/border_mask_blur.frag @@ -18,7 +18,8 @@ uniform sampler2D texture_sampler; uniform FragInfo { float texture_sampler_y_coord_scale; -} frag_info; +} +frag_info; in vec2 v_texture_coords; in vec2 v_sigma_uv; diff --git a/impeller/entity/shaders/color_matrix_color_filter.frag b/impeller/entity/shaders/color_matrix_color_filter.frag index 43aa4c8c93976..c021a93604b28 100644 --- a/impeller/entity/shaders/color_matrix_color_filter.frag +++ b/impeller/entity/shaders/color_matrix_color_filter.frag @@ -7,7 +7,8 @@ // A color filter that transforms colors through a 4x5 color matrix. // -// This filter can be used to change the saturation of pixels, convert from YUV to RGB, etc. +// This filter can be used to change the saturation of pixels, convert from YUV +// to RGB, etc. // // 4x5 matrix for transforming the color and alpha components of a Bitmap. // The matrix can be passed as single array, and is treated as follows: @@ -24,14 +25,16 @@ // B’ = k*R + l*G + m*B + n*A + o; // A’ = p*R + q*G + r*B + s*A + t; // -// That resulting color [R’, G’, B’, A’] then has each channel clamped to the 0 to 255 range. +// That resulting color [R’, G’, B’, A’] then has each channel clamped to the 0 +// to 255 range. uniform FragInfo { mat4 color_m; vec4 color_v; float texture_sampler_y_coord_scale; float input_alpha; -} frag_info; +} +frag_info; uniform sampler2D input_texture; @@ -41,14 +44,13 @@ out vec4 frag_color; void main() { vec4 input_color = IPSample(input_texture, v_position, frag_info.texture_sampler_y_coord_scale) * - frag_info.input_alpha; - + frag_info.input_alpha; // unpremultiply first, as filter inputs are premultiplied. vec4 color = IPUnpremultiply(input_color); color = clamp(frag_info.color_m * color + frag_info.color_v, 0.0, 1.0); - + // premultiply the outputs frag_color = vec4(color.rgb * color.a, color.a); } diff --git a/impeller/entity/shaders/color_matrix_color_filter.vert b/impeller/entity/shaders/color_matrix_color_filter.vert index b741b2744ec60..29b0128258658 100644 --- a/impeller/entity/shaders/color_matrix_color_filter.vert +++ b/impeller/entity/shaders/color_matrix_color_filter.vert @@ -4,7 +4,8 @@ uniform FrameInfo { mat4 mvp; -} frame_info; +} +frame_info; in vec2 position; out vec2 v_position; diff --git a/impeller/entity/shaders/gradient_fill.vert b/impeller/entity/shaders/gradient_fill.vert index 4b793dbfa183d..86f4d1e228694 100644 --- a/impeller/entity/shaders/gradient_fill.vert +++ b/impeller/entity/shaders/gradient_fill.vert @@ -7,7 +7,8 @@ uniform FrameInfo { mat4 mvp; mat4 matrix; -} frame_info; +} +frame_info; in vec2 position; diff --git a/impeller/entity/shaders/linear_gradient_fill.frag b/impeller/entity/shaders/linear_gradient_fill.frag index 577dd7dbb4741..0986cfa750018 100644 --- a/impeller/entity/shaders/linear_gradient_fill.frag +++ b/impeller/entity/shaders/linear_gradient_fill.frag @@ -13,7 +13,8 @@ uniform GradientInfo { float texture_sampler_y_coord_scale; float alpha; vec2 half_texel; -} gradient_info; +} +gradient_info; in vec2 v_position; @@ -21,16 +22,13 @@ out vec4 frag_color; void main() { float len = length(gradient_info.end_point - gradient_info.start_point); - float dot = dot( - v_position - gradient_info.start_point, - gradient_info.end_point - gradient_info.start_point - ); + float dot = dot(v_position - gradient_info.start_point, + gradient_info.end_point - gradient_info.start_point); float t = dot / (len * len); frag_color = IPSampleLinearWithTileMode( - texture_sampler, - vec2(t, 0.5), - gradient_info.texture_sampler_y_coord_scale, - gradient_info.half_texel, - gradient_info.tile_mode); - frag_color = vec4(frag_color.xyz * frag_color.a, frag_color.a) * gradient_info.alpha; + texture_sampler, vec2(t, 0.5), + gradient_info.texture_sampler_y_coord_scale, gradient_info.half_texel, + gradient_info.tile_mode); + frag_color = + vec4(frag_color.xyz * frag_color.a, frag_color.a) * gradient_info.alpha; } diff --git a/impeller/entity/shaders/linear_gradient_ssbo_fill.frag b/impeller/entity/shaders/linear_gradient_ssbo_fill.frag index e8cc761c9046b..21041d7938550 100644 --- a/impeller/entity/shaders/linear_gradient_ssbo_fill.frag +++ b/impeller/entity/shaders/linear_gradient_ssbo_fill.frag @@ -7,7 +7,8 @@ readonly buffer ColorData { vec4 colors[]; -} color_data; +} +color_data; uniform GradientInfo { vec2 start_point; @@ -15,7 +16,8 @@ uniform GradientInfo { float alpha; float tile_mode; float colors_length; -} gradient_info; +} +gradient_info; in vec2 v_position; @@ -23,10 +25,8 @@ out vec4 frag_color; void main() { float len = length(gradient_info.end_point - gradient_info.start_point); - float dot = dot( - v_position - gradient_info.start_point, - gradient_info.end_point - gradient_info.start_point - ); + float dot = dot(v_position - gradient_info.start_point, + gradient_info.end_point - gradient_info.start_point); float t = dot / (len * len); if ((t < 0.0 || t > 1.0) && gradient_info.tile_mode == kTileModeDecal) { @@ -36,6 +36,8 @@ void main() { t = IPFloatTile(t, gradient_info.tile_mode); vec3 values = IPComputeFixedGradientValues(t, gradient_info.colors_length); - frag_color = mix(color_data.colors[int(values.x)], color_data.colors[int(values.y)], values.z); - frag_color = vec4(frag_color.xyz * frag_color.a, frag_color.a) * gradient_info.alpha; + frag_color = mix(color_data.colors[int(values.x)], + color_data.colors[int(values.y)], values.z); + frag_color = + vec4(frag_color.xyz * frag_color.a, frag_color.a) * gradient_info.alpha; } diff --git a/impeller/entity/shaders/linear_to_srgb_filter.frag b/impeller/entity/shaders/linear_to_srgb_filter.frag index e4fb50b1a2ead..0b2a68da12368 100644 --- a/impeller/entity/shaders/linear_to_srgb_filter.frag +++ b/impeller/entity/shaders/linear_to_srgb_filter.frag @@ -14,7 +14,8 @@ uniform sampler2D input_texture; uniform FragInfo { float texture_sampler_y_coord_scale; float input_alpha; -} frag_info; +} +frag_info; in vec2 v_position; out vec4 frag_color; @@ -22,7 +23,7 @@ out vec4 frag_color; void main() { vec4 input_color = IPSample(input_texture, v_position, frag_info.texture_sampler_y_coord_scale) * - frag_info.input_alpha; + frag_info.input_alpha; vec4 color = IPUnpremultiply(input_color); for (int i = 0; i < 3; i++) { diff --git a/impeller/entity/shaders/linear_to_srgb_filter.vert b/impeller/entity/shaders/linear_to_srgb_filter.vert index b741b2744ec60..29b0128258658 100644 --- a/impeller/entity/shaders/linear_to_srgb_filter.vert +++ b/impeller/entity/shaders/linear_to_srgb_filter.vert @@ -4,7 +4,8 @@ uniform FrameInfo { mat4 mvp; -} frame_info; +} +frame_info; in vec2 position; out vec2 v_position; diff --git a/impeller/entity/shaders/morphology_filter.frag b/impeller/entity/shaders/morphology_filter.frag index 8d35ab13186a1..27fa447baeb63 100644 --- a/impeller/entity/shaders/morphology_filter.frag +++ b/impeller/entity/shaders/morphology_filter.frag @@ -9,7 +9,7 @@ // 'FilterContents::MorphType' enum class. const float kMorphTypeDilate = 0; const float kMorphTypeErode = 1; - + uniform sampler2D texture_sampler; uniform FragInfo { @@ -30,13 +30,12 @@ void main() { for (float i = -frag_info.radius; i <= frag_info.radius; i++) { vec2 texture_coords = v_texture_coords + uv_offset * i; vec4 color; - color = - IPSampleWithTileMode( - texture_sampler, // sampler - texture_coords, // texture coordinates - frag_info.texture_sampler_y_coord_scale, // y coordinate scale - kTileModeDecal // tile mode - ); + color = IPSampleWithTileMode( + texture_sampler, // sampler + texture_coords, // texture coordinates + frag_info.texture_sampler_y_coord_scale, // y coordinate scale + kTileModeDecal // tile mode + ); if (frag_info.morph_type == kMorphTypeDilate) { result = max(color, result); } else { diff --git a/impeller/entity/shaders/position.vert b/impeller/entity/shaders/position.vert index 949fe02afd3f7..0b21229bcc05a 100644 --- a/impeller/entity/shaders/position.vert +++ b/impeller/entity/shaders/position.vert @@ -7,7 +7,8 @@ uniform VertInfo { mat4 mvp; vec4 color; -} vert_info; +} +vert_info; in vec2 position; diff --git a/impeller/entity/shaders/position_color.vert b/impeller/entity/shaders/position_color.vert index fe62e61474b7b..6b4ef7f642079 100644 --- a/impeller/entity/shaders/position_color.vert +++ b/impeller/entity/shaders/position_color.vert @@ -6,7 +6,8 @@ uniform VertInfo { mat4 mvp; -} vert_info; +} +vert_info; in vec2 position; in vec4 color; diff --git a/impeller/entity/shaders/position_uv.vert b/impeller/entity/shaders/position_uv.vert index cb8850b795173..f60ec0dd6453c 100644 --- a/impeller/entity/shaders/position_uv.vert +++ b/impeller/entity/shaders/position_uv.vert @@ -6,7 +6,8 @@ uniform VertInfo { mat4 mvp; -} vert_info; +} +vert_info; in vec2 position; in vec2 uv; diff --git a/impeller/entity/shaders/radial_gradient_fill.frag b/impeller/entity/shaders/radial_gradient_fill.frag index 31d3ae2463632..3414e8edc648c 100644 --- a/impeller/entity/shaders/radial_gradient_fill.frag +++ b/impeller/entity/shaders/radial_gradient_fill.frag @@ -13,7 +13,8 @@ uniform GradientInfo { float texture_sampler_y_coord_scale; float alpha; vec2 half_texel; -} gradient_info; +} +gradient_info; in vec2 v_position; @@ -23,10 +24,9 @@ void main() { float len = length(v_position - gradient_info.center); float t = len / gradient_info.radius; frag_color = IPSampleLinearWithTileMode( - texture_sampler, - vec2(t, 0.5), - gradient_info.texture_sampler_y_coord_scale, - gradient_info.half_texel, - gradient_info.tile_mode); - frag_color = vec4(frag_color.xyz * frag_color.a, frag_color.a) * gradient_info.alpha; + texture_sampler, vec2(t, 0.5), + gradient_info.texture_sampler_y_coord_scale, gradient_info.half_texel, + gradient_info.tile_mode); + frag_color = + vec4(frag_color.xyz * frag_color.a, frag_color.a) * gradient_info.alpha; } diff --git a/impeller/entity/shaders/radial_gradient_ssbo_fill.frag b/impeller/entity/shaders/radial_gradient_ssbo_fill.frag index b6ce052286102..9b129f661fae9 100644 --- a/impeller/entity/shaders/radial_gradient_ssbo_fill.frag +++ b/impeller/entity/shaders/radial_gradient_ssbo_fill.frag @@ -7,7 +7,8 @@ readonly buffer ColorData { vec4 colors[]; -} color_data; +} +color_data; uniform GradientInfo { vec2 center; @@ -15,7 +16,8 @@ uniform GradientInfo { float tile_mode; float alpha; float colors_length; -} gradient_info; +} +gradient_info; in vec2 v_position; @@ -32,6 +34,8 @@ void main() { t = IPFloatTile(t, gradient_info.tile_mode); vec3 values = IPComputeFixedGradientValues(t, gradient_info.colors_length); - frag_color = mix(color_data.colors[int(values.x)], color_data.colors[int(values.y)], values.z); - frag_color = vec4(frag_color.xyz * frag_color.a, frag_color.a) * gradient_info.alpha; + frag_color = mix(color_data.colors[int(values.x)], + color_data.colors[int(values.y)], values.z); + frag_color = + vec4(frag_color.xyz * frag_color.a, frag_color.a) * gradient_info.alpha; } diff --git a/impeller/entity/shaders/runtime_effect.vert b/impeller/entity/shaders/runtime_effect.vert index a29402d71e627..10a3cba4654db 100644 --- a/impeller/entity/shaders/runtime_effect.vert +++ b/impeller/entity/shaders/runtime_effect.vert @@ -4,7 +4,8 @@ uniform VertInfo { mat4 mvp; -} vert_info; +} +vert_info; in vec2 position; out vec2 v_position; diff --git a/impeller/entity/shaders/srgb_to_linear_filter.frag b/impeller/entity/shaders/srgb_to_linear_filter.frag index 7c524fe80c291..9e4f90e900900 100644 --- a/impeller/entity/shaders/srgb_to_linear_filter.frag +++ b/impeller/entity/shaders/srgb_to_linear_filter.frag @@ -13,7 +13,8 @@ uniform sampler2D input_texture; uniform FragInfo { float texture_sampler_y_coord_scale; float input_alpha; -} frag_info; +} +frag_info; in vec2 v_position; out vec4 frag_color; @@ -21,7 +22,7 @@ out vec4 frag_color; void main() { vec4 input_color = IPSample(input_texture, v_position, frag_info.texture_sampler_y_coord_scale) * - frag_info.input_alpha; + frag_info.input_alpha; vec4 color = IPUnpremultiply(input_color); for (int i = 0; i < 3; i++) { diff --git a/impeller/entity/shaders/srgb_to_linear_filter.vert b/impeller/entity/shaders/srgb_to_linear_filter.vert index b741b2744ec60..29b0128258658 100644 --- a/impeller/entity/shaders/srgb_to_linear_filter.vert +++ b/impeller/entity/shaders/srgb_to_linear_filter.vert @@ -4,7 +4,8 @@ uniform FrameInfo { mat4 mvp; -} frame_info; +} +frame_info; in vec2 position; out vec2 v_position; diff --git a/impeller/entity/shaders/sweep_gradient_fill.frag b/impeller/entity/shaders/sweep_gradient_fill.frag index 2fe042dd2c8c2..30cc3ec8a35dd 100644 --- a/impeller/entity/shaders/sweep_gradient_fill.frag +++ b/impeller/entity/shaders/sweep_gradient_fill.frag @@ -15,7 +15,8 @@ uniform GradientInfo { float texture_sampler_y_coord_scale; float alpha; vec2 half_texel; -} gradient_info; +} +gradient_info; in vec2 v_position; @@ -25,12 +26,12 @@ void main() { vec2 coord = v_position - gradient_info.center; float angle = atan(-coord.y, -coord.x); - float t = (angle * k1Over2Pi + 0.5 + gradient_info.bias) * gradient_info.scale; + float t = + (angle * k1Over2Pi + 0.5 + gradient_info.bias) * gradient_info.scale; frag_color = IPSampleLinearWithTileMode( - texture_sampler, - vec2(t, 0.5), - gradient_info.texture_sampler_y_coord_scale, - gradient_info.half_texel, - gradient_info.tile_mode); - frag_color = vec4(frag_color.xyz * frag_color.a, frag_color.a) * gradient_info.alpha; + texture_sampler, vec2(t, 0.5), + gradient_info.texture_sampler_y_coord_scale, gradient_info.half_texel, + gradient_info.tile_mode); + frag_color = + vec4(frag_color.xyz * frag_color.a, frag_color.a) * gradient_info.alpha; } diff --git a/impeller/entity/shaders/sweep_gradient_ssbo_fill.frag b/impeller/entity/shaders/sweep_gradient_ssbo_fill.frag index 129f4aa95c467..226a483c815bc 100644 --- a/impeller/entity/shaders/sweep_gradient_ssbo_fill.frag +++ b/impeller/entity/shaders/sweep_gradient_ssbo_fill.frag @@ -8,7 +8,8 @@ readonly buffer ColorData { vec4 colors[]; -} color_data; +} +color_data; uniform GradientInfo { vec2 center; @@ -17,7 +18,8 @@ uniform GradientInfo { float tile_mode; float alpha; float colors_length; -} gradient_info; +} +gradient_info; in vec2 v_position; @@ -26,7 +28,8 @@ out vec4 frag_color; void main() { vec2 coord = v_position - gradient_info.center; float angle = atan(-coord.y, -coord.x); - float t = (angle * k1Over2Pi + 0.5 + gradient_info.bias) * gradient_info.scale; + float t = + (angle * k1Over2Pi + 0.5 + gradient_info.bias) * gradient_info.scale; if ((t < 0.0 || t > 1.0) && gradient_info.tile_mode == kTileModeDecal) { frag_color = vec4(0); @@ -35,6 +38,8 @@ void main() { t = IPFloatTile(t, gradient_info.tile_mode); vec3 values = IPComputeFixedGradientValues(t, gradient_info.colors_length); - frag_color = mix(color_data.colors[int(values.x)], color_data.colors[int(values.y)], values.z); - frag_color = vec4(frag_color.xyz * frag_color.a, frag_color.a) * gradient_info.alpha; + frag_color = mix(color_data.colors[int(values.x)], + color_data.colors[int(values.y)], values.z); + frag_color = + vec4(frag_color.xyz * frag_color.a, frag_color.a) * gradient_info.alpha; } diff --git a/impeller/entity/shaders/tiled_texture_fill.frag b/impeller/entity/shaders/tiled_texture_fill.frag index 9892643517043..459742b768f80 100644 --- a/impeller/entity/shaders/tiled_texture_fill.frag +++ b/impeller/entity/shaders/tiled_texture_fill.frag @@ -26,5 +26,6 @@ void main() { frag_info.texture_sampler_y_coord_scale, // y coordinate scale frag_info.x_tile_mode, // x tile mode frag_info.y_tile_mode // y tile mode - ) * frag_info.alpha; + ) * + frag_info.alpha; } diff --git a/impeller/entity/shaders/yuv_to_rgb_filter.frag b/impeller/entity/shaders/yuv_to_rgb_filter.frag index b734b486024ab..73e416ce5b7ef 100644 --- a/impeller/entity/shaders/yuv_to_rgb_filter.frag +++ b/impeller/entity/shaders/yuv_to_rgb_filter.frag @@ -17,7 +17,8 @@ uniform FragInfo { float texture_sampler_y_coord_scale; mat4 matrix; float yuv_color_space; -} frag_info; +} +frag_info; in vec2 v_position; out vec4 frag_color; @@ -29,7 +30,11 @@ void main() { yuv_offset.x = 16.0 / 255.0; } - yuv.x = IPSample(y_texture, v_position, frag_info.texture_sampler_y_coord_scale).r; - yuv.yz = IPSample(uv_texture, v_position, frag_info.texture_sampler_y_coord_scale).rg; + yuv.x = + IPSample(y_texture, v_position, frag_info.texture_sampler_y_coord_scale) + .r; + yuv.yz = + IPSample(uv_texture, v_position, frag_info.texture_sampler_y_coord_scale) + .rg; frag_color = frag_info.matrix * vec4(yuv - yuv_offset, 1); } diff --git a/impeller/entity/shaders/yuv_to_rgb_filter.vert b/impeller/entity/shaders/yuv_to_rgb_filter.vert index b741b2744ec60..29b0128258658 100644 --- a/impeller/entity/shaders/yuv_to_rgb_filter.vert +++ b/impeller/entity/shaders/yuv_to_rgb_filter.vert @@ -4,7 +4,8 @@ uniform FrameInfo { mat4 mvp; -} frame_info; +} +frame_info; in vec2 position; out vec2 v_position; diff --git a/impeller/fixtures/box_fade.frag b/impeller/fixtures/box_fade.frag index 6e6b66bae1f0b..5acb1cba44f84 100644 --- a/impeller/fixtures/box_fade.frag +++ b/impeller/fixtures/box_fade.frag @@ -6,7 +6,8 @@ uniform FrameInfo { float current_time; vec2 cursor_position; vec2 window_size; -} frame_info; +} +frame_info; in vec2 interporlated_texture_coordinates; @@ -18,5 +19,7 @@ uniform sampler2D contents2; void main() { vec4 tex1 = texture(contents1, interporlated_texture_coordinates); vec4 tex2 = texture(contents2, interporlated_texture_coordinates); - frag_color = mix(tex1, tex2, clamp(frame_info.cursor_position.x / frame_info.window_size.x, 0.0, 1.0)); + frag_color = mix( + tex1, tex2, + clamp(frame_info.cursor_position.x / frame_info.window_size.x, 0.0, 1.0)); } diff --git a/impeller/fixtures/box_fade.vert b/impeller/fixtures/box_fade.vert index ac3674d80fbc7..05f52f3c70aff 100644 --- a/impeller/fixtures/box_fade.vert +++ b/impeller/fixtures/box_fade.vert @@ -4,7 +4,8 @@ uniform UniformBuffer { mat4 mvp; -} uniform_buffer; +} +uniform_buffer; in vec3 vertex_position; in vec2 texture_coordinates; diff --git a/impeller/fixtures/ink_sparkle.frag b/impeller/fixtures/ink_sparkle.frag index b8dea9bf0099f..6e2940cf1a402 100644 --- a/impeller/fixtures/ink_sparkle.frag +++ b/impeller/fixtures/ink_sparkle.frag @@ -31,7 +31,7 @@ layout(location = 0) out vec4 fragColor; const float PI = 3.1415926535897932384626; const float PI_ROTATE_RIGHT = PI * 0.0078125; const float PI_ROTATE_LEFT = PI * -0.0078125; -const float ONE_THIRD = 1./3.; +const float ONE_THIRD = 1. / 3.; const vec2 TURBULENCE_SCALE = vec2(0.8); float triangle_noise(highp vec2 n) { @@ -45,7 +45,7 @@ float threshold(float v, float l, float h) { return step(l, v) * (1.0 - step(h, v)); } -mat2 rotate2d(vec2 rad){ +mat2 rotate2d(vec2 rad) { return mat2(rad.x, -rad.y, rad.y, rad.x); } @@ -61,7 +61,11 @@ float soft_ring(vec2 uv, vec2 xy, float radius, float thickness, float blur) { return clamp(circle_outer - circle_inner, 0.0, 1.0); } -float circle_grid(vec2 resolution, vec2 p, vec2 xy, vec2 rotation, float cell_diameter) { +float circle_grid(vec2 resolution, + vec2 p, + vec2 xy, + vec2 rotation, + float cell_diameter) { p = rotate2d(rotation) * (xy - p) + xy; p = mod(p, cell_diameter) / resolution; float cell_uv = cell_diameter / resolution.y * 0.5; @@ -80,9 +84,12 @@ float sparkle(vec2 uv, float t) { float turbulence(vec2 uv) { vec2 uv_scale = uv * TURBULENCE_SCALE; - float g1 = circle_grid(TURBULENCE_SCALE, uv_scale, u_circle1, u_rotation1, 0.17); - float g2 = circle_grid(TURBULENCE_SCALE, uv_scale, u_circle2, u_rotation2, 0.2); - float g3 = circle_grid(TURBULENCE_SCALE, uv_scale, u_circle3, u_rotation3, 0.275); + float g1 = + circle_grid(TURBULENCE_SCALE, uv_scale, u_circle1, u_rotation1, 0.17); + float g2 = + circle_grid(TURBULENCE_SCALE, uv_scale, u_circle2, u_rotation2, 0.2); + float g3 = + circle_grid(TURBULENCE_SCALE, uv_scale, u_circle3, u_rotation3, 0.275); float v = (g1 * g1 + g2 - g3) * 0.5; return clamp(0.45 + 0.8 * v, 0.0, 1.0); } @@ -94,9 +101,12 @@ void main() { float radius = u_max_radius * u_radius_scale; float turbulence = turbulence(uv); float ring = soft_ring(p, u_center, radius, 0.05 * u_max_radius, u_blur); - float sparkle = sparkle(density_uv, u_noise_phase) * ring * turbulence * u_sparkle_alpha; - float wave_alpha = soft_circle(p, u_center, radius, u_blur) * u_alpha * u_color.a; + float sparkle = + sparkle(density_uv, u_noise_phase) * ring * turbulence * u_sparkle_alpha; + float wave_alpha = + soft_circle(p, u_center, radius, u_blur) * u_alpha * u_color.a; vec4 wave_color = vec4(u_color.rgb * wave_alpha, wave_alpha); - vec4 sparkle_color = vec4(u_sparkle_color.rgb * u_sparkle_color.a, u_sparkle_color.a); + vec4 sparkle_color = + vec4(u_sparkle_color.rgb * u_sparkle_color.a, u_sparkle_color.a); fragColor = mix(wave_color, sparkle_color, sparkle); } diff --git a/impeller/fixtures/instanced_draw.vert b/impeller/fixtures/instanced_draw.vert index 90890b198e575..9a674726cd900 100644 --- a/impeller/fixtures/instanced_draw.vert +++ b/impeller/fixtures/instanced_draw.vert @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - #ifdef IMPELLER_TARGET_OPENGLES void main() { @@ -13,22 +12,22 @@ void main() { uniform FrameInfo { mat4 mvp; -} frame_info; +} +frame_info; readonly buffer InstanceInfo { vec4 colors[]; -} instance_info; +} +instance_info; in vec2 vtx; out vec4 v_color; -void main () { - gl_Position = frame_info.mvp * - vec4(vtx.x + 105.0 * gl_InstanceIndex, - vtx.y + 105.0 * gl_InstanceIndex, - 0.0, - 1.0); +void main() { + gl_Position = + frame_info.mvp * vec4(vtx.x + 105.0 * gl_InstanceIndex, + vtx.y + 105.0 * gl_InstanceIndex, 0.0, 1.0); v_color = instance_info.colors[gl_InstanceIndex]; } diff --git a/impeller/fixtures/resources_limit.vert b/impeller/fixtures/resources_limit.vert index 95c84ee8bfc76..f3f9db8c3a504 100644 --- a/impeller/fixtures/resources_limit.vert +++ b/impeller/fixtures/resources_limit.vert @@ -3,7 +3,6 @@ // found in the LICENSE file. uniform sampler1D tex; -void main() -{ - vec4 x = textureOffset(tex, 1.0, -10); +void main() { + vec4 x = textureOffset(tex, 1.0, -10); } diff --git a/impeller/fixtures/runtime_stage_example.frag b/impeller/fixtures/runtime_stage_example.frag index 678cb95c263be..81ee6cd820518 100644 --- a/impeller/fixtures/runtime_stage_example.frag +++ b/impeller/fixtures/runtime_stage_example.frag @@ -8,8 +8,8 @@ layout(location = 1) uniform vec2 iResolution; layout(location = 0) out vec4 fragColor; void main() { - vec2 uv = gl_FragCoord.xy/iResolution; + vec2 uv = gl_FragCoord.xy / iResolution; float t = 4 * iTime; - vec3 col = 0.5 + 0.5*cos(t + uv.xyx + vec3(0,1,4)); - fragColor = vec4(col,1.0); + vec3 col = 0.5 + 0.5 * cos(t + uv.xyx + vec3(0, 1, 4)); + fragColor = vec4(col, 1.0); } diff --git a/impeller/fixtures/sa%m#ple.vert b/impeller/fixtures/sa%m#ple.vert index fc7e9d1122000..746824ec0adee 100644 --- a/impeller/fixtures/sa%m#ple.vert +++ b/impeller/fixtures/sa%m#ple.vert @@ -6,7 +6,8 @@ uniform UniformBufferObject { Uniforms uniforms; -} ubo; +} +ubo; uniform sampler2D world; @@ -18,6 +19,8 @@ in float stuff; out vec4 outStuff; void main() { - gl_Position = ubo.uniforms.projection * ubo.uniforms.view * ubo.uniforms.model * vec4(inPosition22, 1.0) * inAnotherPosition; + gl_Position = ubo.uniforms.projection * ubo.uniforms.view * + ubo.uniforms.model * vec4(inPosition22, 1.0) * + inAnotherPosition; outStuff = texture(world, inPosition); } diff --git a/impeller/fixtures/sample.comp b/impeller/fixtures/sample.comp index a0a0f1661a01e..c5dc05d743c22 100644 --- a/impeller/fixtures/sample.comp +++ b/impeller/fixtures/sample.comp @@ -8,26 +8,29 @@ struct SomeStruct { layout(binding = 0) writeonly buffer Output { vec4 elements[]; -} output_data; +} +output_data; layout(binding = 1) readonly buffer Input0 { int some_int; ivec2 fixed_array[3]; vec4 elements[]; -} input_data0; +} +input_data0; layout(binding = 2) readonly buffer Input1 { SomeStruct some_struct; uvec2 fixed_array[4]; vec4 elements[]; -} input_data1; +} +input_data1; uniform Info { uint count; -} info; +} +info; -void main() -{ +void main() { uint ident = gl_GlobalInvocationID.x; // TODO(dnfield): https://github.com/flutter/flutter/issues/112683 // We should be able to use length here instead of an extra arrgument. @@ -35,8 +38,12 @@ void main() return; } - output_data.elements[ident] = input_data0.elements[ident] * input_data1.elements[ident]; - output_data.elements[ident].x += input_data0.fixed_array[1].x + input_data1.some_struct.i; - output_data.elements[ident].y += input_data1.fixed_array[0].y + input_data1.some_struct.vf.x; - output_data.elements[ident].z += input_data0.some_int + input_data1.some_struct.vf.y; + output_data.elements[ident] = + input_data0.elements[ident] * input_data1.elements[ident]; + output_data.elements[ident].x += + input_data0.fixed_array[1].x + input_data1.some_struct.i; + output_data.elements[ident].y += + input_data1.fixed_array[0].y + input_data1.some_struct.vf.x; + output_data.elements[ident].z += + input_data0.some_int + input_data1.some_struct.vf.y; } diff --git a/impeller/fixtures/sample.tesc b/impeller/fixtures/sample.tesc index 6eb4156e21966..d6fe50408fe7a 100644 --- a/impeller/fixtures/sample.tesc +++ b/impeller/fixtures/sample.tesc @@ -1,5 +1,5 @@ layout(vertices = 4) out; void main() { - gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position; + gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position; } diff --git a/impeller/fixtures/sample.tese b/impeller/fixtures/sample.tese index b1d3108fd2c3a..b47a8775e4416 100644 --- a/impeller/fixtures/sample.tese +++ b/impeller/fixtures/sample.tese @@ -1,4 +1,4 @@ -layout (quads, equal_spacing, ccw) in; +layout(quads, equal_spacing, ccw) in; void main() { float u = gl_TessCoord.x; @@ -6,9 +6,7 @@ void main() { float v = gl_TessCoord.y; float omv = 1 - v; - gl_Position = - omu * omv * gl_in[0].gl_Position + - u * omv * gl_in[1].gl_Position + - u * v * gl_in[2].gl_Position + - omu * v * gl_in[3].gl_Position; + gl_Position = omu * omv * gl_in[0].gl_Position + + u * omv * gl_in[1].gl_Position + u * v * gl_in[2].gl_Position + + omu * v * gl_in[3].gl_Position; } diff --git a/impeller/fixtures/sample.vert b/impeller/fixtures/sample.vert index fc7e9d1122000..746824ec0adee 100644 --- a/impeller/fixtures/sample.vert +++ b/impeller/fixtures/sample.vert @@ -6,7 +6,8 @@ uniform UniformBufferObject { Uniforms uniforms; -} ubo; +} +ubo; uniform sampler2D world; @@ -18,6 +19,8 @@ in float stuff; out vec4 outStuff; void main() { - gl_Position = ubo.uniforms.projection * ubo.uniforms.view * ubo.uniforms.model * vec4(inPosition22, 1.0) * inAnotherPosition; + gl_Position = ubo.uniforms.projection * ubo.uniforms.view * + ubo.uniforms.model * vec4(inPosition22, 1.0) * + inAnotherPosition; outStuff = texture(world, inPosition); } diff --git a/impeller/fixtures/sample_with_binding.vert b/impeller/fixtures/sample_with_binding.vert index c713700b3536d..97c01fe8359aa 100644 --- a/impeller/fixtures/sample_with_binding.vert +++ b/impeller/fixtures/sample_with_binding.vert @@ -4,9 +4,10 @@ #include "types.h" -layout (set = 3, binding = 17) uniform UniformBufferObject { +layout(set = 3, binding = 17) uniform UniformBufferObject { Uniforms uniforms; -} ubo; +} +ubo; uniform sampler2D world; @@ -18,6 +19,8 @@ in float stuff; out vec4 outStuff; void main() { - gl_Position = ubo.uniforms.projection * ubo.uniforms.view * ubo.uniforms.model * vec4(inPosition22, 1.0) * inAnotherPosition; + gl_Position = ubo.uniforms.projection * ubo.uniforms.view * + ubo.uniforms.model * vec4(inPosition22, 1.0) * + inAnotherPosition; outStuff = texture(world, inPosition); } diff --git a/impeller/fixtures/struct_def_bug.vert b/impeller/fixtures/struct_def_bug.vert index 2781034a7c3c0..69d5eb063652e 100644 --- a/impeller/fixtures/struct_def_bug.vert +++ b/impeller/fixtures/struct_def_bug.vert @@ -6,10 +6,12 @@ uniform FrameInfo { mat4 mvp; vec2 atlas_size; vec4 text_color; -} frame_info; +} +frame_info; in vec2 unit_vertex; -in mat4 glyph_position; // <--- Causes multiple slots to be used and is a failure. +in mat4 + glyph_position; // <--- Causes multiple slots to be used and is a failure. in vec2 destination_size; in vec2 source_position; in vec2 source_glyph_size; @@ -21,9 +23,8 @@ out vec2 v_atlas_size; out vec4 v_text_color; void main() { - gl_Position = frame_info.mvp - * glyph_position - * vec4(unit_vertex.x * destination_size.x, + gl_Position = frame_info.mvp * glyph_position * + vec4(unit_vertex.x * destination_size.x, unit_vertex.y * destination_size.y, 0.0, 1.0); v_unit_vertex = unit_vertex; diff --git a/impeller/fixtures/test_texture.vert b/impeller/fixtures/test_texture.vert index 24b7ae6b13b7f..0b8c99e7f7fb9 100644 --- a/impeller/fixtures/test_texture.vert +++ b/impeller/fixtures/test_texture.vert @@ -4,11 +4,11 @@ uniform FrameInfo { mat4 mvp; -} frame_info; +} +frame_info; in vec2 vtx; void main() { gl_Position = frame_info.mvp * vec4(vtx, 0.0, 1.0); - } diff --git a/lib/ui/fixtures/shaders/general_shaders/blue_green_sampler.frag b/lib/ui/fixtures/shaders/general_shaders/blue_green_sampler.frag index 4d71cbb91c216..8cff5d531da58 100644 --- a/lib/ui/fixtures/shaders/general_shaders/blue_green_sampler.frag +++ b/lib/ui/fixtures/shaders/general_shaders/blue_green_sampler.frag @@ -6,9 +6,9 @@ precision highp float; -layout ( location = 0 ) out vec4 oColor; +layout(location = 0) out vec4 oColor; -layout ( location = 0 ) uniform sampler2D iChild; +layout(location = 0) uniform sampler2D iChild; void main() { // iChild1 is an image that is half blue, half green, @@ -16,4 +16,3 @@ void main() { oColor = texture(iChild, vec2(1, 0)); oColor.a = 1.0; } - diff --git a/lib/ui/fixtures/shaders/general_shaders/children_and_uniforms.frag b/lib/ui/fixtures/shaders/general_shaders/children_and_uniforms.frag index 44928b864cad3..41bb1556535e3 100644 --- a/lib/ui/fixtures/shaders/general_shaders/children_and_uniforms.frag +++ b/lib/ui/fixtures/shaders/general_shaders/children_and_uniforms.frag @@ -6,12 +6,12 @@ precision highp float; -layout ( location = 0 ) out vec4 color; +layout(location = 0) out vec4 color; -layout ( location = 0 ) uniform sampler2D child1; -layout ( location = 1 ) uniform float a; -layout ( location = 2 ) uniform sampler2D child2; -layout ( location = 3 ) uniform float b; +layout(location = 0) uniform sampler2D child1; +layout(location = 1) uniform float a; +layout(location = 2) uniform sampler2D child2; +layout(location = 3) uniform float b; void main() { // child1 is a 10x10 image where the left half is blue and the right @@ -23,4 +23,3 @@ void main() { color = c1 * c2; } - diff --git a/lib/ui/fixtures/shaders/general_shaders/functions.frag b/lib/ui/fixtures/shaders/general_shaders/functions.frag index 52bf92dbcc1cb..29201527b7d62 100644 --- a/lib/ui/fixtures/shaders/general_shaders/functions.frag +++ b/lib/ui/fixtures/shaders/general_shaders/functions.frag @@ -6,9 +6,9 @@ precision highp float; -layout ( location = 0 ) out vec4 oColor; +layout(location = 0) out vec4 oColor; -layout ( location = 0 ) uniform float a; // should be 1.0 +layout(location = 0) uniform float a; // should be 1.0 float addA(float x) { return x + a; @@ -27,8 +27,8 @@ float multiParam(float x, float y, float z) { } void main() { - float x = addA(0.0); // x = 0 + 1; - vec3 v3 = composedFunction(x); // v3 = vec3(2, 1, 1); - x = multiParam(v3.x, v3.y, v3.z); // x = 2 * 1 * 1 * 1; - oColor = vec4(0.0, x / 2.0, 0.0, 1.0); // vec4(0, 1, 0, 1); + float x = addA(0.0); // x = 0 + 1; + vec3 v3 = composedFunction(x); // v3 = vec3(2, 1, 1); + x = multiParam(v3.x, v3.y, v3.z); // x = 2 * 1 * 1 * 1; + oColor = vec4(0.0, x / 2.0, 0.0, 1.0); // vec4(0, 1, 0, 1); } diff --git a/lib/ui/fixtures/shaders/general_shaders/no_builtin_redefinition.frag b/lib/ui/fixtures/shaders/general_shaders/no_builtin_redefinition.frag index 4e74fe27b86b2..ae3fa0c94c9bd 100644 --- a/lib/ui/fixtures/shaders/general_shaders/no_builtin_redefinition.frag +++ b/lib/ui/fixtures/shaders/general_shaders/no_builtin_redefinition.frag @@ -6,9 +6,9 @@ precision highp float; -layout ( location = 0 ) out vec4 oColor; +layout(location = 0) out vec4 oColor; -layout ( location = 0 ) uniform float a; // should be 1.0 +layout(location = 0) uniform float a; // should be 1.0 float saturate(float x) { return clamp(x, 0.0, 1.0); @@ -31,8 +31,8 @@ float multiParam(float x, float y, float z) { } void main() { - float x = saturate(addA(0.0)); // x = 0 + 1; - vec3 v3 = composedFunction(x); // v3 = vec3(2, 1, 1); - x = multiParam(v3.x, v3.y, v3.z); // x = 2 * 1 * 1 * 1; - oColor = vec4(0.0, x / 2.0, 0.0, 1.0); // vec4(0, 1, 0, 1); + float x = saturate(addA(0.0)); // x = 0 + 1; + vec3 v3 = composedFunction(x); // v3 = vec3(2, 1, 1); + x = multiParam(v3.x, v3.y, v3.z); // x = 2 * 1 * 1 * 1; + oColor = vec4(0.0, x / 2.0, 0.0, 1.0); // vec4(0, 1, 0, 1); } diff --git a/lib/ui/fixtures/shaders/general_shaders/no_uniforms.frag b/lib/ui/fixtures/shaders/general_shaders/no_uniforms.frag index a88db93039f7d..26a8d7c265934 100644 --- a/lib/ui/fixtures/shaders/general_shaders/no_uniforms.frag +++ b/lib/ui/fixtures/shaders/general_shaders/no_uniforms.frag @@ -9,5 +9,5 @@ precision highp float; layout(location = 0) out vec4 fragColor; void main() { - fragColor = vec4(0.0, 1.0, 0.0, 1.0); + fragColor = vec4(0.0, 1.0, 0.0, 1.0); } diff --git a/lib/ui/fixtures/shaders/general_shaders/simple.frag b/lib/ui/fixtures/shaders/general_shaders/simple.frag index a221a4f8c2b94..a89fe54cf147e 100644 --- a/lib/ui/fixtures/shaders/general_shaders/simple.frag +++ b/lib/ui/fixtures/shaders/general_shaders/simple.frag @@ -11,5 +11,5 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - fragColor = vec4(0.0, a, 0.0, 1.0); + fragColor = vec4(0.0, a, 0.0, 1.0); } diff --git a/lib/ui/fixtures/shaders/general_shaders/uniform_arrays.frag b/lib/ui/fixtures/shaders/general_shaders/uniform_arrays.frag index c1efea1833672..6a7a3e374fa5f 100644 --- a/lib/ui/fixtures/shaders/general_shaders/uniform_arrays.frag +++ b/lib/ui/fixtures/shaders/general_shaders/uniform_arrays.frag @@ -6,12 +6,12 @@ precision highp float; -layout ( location = 0 ) out vec4 oColor; +layout(location = 0) out vec4 oColor; -layout ( location = 1 ) uniform float floatArray[2]; -layout ( location = 3 ) uniform vec2 vec2Array[2]; -layout ( location = 7 ) uniform vec3 vec3Array[2]; -layout ( location = 13 ) uniform mat2 mat2Array[2]; +layout(location = 1) uniform float floatArray[2]; +layout(location = 3) uniform vec2 vec2Array[2]; +layout(location = 7) uniform vec3 vec3Array[2]; +layout(location = 13) uniform mat2 mat2Array[2]; void main() { vec4 badColor = vec4(1.0, 0, 0, 1.0); @@ -20,16 +20,11 @@ void main() { // The test populates the uniforms with strictly increasing values, so if // out-of-order values are read out of the uniforms, then the bad color that // causes the test to fail is returned. - if (floatArray[0] >= floatArray[1] || - floatArray[1] >= vec2Array[0].x || - vec2Array[0].x >= vec2Array[0].y || - vec2Array[0].y >= vec2Array[1].x || - vec2Array[1].x >= vec2Array[1].y || - vec2Array[1].y >= vec3Array[0].x || - vec3Array[0].x >= vec3Array[0].y || - vec3Array[0].y >= vec3Array[0].z || - vec3Array[0].z >= vec3Array[1].x || - vec3Array[1].x >= vec3Array[1].y || + if (floatArray[0] >= floatArray[1] || floatArray[1] >= vec2Array[0].x || + vec2Array[0].x >= vec2Array[0].y || vec2Array[0].y >= vec2Array[1].x || + vec2Array[1].x >= vec2Array[1].y || vec2Array[1].y >= vec3Array[0].x || + vec3Array[0].x >= vec3Array[0].y || vec3Array[0].y >= vec3Array[0].z || + vec3Array[0].z >= vec3Array[1].x || vec3Array[1].x >= vec3Array[1].y || vec3Array[1].y >= vec3Array[1].z || vec3Array[1].z >= mat2Array[0][0][0] || mat2Array[0][0][0] >= mat2Array[0][0][1] || diff --git a/lib/ui/fixtures/shaders/general_shaders/uniforms.frag b/lib/ui/fixtures/shaders/general_shaders/uniforms.frag index c03032c97b156..dac982c9a4b99 100644 --- a/lib/ui/fixtures/shaders/general_shaders/uniforms.frag +++ b/lib/ui/fixtures/shaders/general_shaders/uniforms.frag @@ -6,11 +6,11 @@ precision highp float; -layout ( location = 0 ) out vec4 oColor; +layout(location = 0) out vec4 oColor; -layout ( location = 0 ) uniform float iFloatUniform; -layout ( location = 1 ) uniform vec2 iVec2Uniform; -layout ( location = 2 ) uniform mat2 iMat2Uniform; +layout(location = 0) uniform float iFloatUniform; +layout(location = 1) uniform vec2 iVec2Uniform; +layout(location = 2) uniform mat2 iMat2Uniform; void main() { oColor = vec4(iFloatUniform, iVec2Uniform, iMat2Uniform[1][1]); diff --git a/lib/ui/fixtures/shaders/general_shaders/uniforms_sorted.frag b/lib/ui/fixtures/shaders/general_shaders/uniforms_sorted.frag index 827fc18ce39a5..2d2d7f6fac280 100644 --- a/lib/ui/fixtures/shaders/general_shaders/uniforms_sorted.frag +++ b/lib/ui/fixtures/shaders/general_shaders/uniforms_sorted.frag @@ -36,7 +36,7 @@ layout(location = 0) out vec4 fragColor; const float PI = 3.1415926535897932384626; const float PI_ROTATE_RIGHT = PI * 0.0078125; const float PI_ROTATE_LEFT = PI * -0.0078125; -const float ONE_THIRD = 1./3.; +const float ONE_THIRD = 1. / 3.; const vec2 TURBULENCE_SCALE = vec2(0.8); float triangle_noise(highp vec2 n) { @@ -50,7 +50,7 @@ float threshold(float v, float l, float h) { return step(l, v) * (1.0 - step(h, v)); } -mat2 rotate2d(vec2 rad){ +mat2 rotate2d(vec2 rad) { return mat2(rad.x, -rad.y, rad.y, rad.x); } @@ -66,7 +66,11 @@ float soft_ring(vec2 uv, vec2 xy, float radius, float thickness, float blur) { return clamp(circle_outer - circle_inner, 0.0, 1.0); } -float circle_grid(vec2 resolution, vec2 p, vec2 xy, vec2 rotation, float cell_diameter) { +float circle_grid(vec2 resolution, + vec2 p, + vec2 xy, + vec2 rotation, + float cell_diameter) { p = rotate2d(rotation) * (xy - p) + xy; p = mod(p, cell_diameter) / resolution; float cell_uv = cell_diameter / resolution.y * 0.5; @@ -85,9 +89,12 @@ float sparkle(vec2 uv, float t) { float turbulence(vec2 uv) { vec2 uv_scale = uv * TURBULENCE_SCALE; - float g1 = circle_grid(TURBULENCE_SCALE, uv_scale, u_circle1, u_rotation1, 0.17); - float g2 = circle_grid(TURBULENCE_SCALE, uv_scale, u_circle2, u_rotation2, 0.2); - float g3 = circle_grid(TURBULENCE_SCALE, uv_scale, u_circle3, u_rotation3, 0.275); + float g1 = + circle_grid(TURBULENCE_SCALE, uv_scale, u_circle1, u_rotation1, 0.17); + float g2 = + circle_grid(TURBULENCE_SCALE, uv_scale, u_circle2, u_rotation2, 0.2); + float g3 = + circle_grid(TURBULENCE_SCALE, uv_scale, u_circle3, u_rotation3, 0.275); float v = (g1 * g1 + g2 - g3) * 0.5; return clamp(0.45 + 0.8 * v, 0.0, 1.0); } @@ -101,33 +108,28 @@ void main() { float radius = u_max_radius * u_radius_scale; float turbulence = turbulence(uv); float ring = soft_ring(p, u_center, radius, 0.05 * u_max_radius, u_blur); - float sparkle = sparkle(density_uv, u_noise_phase) * ring * turbulence * u_sparkle_alpha; - float wave_alpha = soft_circle(p, u_center, radius, u_blur) * u_alpha * u_color.a; + float sparkle = + sparkle(density_uv, u_noise_phase) * ring * turbulence * u_sparkle_alpha; + float wave_alpha = + soft_circle(p, u_center, radius, u_blur) * u_alpha * u_color.a; vec4 wave_color = vec4(u_color.rgb * wave_alpha, wave_alpha); - vec4 sparkle_color = vec4(u_sparkle_color.rgb * u_sparkle_color.a, u_sparkle_color.a); + vec4 sparkle_color = + vec4(u_sparkle_color.rgb * u_sparkle_color.a, u_sparkle_color.a); fragColor = mix(wave_color, sparkle_color, sparkle); vec4 badColor = vec4(1.0, 0, 0, 1.0); vec4 goodColor = vec4(0, 1.0, 0, 1.0); - if (u_color.x > u_alpha || - u_alpha > u_sparkle_color.x || - u_sparkle_color.x > u_sparkle_alpha || - u_sparkle_alpha > u_blur || - u_blur > u_center.x || - u_center.x > u_radius_scale || - u_radius_scale > u_max_radius || - u_max_radius > u_resolution_scale.x || + if (u_color.x > u_alpha || u_alpha > u_sparkle_color.x || + u_sparkle_color.x > u_sparkle_alpha || u_sparkle_alpha > u_blur || + u_blur > u_center.x || u_center.x > u_radius_scale || + u_radius_scale > u_max_radius || u_max_radius > u_resolution_scale.x || u_resolution_scale.x > u_noise_scale.x || - u_noise_scale.x > u_noise_phase || - u_noise_phase > u_circle1.x || - u_circle1.x > u_circle2.x || - u_circle2.x > u_circle3.x || - u_circle3.x > u_rotation1.x || - u_rotation1.x > u_rotation2.x || + u_noise_scale.x > u_noise_phase || u_noise_phase > u_circle1.x || + u_circle1.x > u_circle2.x || u_circle2.x > u_circle3.x || + u_circle3.x > u_rotation1.x || u_rotation1.x > u_rotation2.x || u_rotation2.x > u_rotation3.x) { fragColor = badColor; } else { fragColor = goodColor; } } - diff --git a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/10_fract.frag b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/10_fract.frag index bdf14300f07f1..4c9c443737552 100644 --- a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/10_fract.frag +++ b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/10_fract.frag @@ -11,11 +11,7 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - fragColor = vec4( - fract(a), - // 0.25 + 0.75 = 1.0 - fract(a + 1.25) + fract(3.75), - 0.0, - 1.0 - ); + fragColor = vec4(fract(a), + // 0.25 + 0.75 = 1.0 + fract(a + 1.25) + fract(3.75), 0.0, 1.0); } diff --git a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/11_radians.frag b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/11_radians.frag index 1a8fd54311ddc..fafdac1ef3a3a 100644 --- a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/11_radians.frag +++ b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/11_radians.frag @@ -11,11 +11,7 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - fragColor = vec4( - 0.0, - // 57.2957795131 * pi / 180.0 = 1.0 - float(radians(a * 57.2957795131)), - 0.0, - 1.0 - ); + fragColor = vec4(0.0, + // 57.2957795131 * pi / 180.0 = 1.0 + float(radians(a * 57.2957795131)), 0.0, 1.0); } diff --git a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/12_degrees.frag b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/12_degrees.frag index ca185e63435cf..f04cdcfbe4caf 100644 --- a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/12_degrees.frag +++ b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/12_degrees.frag @@ -11,11 +11,7 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - fragColor = vec4( - 0.0, - // 0.01745329251 * 180.0 / pi = 1.0 - degrees(a * 0.01745329251), - 0.0, - 1.0 - ); + fragColor = vec4(0.0, + // 0.01745329251 * 180.0 / pi = 1.0 + degrees(a * 0.01745329251), 0.0, 1.0); } diff --git a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/13_sin.frag b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/13_sin.frag index 6c89587ea5fc5..0ca8ab798d7d9 100644 --- a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/13_sin.frag +++ b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/13_sin.frag @@ -11,11 +11,9 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - fragColor = vec4( - /* sin(0.0) = 0.0 */ - sin(0.0), - // sin(1.57079632679) = sin(pi / 2.0) = 1.0 - sin(a * 1.57079632679), - 0.0, - 1.0); + fragColor = vec4( + /* sin(0.0) = 0.0 */ + sin(0.0), + // sin(1.57079632679) = sin(pi / 2.0) = 1.0 + sin(a * 1.57079632679), 0.0, 1.0); } diff --git a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/14_cos.frag b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/14_cos.frag index 52600b964e2a3..17a478cffbece 100644 --- a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/14_cos.frag +++ b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/14_cos.frag @@ -11,11 +11,9 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - fragColor = vec4( - /* cos(1.57079632679) = cos(pi / 2.0) = 0.0 */ - cos(a * 1.57079632679), - // cos(0.0) = 0.0 - cos(0.0), - 0.0, - 1.0); + fragColor = vec4( + /* cos(1.57079632679) = cos(pi / 2.0) = 0.0 */ + cos(a * 1.57079632679), + // cos(0.0) = 0.0 + cos(0.0), 0.0, 1.0); } diff --git a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/15_tan.frag b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/15_tan.frag index c5cbbd406369b..c93ec0d078aa3 100644 --- a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/15_tan.frag +++ b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/15_tan.frag @@ -11,12 +11,9 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - fragColor = vec4( - // tan(0.0) = 0.0 - tan(0.0), - // tan(1.57079632679) = tan(pi / 4.0) = 1.0 - tan(a * 0.785398163), - 0.0, - 1.0 - ); + fragColor = vec4( + // tan(0.0) = 0.0 + tan(0.0), + // tan(1.57079632679) = tan(pi / 4.0) = 1.0 + tan(a * 0.785398163), 0.0, 1.0); } diff --git a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/16_asin.frag b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/16_asin.frag index 92880cda929ab..976c7ddbca04e 100644 --- a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/16_asin.frag +++ b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/16_asin.frag @@ -11,11 +11,9 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - fragColor = vec4( - /* sin(0.0) = 0.0 */ - asin(0.0), - // sin(1.0) = 0.8414709848 - asin(a * 0.8414709848), - 0.0, - 1.0); + fragColor = vec4( + /* sin(0.0) = 0.0 */ + asin(0.0), + // sin(1.0) = 0.8414709848 + asin(a * 0.8414709848), 0.0, 1.0); } diff --git a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/17_acos.frag b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/17_acos.frag index 6d0f7eb05f98a..d8f159adab80a 100644 --- a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/17_acos.frag +++ b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/17_acos.frag @@ -11,12 +11,9 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - fragColor = vec4( - // cos(0.0) = 1.0 - acos(1.0), - // cos(1.0) = 0.54030230586 - acos(a * 0.54030230586), - 0.0, - 1.0 - ); + fragColor = vec4( + // cos(0.0) = 1.0 + acos(1.0), + // cos(1.0) = 0.54030230586 + acos(a * 0.54030230586), 0.0, 1.0); } diff --git a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/18_atan.frag b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/18_atan.frag index 68f5b4968a863..e1146c794cd7e 100644 --- a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/18_atan.frag +++ b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/18_atan.frag @@ -11,12 +11,9 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - fragColor = vec4( - // tan(0.0) = 0.0 - atan(0.0), - // tan(1.0) = 1.55740772465 - atan(a * 1.55740772465), - 0.0, - 1.0 - ); + fragColor = vec4( + // tan(0.0) = 0.0 + atan(0.0), + // tan(1.0) = 1.55740772465 + atan(a * 1.55740772465), 0.0, 1.0); } diff --git a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/25_atan2.frag b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/25_atan2.frag index 2e42d9fd9c349..054a5551a475b 100644 --- a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/25_atan2.frag +++ b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/25_atan2.frag @@ -11,12 +11,9 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - fragColor = vec4( - // tan(0.0 / 1.0) = tan(0.0) = 0.0 - atan(0.0, 1.0), - // tan(3.1148154493 / 2.0) = tan(1.55740772465) = 1.0 - atan(a * 3.1148154493, 2.0), - 0.0, - 1.0 - ); + fragColor = vec4( + // tan(0.0 / 1.0) = tan(0.0) = 0.0 + atan(0.0, 1.0), + // tan(3.1148154493 / 2.0) = tan(1.55740772465) = 1.0 + atan(a * 3.1148154493, 2.0), 0.0, 1.0); } diff --git a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/26_pow.frag b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/26_pow.frag index ea808bd7a5794..1a5d26afd98aa 100644 --- a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/26_pow.frag +++ b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/26_pow.frag @@ -11,11 +11,5 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - fragColor = vec4( - pow(2.0, a-1.0) - 1.0, - pow(a * 3.14, 0.0), - 0.0, - 1.0 - ); + fragColor = vec4(pow(2.0, a - 1.0) - 1.0, pow(a * 3.14, 0.0), 0.0, 1.0); } - diff --git a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/27_exp.frag b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/27_exp.frag index 61f476c7c54ca..e8ca170396692 100644 --- a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/27_exp.frag +++ b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/27_exp.frag @@ -11,12 +11,10 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - fragColor = vec4( - 0.0, - // e^0.0 = 1.0 - exp(a * 0.0), - 0.0, - // e^2.0 - 6.38905609893 = 7.38905609893 - 6.38905609893 = 1.0 - exp(a * 2.0) - 6.38905609893 - ); + fragColor = + vec4(0.0, + // e^0.0 = 1.0 + exp(a * 0.0), 0.0, + // e^2.0 - 6.38905609893 = 7.38905609893 - 6.38905609893 = 1.0 + exp(a * 2.0) - 6.38905609893); } diff --git a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/28_log.frag b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/28_log.frag index c4f3b9955cbeb..62b98f5151974 100644 --- a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/28_log.frag +++ b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/28_log.frag @@ -11,12 +11,9 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - fragColor = vec4( - // e^0.0 = 1.0 - log(a), - // e^1.0 = e - log(a * 2.718281828459), - 0.0, - 1.0 - ); + fragColor = vec4( + // e^0.0 = 1.0 + log(a), + // e^1.0 = e + log(a * 2.718281828459), 0.0, 1.0); } diff --git a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/29_exp2.frag b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/29_exp2.frag index d6c4251a892bc..395265100cfb0 100644 --- a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/29_exp2.frag +++ b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/29_exp2.frag @@ -11,13 +11,9 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - fragColor = vec4( - 0.0, - // 2.0^0.0 = 1.0 - exp2(a - 1.0), - 0.0, - // 2.0^3.0 - 7.0 = 8.0 - 7.0 = 1.0 - exp2(a * 3.0) - 7.0 - ); + fragColor = vec4(0.0, + // 2.0^0.0 = 1.0 + exp2(a - 1.0), 0.0, + // 2.0^3.0 - 7.0 = 8.0 - 7.0 = 1.0 + exp2(a * 3.0) - 7.0); } - diff --git a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/30_log2.frag b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/30_log2.frag index 5a1e8579831c1..dfd5b8ced6048 100644 --- a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/30_log2.frag +++ b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/30_log2.frag @@ -11,12 +11,9 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - fragColor = vec4( - // 2.0^0.0 = 1.0 - log2(a), - // 2.0^1.0 = 2.0 - log2(a * 2.0), - 0.0, - 1.0 - ); + fragColor = vec4( + // 2.0^0.0 = 1.0 + log2(a), + // 2.0^1.0 = 2.0 + log2(a * 2.0), 0.0, 1.0); } diff --git a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/31_sqrt.frag b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/31_sqrt.frag index 59892ab260199..c8253ce976754 100644 --- a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/31_sqrt.frag +++ b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/31_sqrt.frag @@ -11,11 +11,5 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - fragColor = vec4( - sqrt(a - 1.0), - sqrt(a), - sqrt(a * 9.0) - 3.0, - 1.0 - ); + fragColor = vec4(sqrt(a - 1.0), sqrt(a), sqrt(a * 9.0) - 3.0, 1.0); } - diff --git a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/32_inversesqrt.frag b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/32_inversesqrt.frag index d84c38910bda2..b8ff3fbb278f5 100644 --- a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/32_inversesqrt.frag +++ b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/32_inversesqrt.frag @@ -11,12 +11,9 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - fragColor = vec4( - 0.0, - // 1.0 / sqrt(1.0) = 1.0 - inversesqrt(a), - 0.0, - // 1.0 / sqrt(4.0) + 0.5 = 1.0 / 2.0 + 0.5 = 1.0 - inversesqrt(a * 4.0) + 0.5 - ); + fragColor = vec4(0.0, + // 1.0 / sqrt(1.0) = 1.0 + inversesqrt(a), 0.0, + // 1.0 / sqrt(4.0) + 0.5 = 1.0 / 2.0 + 0.5 = 1.0 + inversesqrt(a * 4.0) + 0.5); } diff --git a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/37_fmin.frag b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/37_fmin.frag index 9dbea871c9a80..72516fc5381cd 100644 --- a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/37_fmin.frag +++ b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/37_fmin.frag @@ -11,10 +11,5 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - fragColor = vec4( - 0.0, - 1.0 - min(1.0, 1.0-a), - 0.0, - 1.0 - ); + fragColor = vec4(0.0, 1.0 - min(1.0, 1.0 - a), 0.0, 1.0); } diff --git a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/40_fmax.frag b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/40_fmax.frag index 621d56ae0ca4d..1b5c8d18533c8 100644 --- a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/40_fmax.frag +++ b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/40_fmax.frag @@ -11,10 +11,5 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - fragColor = vec4( - 0.0, - max(a, 0.5), - 0.0, - 1.0); + fragColor = vec4(0.0, max(a, 0.5), 0.0, 1.0); } - diff --git a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/43_fclamp.frag b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/43_fclamp.frag index 62674d91d0e62..0ba699b8ce0dc 100644 --- a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/43_fclamp.frag +++ b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/43_fclamp.frag @@ -12,11 +12,5 @@ layout(location = 0) uniform float a; // clamp(x, a, b) is equivalent to min(max(x, a), b) void main() { - fragColor = vec4( - 0.0, - clamp(10.0, 0.0, a), - 0.0, - clamp(-1.0, a, 10.0) - ); + fragColor = vec4(0.0, clamp(10.0, 0.0, a), 0.0, clamp(-1.0, a, 10.0)); } - diff --git a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/46_fmix.frag b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/46_fmix.frag index 2176d0126da94..0ef7d6da390e4 100644 --- a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/46_fmix.frag +++ b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/46_fmix.frag @@ -11,10 +11,5 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - fragColor = vec4( - 0.0, - mix(0.0, 1.0, a), - 0.0, - mix(1.0, 0.0, 1.0 - a)); + fragColor = vec4(0.0, mix(0.0, 1.0, a), 0.0, mix(1.0, 0.0, 1.0 - a)); } - diff --git a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/48_step.frag b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/48_step.frag index 2a550e664cfae..79d6ab30e4c78 100644 --- a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/48_step.frag +++ b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/48_step.frag @@ -10,12 +10,8 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; -// 0.0 is returned if x (second param) < edge (first param), and 1.0 is returned otherwise. +// 0.0 is returned if x (second param) < edge (first param), and 1.0 is returned +// otherwise. void main() { - fragColor = vec4( - 0.0, - step(0.5, a), - 0.0, - 1.0 - ); + fragColor = vec4(0.0, step(0.5, a), 0.0, 1.0); } diff --git a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/49_smoothstep.frag b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/49_smoothstep.frag index 2863ed92a8838..ae3fc5f3d8e2a 100644 --- a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/49_smoothstep.frag +++ b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/49_smoothstep.frag @@ -17,12 +17,9 @@ layout(location = 0) uniform float a; // return t * t * (3.0 - 2.0 * t); // } void main() { - fragColor = vec4( - // smoothstep(1.0, 5.0, 3.0) is 0.5, subtract to get 0.0 - smoothstep(a, 5.0, 3.0) - 0.5, - // smoothstep(0.0, 2.0, 1.0) is 0.5, add 0.5 to get 1.0 - smoothstep(0.0, 2.0, a) + 0.5, - 0.0, - 1.0 - ); + fragColor = vec4( + // smoothstep(1.0, 5.0, 3.0) is 0.5, subtract to get 0.0 + smoothstep(a, 5.0, 3.0) - 0.5, + // smoothstep(0.0, 2.0, 1.0) is 0.5, add 0.5 to get 1.0 + smoothstep(0.0, 2.0, a) + 0.5, 0.0, 1.0); } diff --git a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/4_abs.frag b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/4_abs.frag index 0a6fc2c8facd0..bbce4808ab35c 100644 --- a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/4_abs.frag +++ b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/4_abs.frag @@ -11,10 +11,5 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - fragColor = vec4( - 0.0, - abs(-a), - 0.0, - 1.0 - ); + fragColor = vec4(0.0, abs(-a), 0.0, 1.0); } diff --git a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/66_length.frag b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/66_length.frag index bbd56ad93025c..4fffc6e36db3b 100644 --- a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/66_length.frag +++ b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/66_length.frag @@ -11,13 +11,12 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - fragColor = vec4( - // length of a zero vector is 0.0 - length(vec3(a - 1.0, 0.0, 0.0)), - // sqrt(3.0^2.0 + 4.0^2.0) - 4.0 = 5.0 - 4.0 = 1.0 - length(vec2(a * 3.0, 4.0)) - 4.0, - 0.0, - // sqrt(4.0^2.0 + (-4.0)^2.0 + (-4.0)^2.0) + 4.0^2.0) - 7.0 = sqrt(16.0 + 16.0 + 16.0 + 16.0) - 7.0 = sqrt(64.0) - 7.0 = 8.0 - 7.0 = 1.0 - length(vec4(a * 4.0, -4.0, -4.0, 4.0)) - 7.0 - ); + fragColor = vec4( + // length of a zero vector is 0.0 + length(vec3(a - 1.0, 0.0, 0.0)), + // sqrt(3.0^2.0 + 4.0^2.0) - 4.0 = 5.0 - 4.0 = 1.0 + length(vec2(a * 3.0, 4.0)) - 4.0, 0.0, + // sqrt(4.0^2.0 + (-4.0)^2.0 + (-4.0)^2.0) + 4.0^2.0) - 7.0 = sqrt(16.0 + // + 16.0 + 16.0 + 16.0) - 7.0 = sqrt(64.0) - 7.0 = 8.0 - 7.0 = 1.0 + length(vec4(a * 4.0, -4.0, -4.0, 4.0)) - 7.0); } diff --git a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/67_distance.frag b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/67_distance.frag index f0dfa2d7656d8..17330493bec92 100644 --- a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/67_distance.frag +++ b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/67_distance.frag @@ -11,13 +11,11 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - fragColor = vec4( - // distance between same value is 0.0 - distance(a * 7.0, 7.0), - // 7.0 - 6.0 = 1.0 - distance(a * 7.0, 6.0), - 0.0, - // sqrt(7.0 * 7.0 - 6.0 * 8.0) = sqrt(49.0 - 48.0) = sqrt(1.0) = 1.0 - distance(vec2(a * 7.0, 6.0), vec2(7.0, 8.0)) - ); + fragColor = vec4( + // distance between same value is 0.0 + distance(a * 7.0, 7.0), + // 7.0 - 6.0 = 1.0 + distance(a * 7.0, 6.0), 0.0, + // sqrt(7.0 * 7.0 - 6.0 * 8.0) = sqrt(49.0 - 48.0) = sqrt(1.0) = 1.0 + distance(vec2(a * 7.0, 6.0), vec2(7.0, 8.0))); } diff --git a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/68_cross.frag b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/68_cross.frag index d3ddabbe4c9bd..855fb9f1d5c80 100644 --- a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/68_cross.frag +++ b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/68_cross.frag @@ -11,12 +11,9 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - fragColor = vec4( - /* cross product of parallel vectors is a zero vector */ - cross(vec3(a, 2.0, 3.0), vec3(2.0, 4.0, 6.0))[0], - 1.0, - // cross product of parallel vectors is a zero vector - cross(vec3(a, 2.0, 3.0), vec3(2.0, 4.0, 6.0))[2], - 1.0); + fragColor = vec4( + /* cross product of parallel vectors is a zero vector */ + cross(vec3(a, 2.0, 3.0), vec3(2.0, 4.0, 6.0))[0], 1.0, + // cross product of parallel vectors is a zero vector + cross(vec3(a, 2.0, 3.0), vec3(2.0, 4.0, 6.0))[2], 1.0); } - diff --git a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/69_normalize.frag b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/69_normalize.frag index 4c6dae16d54a4..f867b0145939a 100644 --- a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/69_normalize.frag +++ b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/69_normalize.frag @@ -11,12 +11,10 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - fragColor = vec4( - 0.0, - // normalized result is x = [3/5, 4/5], so add 2/5 to x1 to make 1.0 - normalize(vec2(a * 3.0, 4.0))[0] + 0.4, - 0.0, - // normalized result is x = [3/5, 4/5], so add 1/5 to x2 to make 1.0 - normalize(vec2(a * 3.0, 4.0))[1] + 0.2 - ); + fragColor = + vec4(0.0, + // normalized result is x = [3/5, 4/5], so add 2/5 to x1 to make 1.0 + normalize(vec2(a * 3.0, 4.0))[0] + 0.4, 0.0, + // normalized result is x = [3/5, 4/5], so add 1/5 to x2 to make 1.0 + normalize(vec2(a * 3.0, 4.0))[1] + 0.2); } diff --git a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/6_sign.frag b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/6_sign.frag index 491b85deb7514..67aa487e8becc 100644 --- a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/6_sign.frag +++ b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/6_sign.frag @@ -11,13 +11,11 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - fragColor = vec4( - // sign is negative which results to -1.0, and -1.0 + 1.0 is 0.0 - sign(-72.45) + a, - // sign is negative which results to -1.0, and -1.0 + 2.0 is 1.0 - sign(-12.34) + 2.0 * a, - 0.0, - // sign is positive which results to 1.0 - sign(a * 0.1234)); + fragColor = vec4( + // sign is negative which results to -1.0, and -1.0 + 1.0 is 0.0 + sign(-72.45) + a, + // sign is negative which results to -1.0, and -1.0 + 2.0 is 1.0 + sign(-12.34) + 2.0 * a, 0.0, + // sign is positive which results to 1.0 + sign(a * 0.1234)); } - diff --git a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/70_faceforward.frag b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/70_faceforward.frag index 6f6e5ccee4b13..18bb6450ed5c6 100644 --- a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/70_faceforward.frag +++ b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/70_faceforward.frag @@ -11,14 +11,14 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - fragColor = vec4( - 0.0, - // dot product of incident vector (2nd param) and reference vector (3rd param) is non-negative, - // so the negated first param is returned, and its first value is 1.0. - faceforward(vec2(-a, 5.0), vec2(1.0, 2.0), vec2(3.0, 4.0))[0], - 0.0, - // dot product of incident vector (2nd param) and reference vector (3rd param) is negative, - // so the original first param is returned, and its second value is 5.0, so subtract 4.0 to get 1.0. - faceforward(vec2(a, 5.0), vec2(1.0, -2.0), vec2(3.0, 4.0))[1] - 4.0 - ); + fragColor = + vec4(0.0, + // dot product of incident vector (2nd param) and reference vector + // (3rd param) is non-negative, so the negated first param is + // returned, and its first value is 1.0. + faceforward(vec2(-a, 5.0), vec2(1.0, 2.0), vec2(3.0, 4.0))[0], 0.0, + // dot product of incident vector (2nd param) and reference vector + // (3rd param) is negative, so the original first param is returned, + // and its second value is 5.0, so subtract 4.0 to get 1.0. + faceforward(vec2(a, 5.0), vec2(1.0, -2.0), vec2(3.0, 4.0))[1] - 4.0); } diff --git a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/8_floor.frag b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/8_floor.frag index 900e206b6a75b..b99b963142947 100644 --- a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/8_floor.frag +++ b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/8_floor.frag @@ -11,10 +11,6 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - fragColor = vec4( - floor(a * 0.25), - floor(a * 1.25), - floor(a * 0.75), - floor(a * 1.75) - ); + fragColor = + vec4(floor(a * 0.25), floor(a * 1.25), floor(a * 0.75), floor(a * 1.75)); } diff --git a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/9_ceil.frag b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/9_ceil.frag index c9039aa3e0309..6aebcf6afc027 100644 --- a/lib/ui/fixtures/shaders/supported_glsl_op_shaders/9_ceil.frag +++ b/lib/ui/fixtures/shaders/supported_glsl_op_shaders/9_ceil.frag @@ -11,11 +11,6 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - fragColor = vec4( - ceil(a * -0.25), - ceil(a * 0.25), - ceil(a * -0.75), - ceil(a * 0.75) - ); + fragColor = + vec4(ceil(a * -0.25), ceil(a * 0.25), ceil(a * -0.75), ceil(a * 0.75)); } - diff --git a/lib/ui/fixtures/shaders/supported_op_shaders/127_OpFNegate.frag b/lib/ui/fixtures/shaders/supported_op_shaders/127_OpFNegate.frag index 9548e6862e97a..ab5fe191a2b20 100644 --- a/lib/ui/fixtures/shaders/supported_op_shaders/127_OpFNegate.frag +++ b/lib/ui/fixtures/shaders/supported_op_shaders/127_OpFNegate.frag @@ -11,6 +11,5 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - fragColor = vec4(0.0, -(0.0-a), 0.0, 1.0); + fragColor = vec4(0.0, -(0.0 - a), 0.0, 1.0); } - diff --git a/lib/ui/fixtures/shaders/supported_op_shaders/129_OpFAdd.frag b/lib/ui/fixtures/shaders/supported_op_shaders/129_OpFAdd.frag index f82ccc9c26831..59feb69545b99 100644 --- a/lib/ui/fixtures/shaders/supported_op_shaders/129_OpFAdd.frag +++ b/lib/ui/fixtures/shaders/supported_op_shaders/129_OpFAdd.frag @@ -11,6 +11,5 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - fragColor = vec4(0.0, 0.5 * a + 0.5, 0.0, 1.0); + fragColor = vec4(0.0, 0.5 * a + 0.5, 0.0, 1.0); } - diff --git a/lib/ui/fixtures/shaders/supported_op_shaders/131_OpFSub.frag b/lib/ui/fixtures/shaders/supported_op_shaders/131_OpFSub.frag index 2eef92f4d7b27..4fe6d354e9305 100644 --- a/lib/ui/fixtures/shaders/supported_op_shaders/131_OpFSub.frag +++ b/lib/ui/fixtures/shaders/supported_op_shaders/131_OpFSub.frag @@ -11,6 +11,5 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - fragColor = vec4(0.0, 2.0 - a, 0.0, 1.0); + fragColor = vec4(0.0, 2.0 - a, 0.0, 1.0); } - diff --git a/lib/ui/fixtures/shaders/supported_op_shaders/142_OpVectorTimesScalar.frag b/lib/ui/fixtures/shaders/supported_op_shaders/142_OpVectorTimesScalar.frag index ccde0f99120bd..e34ebc3e4b9ba 100644 --- a/lib/ui/fixtures/shaders/supported_op_shaders/142_OpVectorTimesScalar.frag +++ b/lib/ui/fixtures/shaders/supported_op_shaders/142_OpVectorTimesScalar.frag @@ -11,6 +11,5 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - fragColor = vec4(0.0, 1.0, 0.0, 1.0) * a; + fragColor = vec4(0.0, 1.0, 0.0, 1.0) * a; } - diff --git a/lib/ui/fixtures/shaders/supported_op_shaders/143_OpMatrixTimesScalar.frag b/lib/ui/fixtures/shaders/supported_op_shaders/143_OpMatrixTimesScalar.frag index aab64dea92736..e86759316b1d5 100644 --- a/lib/ui/fixtures/shaders/supported_op_shaders/143_OpMatrixTimesScalar.frag +++ b/lib/ui/fixtures/shaders/supported_op_shaders/143_OpMatrixTimesScalar.frag @@ -11,8 +11,7 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - mat4 m = mat4(1.0); - m *= a; - fragColor = vec4(0.0, 1.0, 0.0, 1.0) * m; + mat4 m = mat4(1.0); + m *= a; + fragColor = vec4(0.0, 1.0, 0.0, 1.0) * m; } - diff --git a/lib/ui/fixtures/shaders/supported_op_shaders/144_OpVectorTimesMatrix.frag b/lib/ui/fixtures/shaders/supported_op_shaders/144_OpVectorTimesMatrix.frag index b9a9ccb4bd69b..7ccea1d73124e 100644 --- a/lib/ui/fixtures/shaders/supported_op_shaders/144_OpVectorTimesMatrix.frag +++ b/lib/ui/fixtures/shaders/supported_op_shaders/144_OpVectorTimesMatrix.frag @@ -11,6 +11,6 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - mat4 identity = mat4(a); - fragColor = vec4(0.0, 1.0, 0.0, 1.0) * identity; + mat4 identity = mat4(a); + fragColor = vec4(0.0, 1.0, 0.0, 1.0) * identity; } diff --git a/lib/ui/fixtures/shaders/supported_op_shaders/145_OpMatrixTimesVector.frag b/lib/ui/fixtures/shaders/supported_op_shaders/145_OpMatrixTimesVector.frag index 67365c49284ed..a26e3cd2ef40e 100644 --- a/lib/ui/fixtures/shaders/supported_op_shaders/145_OpMatrixTimesVector.frag +++ b/lib/ui/fixtures/shaders/supported_op_shaders/145_OpMatrixTimesVector.frag @@ -11,7 +11,6 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - mat4 identity = mat4(a); - fragColor = identity * vec4(0.0, 1.0, 0.0, 1.0); + mat4 identity = mat4(a); + fragColor = identity * vec4(0.0, 1.0, 0.0, 1.0); } - diff --git a/lib/ui/fixtures/shaders/supported_op_shaders/146_OpMatrixTimesMatrix.frag b/lib/ui/fixtures/shaders/supported_op_shaders/146_OpMatrixTimesMatrix.frag index 2536d21b9f030..25b13b7b06bfd 100644 --- a/lib/ui/fixtures/shaders/supported_op_shaders/146_OpMatrixTimesMatrix.frag +++ b/lib/ui/fixtures/shaders/supported_op_shaders/146_OpMatrixTimesMatrix.frag @@ -11,7 +11,6 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - mat4 m = mat4(1.0) * mat4(a); - fragColor = vec4(0.0, 1.0, 0.0, 1.0) * m; + mat4 m = mat4(1.0) * mat4(a); + fragColor = vec4(0.0, 1.0, 0.0, 1.0) * m; } - diff --git a/lib/ui/fixtures/shaders/supported_op_shaders/148_OpDot.frag b/lib/ui/fixtures/shaders/supported_op_shaders/148_OpDot.frag index cc755d0a232fa..3f70cfdf6874d 100644 --- a/lib/ui/fixtures/shaders/supported_op_shaders/148_OpDot.frag +++ b/lib/ui/fixtures/shaders/supported_op_shaders/148_OpDot.frag @@ -11,6 +11,6 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - float one = dot(vec2(1.0), vec2(0.0, a)); - fragColor = vec4(0.0, one, 0.0, 1.0); + float one = dot(vec2(1.0), vec2(0.0, a)); + fragColor = vec4(0.0, one, 0.0, 1.0); } diff --git a/lib/ui/fixtures/shaders/supported_op_shaders/164_OpLogicalEqual.frag b/lib/ui/fixtures/shaders/supported_op_shaders/164_OpLogicalEqual.frag index de93798337eb9..cad38b470b49d 100644 --- a/lib/ui/fixtures/shaders/supported_op_shaders/164_OpLogicalEqual.frag +++ b/lib/ui/fixtures/shaders/supported_op_shaders/164_OpLogicalEqual.frag @@ -17,4 +17,3 @@ void main() { fragColor = vec4(0.0, 0.0, 0.0, 1.0); } } - diff --git a/lib/ui/fixtures/shaders/supported_op_shaders/165_OpLogicalNotEqual.frag b/lib/ui/fixtures/shaders/supported_op_shaders/165_OpLogicalNotEqual.frag index 803bd12470af5..a720efa4971c6 100644 --- a/lib/ui/fixtures/shaders/supported_op_shaders/165_OpLogicalNotEqual.frag +++ b/lib/ui/fixtures/shaders/supported_op_shaders/165_OpLogicalNotEqual.frag @@ -17,5 +17,3 @@ void main() { fragColor = vec4(0.0, 0.0, 0.0, 1.0); } } - - diff --git a/lib/ui/fixtures/shaders/supported_op_shaders/166_OpLogicalOr.frag b/lib/ui/fixtures/shaders/supported_op_shaders/166_OpLogicalOr.frag index 4b31d391d5525..2e39a3a51189d 100644 --- a/lib/ui/fixtures/shaders/supported_op_shaders/166_OpLogicalOr.frag +++ b/lib/ui/fixtures/shaders/supported_op_shaders/166_OpLogicalOr.frag @@ -17,4 +17,3 @@ void main() { fragColor = vec4(0.0, 0.0, 0.0, 1.0); } } - diff --git a/lib/ui/fixtures/shaders/supported_op_shaders/167_OpLogicalAnd.frag b/lib/ui/fixtures/shaders/supported_op_shaders/167_OpLogicalAnd.frag index 55e7fd2eb032c..585ddec718fe4 100644 --- a/lib/ui/fixtures/shaders/supported_op_shaders/167_OpLogicalAnd.frag +++ b/lib/ui/fixtures/shaders/supported_op_shaders/167_OpLogicalAnd.frag @@ -17,4 +17,3 @@ void main() { fragColor = vec4(0.0, 0.0, 0.0, 1.0); } } - diff --git a/lib/ui/fixtures/shaders/supported_op_shaders/168_OpLogicalNot.frag b/lib/ui/fixtures/shaders/supported_op_shaders/168_OpLogicalNot.frag index bec1109483b64..b74575a8a22a5 100644 --- a/lib/ui/fixtures/shaders/supported_op_shaders/168_OpLogicalNot.frag +++ b/lib/ui/fixtures/shaders/supported_op_shaders/168_OpLogicalNot.frag @@ -17,4 +17,3 @@ void main() { fragColor = vec4(0.0, 0.0, 0.0, 1.0); } } - diff --git a/lib/ui/fixtures/shaders/supported_op_shaders/180_OpFOrdEqual.frag b/lib/ui/fixtures/shaders/supported_op_shaders/180_OpFOrdEqual.frag index 480080eb06f79..901ab522d1707 100644 --- a/lib/ui/fixtures/shaders/supported_op_shaders/180_OpFOrdEqual.frag +++ b/lib/ui/fixtures/shaders/supported_op_shaders/180_OpFOrdEqual.frag @@ -17,4 +17,3 @@ void main() { fragColor = vec4(0.0, 0.0, 0.0, 1.0); } } - diff --git a/lib/ui/fixtures/shaders/supported_op_shaders/183_OpFUnordNotEqual.frag b/lib/ui/fixtures/shaders/supported_op_shaders/183_OpFUnordNotEqual.frag index b49ff5986dca2..259cfb1b2c4bb 100644 --- a/lib/ui/fixtures/shaders/supported_op_shaders/183_OpFUnordNotEqual.frag +++ b/lib/ui/fixtures/shaders/supported_op_shaders/183_OpFUnordNotEqual.frag @@ -17,4 +17,3 @@ void main() { fragColor = vec4(0.0, 0.0, 0.0, 1.0); } } - diff --git a/lib/ui/fixtures/shaders/supported_op_shaders/184_OpFOrdLessThan.frag b/lib/ui/fixtures/shaders/supported_op_shaders/184_OpFOrdLessThan.frag index 69992de3d1d0f..4e823f77414dd 100644 --- a/lib/ui/fixtures/shaders/supported_op_shaders/184_OpFOrdLessThan.frag +++ b/lib/ui/fixtures/shaders/supported_op_shaders/184_OpFOrdLessThan.frag @@ -17,4 +17,3 @@ void main() { fragColor = vec4(0.0, 1.0, 0.0, 1.0); } } - diff --git a/lib/ui/fixtures/shaders/supported_op_shaders/186_OpFOrdGreaterThan.frag b/lib/ui/fixtures/shaders/supported_op_shaders/186_OpFOrdGreaterThan.frag index 26e9753a63c9f..1a4980522946a 100644 --- a/lib/ui/fixtures/shaders/supported_op_shaders/186_OpFOrdGreaterThan.frag +++ b/lib/ui/fixtures/shaders/supported_op_shaders/186_OpFOrdGreaterThan.frag @@ -17,4 +17,3 @@ void main() { fragColor = vec4(0.0, 0.0, 0.0, 1.0); } } - diff --git a/lib/ui/fixtures/shaders/supported_op_shaders/188_OpFOrdLessThanEqual.frag b/lib/ui/fixtures/shaders/supported_op_shaders/188_OpFOrdLessThanEqual.frag index f0dcc0f281bcd..674acef7253f5 100644 --- a/lib/ui/fixtures/shaders/supported_op_shaders/188_OpFOrdLessThanEqual.frag +++ b/lib/ui/fixtures/shaders/supported_op_shaders/188_OpFOrdLessThanEqual.frag @@ -17,4 +17,3 @@ void main() { fragColor = vec4(0.0, 0.0, 0.0, 1.0); } } - diff --git a/lib/ui/fixtures/shaders/supported_op_shaders/190_OpFOrdGreaterThanEqual.frag b/lib/ui/fixtures/shaders/supported_op_shaders/190_OpFOrdGreaterThanEqual.frag index 0523b2e298668..8cb2a90040552 100644 --- a/lib/ui/fixtures/shaders/supported_op_shaders/190_OpFOrdGreaterThanEqual.frag +++ b/lib/ui/fixtures/shaders/supported_op_shaders/190_OpFOrdGreaterThanEqual.frag @@ -17,4 +17,3 @@ void main() { fragColor = vec4(0.0, 0.0, 0.0, 1.0); } } - diff --git a/lib/ui/fixtures/shaders/supported_op_shaders/19_OpTypeVoid.frag b/lib/ui/fixtures/shaders/supported_op_shaders/19_OpTypeVoid.frag index a221a4f8c2b94..a89fe54cf147e 100644 --- a/lib/ui/fixtures/shaders/supported_op_shaders/19_OpTypeVoid.frag +++ b/lib/ui/fixtures/shaders/supported_op_shaders/19_OpTypeVoid.frag @@ -11,5 +11,5 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - fragColor = vec4(0.0, a, 0.0, 1.0); + fragColor = vec4(0.0, a, 0.0, 1.0); } diff --git a/lib/ui/fixtures/shaders/supported_op_shaders/20_OpTypeBool.frag b/lib/ui/fixtures/shaders/supported_op_shaders/20_OpTypeBool.frag index ce1ef4c3cd26c..1fd9a6a215217 100644 --- a/lib/ui/fixtures/shaders/supported_op_shaders/20_OpTypeBool.frag +++ b/lib/ui/fixtures/shaders/supported_op_shaders/20_OpTypeBool.frag @@ -11,10 +11,9 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - bool f = false; - bool t = bool(a); - float zero = float(f); - float one = float(t); - fragColor = vec4(zero, one, zero, one); + bool f = false; + bool t = bool(a); + float zero = float(f); + float one = float(t); + fragColor = vec4(zero, one, zero, one); } - diff --git a/lib/ui/fixtures/shaders/supported_op_shaders/21_OpTypeInt.frag b/lib/ui/fixtures/shaders/supported_op_shaders/21_OpTypeInt.frag index 39b6b48ff2e73..f9bbc90766f6a 100644 --- a/lib/ui/fixtures/shaders/supported_op_shaders/21_OpTypeInt.frag +++ b/lib/ui/fixtures/shaders/supported_op_shaders/21_OpTypeInt.frag @@ -11,10 +11,9 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - int zeroInt = 0; - int oneInt = int(a); - float zero = float(zeroInt); - float one = float(oneInt); - fragColor = vec4(zero, one, zero, one); + int zeroInt = 0; + int oneInt = int(a); + float zero = float(zeroInt); + float one = float(oneInt); + fragColor = vec4(zero, one, zero, one); } - diff --git a/lib/ui/fixtures/shaders/supported_op_shaders/22_OpTypeFloat.frag b/lib/ui/fixtures/shaders/supported_op_shaders/22_OpTypeFloat.frag index ffc779c0ff737..5440a18ed8437 100644 --- a/lib/ui/fixtures/shaders/supported_op_shaders/22_OpTypeFloat.frag +++ b/lib/ui/fixtures/shaders/supported_op_shaders/22_OpTypeFloat.frag @@ -11,7 +11,6 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - float zero = 0.0; - fragColor = vec4(zero, a, zero, a); + float zero = 0.0; + fragColor = vec4(zero, a, zero, a); } - diff --git a/lib/ui/fixtures/shaders/supported_op_shaders/23_OpTypeVector.frag b/lib/ui/fixtures/shaders/supported_op_shaders/23_OpTypeVector.frag index 9137ccdb20564..57de83c8b6a6a 100644 --- a/lib/ui/fixtures/shaders/supported_op_shaders/23_OpTypeVector.frag +++ b/lib/ui/fixtures/shaders/supported_op_shaders/23_OpTypeVector.frag @@ -11,7 +11,7 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - vec2 ones = vec2(a); - vec3 zeros = vec3(0.0, 0.0, 0.0); - fragColor = vec4(zeros[0], ones[0], zeros[2], ones[1]); + vec2 ones = vec2(a); + vec3 zeros = vec3(0.0, 0.0, 0.0); + fragColor = vec4(zeros[0], ones[0], zeros[2], ones[1]); } diff --git a/lib/ui/fixtures/shaders/supported_op_shaders/246_OpLoopMerge.frag b/lib/ui/fixtures/shaders/supported_op_shaders/246_OpLoopMerge.frag index 11c7d2a230f31..6a48ad4abedb6 100644 --- a/lib/ui/fixtures/shaders/supported_op_shaders/246_OpLoopMerge.frag +++ b/lib/ui/fixtures/shaders/supported_op_shaders/246_OpLoopMerge.frag @@ -25,4 +25,3 @@ void main() { } fragColor = vec4(0.0, sum, 0.0, 1.0); } - diff --git a/lib/ui/fixtures/shaders/supported_op_shaders/24_OpTypeMatrix.frag b/lib/ui/fixtures/shaders/supported_op_shaders/24_OpTypeMatrix.frag index 8b2032d99360e..da2564f6c55ff 100644 --- a/lib/ui/fixtures/shaders/supported_op_shaders/24_OpTypeMatrix.frag +++ b/lib/ui/fixtures/shaders/supported_op_shaders/24_OpTypeMatrix.frag @@ -11,12 +11,9 @@ layout(location = 0) out vec4 fragColor; layout(location = 0) uniform float a; void main() { - mat2 zeros = mat2(0.0); - mat3 ones = mat3(a); - mat4 identity = mat4( - a, 0.0, 0.0, 0.0, - 0.0, a, 0.0, 0.0, - 0.0, 0.0, a, 0.0, - 0.0, 0.0, 0.0, a); - fragColor = vec4(zeros[1][1], ones[2][2], identity[3][1], identity[3][3]); + mat2 zeros = mat2(0.0); + mat3 ones = mat3(a); + mat4 identity = mat4(a, 0.0, 0.0, 0.0, 0.0, a, 0.0, 0.0, 0.0, 0.0, a, 0.0, + 0.0, 0.0, 0.0, a); + fragColor = vec4(zeros[1][1], ones[2][2], identity[3][1], identity[3][3]); } diff --git a/lib/ui/fixtures/shaders/supported_op_shaders/250_OpBranchConditional.frag b/lib/ui/fixtures/shaders/supported_op_shaders/250_OpBranchConditional.frag index c72ea85af02bb..8b2e77dfccbc7 100644 --- a/lib/ui/fixtures/shaders/supported_op_shaders/250_OpBranchConditional.frag +++ b/lib/ui/fixtures/shaders/supported_op_shaders/250_OpBranchConditional.frag @@ -20,5 +20,3 @@ void main() { fragColor = vec4(0.0, 0.0, 0.0, 1.0); } } - - diff --git a/lib/ui/fixtures/shaders/supported_op_shaders/33_OpTypeFunction.frag b/lib/ui/fixtures/shaders/supported_op_shaders/33_OpTypeFunction.frag index eb468e82aa0d1..b9db34335a0be 100644 --- a/lib/ui/fixtures/shaders/supported_op_shaders/33_OpTypeFunction.frag +++ b/lib/ui/fixtures/shaders/supported_op_shaders/33_OpTypeFunction.frag @@ -19,6 +19,5 @@ float one() { } void main() { - fragColor = vec4(zero(), one(), zero(), one()); + fragColor = vec4(zero(), one(), zero(), one()); } - diff --git a/shell/platform/android/android_egl_surface.cc b/shell/platform/android/android_egl_surface.cc index fa1573a6e25cc..e610f505febed 100644 --- a/shell/platform/android/android_egl_surface.cc +++ b/shell/platform/android/android_egl_surface.cc @@ -21,9 +21,7 @@ void LogLastEGLError() { }; #define _EGL_ERROR_DESC(a) \ - { \ -#a, a \ - } + { #a, a } const EGLNameErrorPair pairs[] = { _EGL_ERROR_DESC(EGL_SUCCESS), diff --git a/shell/platform/darwin/common/framework/Headers/FlutterMacros.h b/shell/platform/darwin/common/framework/Headers/FlutterMacros.h index 1b9c821ede3dd..da99e10219b76 100644 --- a/shell/platform/darwin/common/framework/Headers/FlutterMacros.h +++ b/shell/platform/darwin/common/framework/Headers/FlutterMacros.h @@ -39,9 +39,9 @@ #if __has_feature(objc_arc) #define FLUTTER_ASSERT_ARC -#define FLUTTER_ASSERT_NOT_ARC #error ARC must be disabled! +#define FLUTTER_ASSERT_NOT_ARC #error ARC must be disabled ! #else -#define FLUTTER_ASSERT_ARC #error ARC must be enabled! +#define FLUTTER_ASSERT_ARC #error ARC must be enabled ! #define FLUTTER_ASSERT_NOT_ARC #endif diff --git a/shell/platform/darwin/ios/framework/Source/FlutterKeyboardManagerTest.mm b/shell/platform/darwin/ios/framework/Source/FlutterKeyboardManagerTest.mm index de9fadabc34fb..764a64b242cad 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterKeyboardManagerTest.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterKeyboardManagerTest.mm @@ -19,7 +19,7 @@ namespace flutter { class PointerDataPacket {}; -} +} // namespace flutter /// Sometimes we have to use a custom mock to avoid retain cycles in ocmock. @interface FlutterEnginePartialMock : FlutterEngine diff --git a/shell/platform/embedder/tests/embedder_unittests_gl.cc b/shell/platform/embedder/tests/embedder_unittests_gl.cc index 5efa27878e968..a7018859d1d47 100644 --- a/shell/platform/embedder/tests/embedder_unittests_gl.cc +++ b/shell/platform/embedder/tests/embedder_unittests_gl.cc @@ -4018,7 +4018,7 @@ TEST_F(EmbedderTest, ExternalTextureGLRefreshedTooOften) { TestGLSurface surface(SkISize::Make(100, 100)); auto context = surface.GetGrContext(); - typedef void (*glGenTexturesProc)(uint32_t n, uint32_t* textures); + typedef void (*glGenTexturesProc)(uint32_t n, uint32_t * textures); glGenTexturesProc glGenTextures; glGenTextures = reinterpret_cast( diff --git a/shell/platform/fuchsia/flutter/tests/fakes/scenic/fake_session.cc b/shell/platform/fuchsia/flutter/tests/fakes/scenic/fake_session.cc index 294481959c9a1..133360acd21ac 100644 --- a/shell/platform/fuchsia/flutter/tests/fakes/scenic/fake_session.cc +++ b/shell/platform/fuchsia/flutter/tests/fakes/scenic/fake_session.cc @@ -108,7 +108,7 @@ void FakeSession::Present(uint64_t presentation_time, ApplyCommands(); PresentHandler present_handler = - present_handler_ ? present_handler_ : [](auto... args) -> auto{ + present_handler_ ? present_handler_ : [](auto... args) -> auto { return fuchsia::images::PresentationInfo{}; }; @@ -124,7 +124,7 @@ void FakeSession::Present2(fuchsia::ui::scenic::Present2Args args, ApplyCommands(); Present2Handler present2_handler = - present2_handler_ ? present2_handler_ : [](auto args) -> auto{ + present2_handler_ ? present2_handler_ : [](auto args) -> auto { return fuchsia::scenic::scheduling::FuturePresentationTimes{ .future_presentations = {}, .remaining_presents_in_flight_allowed = 1, @@ -142,7 +142,7 @@ void FakeSession::RequestPresentationTimes( RequestPresentationTimesCallback callback) { RequestPresentationTimesHandler request_presentation_times_handler = request_presentation_times_handler_ ? request_presentation_times_handler_ - : [](auto args) -> auto{ + : [](auto args) -> auto { return fuchsia::scenic::scheduling::FuturePresentationTimes{ .future_presentations = {}, .remaining_presents_in_flight_allowed = 1, diff --git a/shell/platform/fuchsia/flutter/tests/gfx_session_connection_unittests.cc b/shell/platform/fuchsia/flutter/tests/gfx_session_connection_unittests.cc index 9a7e314ca0602..d8fdec58f3a1a 100644 --- a/shell/platform/fuchsia/flutter/tests/gfx_session_connection_unittests.cc +++ b/shell/platform/fuchsia/flutter/tests/gfx_session_connection_unittests.cc @@ -180,14 +180,14 @@ TEST_F(GfxSessionConnectionTest, BasicPresent) { // (`RequestPresentationTimes` or `Present` calls) were handled. size_t request_times_called = 0u; size_t presents_called = 0u; - fake_session().SetRequestPresentationTimesHandler([&request_times_called]( - auto...) -> auto { - request_times_called++; - return FuturePresentationTimes{ - .future_presentations = {}, - .remaining_presents_in_flight_allowed = 1, - }; - }); + fake_session().SetRequestPresentationTimesHandler( + [&request_times_called](auto...) -> auto { + request_times_called++; + return FuturePresentationTimes{ + .future_presentations = {}, + .remaining_presents_in_flight_allowed = 1, + }; + }); fake_session().SetPresent2Handler([&presents_called](auto...) -> auto { presents_called++; return FuturePresentationTimes{ diff --git a/third_party/accessibility/ax/ax_enum_util_unittest.cc b/third_party/accessibility/ax/ax_enum_util_unittest.cc index 8f64916b78379..b5760f30011a5 100644 --- a/third_party/accessibility/ax/ax_enum_util_unittest.cc +++ b/third_party/accessibility/ax/ax_enum_util_unittest.cc @@ -144,7 +144,8 @@ TEST(AXEnumUtilTest, MarkerType) { // 8 (Composition) is // explicitly skipped in // ax_enums.mojom. - val == 4 ? 16 : val * 2; + val == 4 ? 16 + : val * 2; }); } diff --git a/third_party/accessibility/base/numerics/safe_conversions_arm_impl.h b/third_party/accessibility/base/numerics/safe_conversions_arm_impl.h index c94947d42d9c4..cf31072b9b89e 100644 --- a/third_party/accessibility/base/numerics/safe_conversions_arm_impl.h +++ b/third_party/accessibility/base/numerics/safe_conversions_arm_impl.h @@ -30,18 +30,16 @@ struct SaturateFastAsmOp { uint32_t>::type result; if (std::is_signed::value) { asm("ssat %[dst], %[shift], %[src]" - : [ dst ] "=r"(result) - : - [ src ] "r"(src), [ shift ] "n"(IntegerBitsPlusSign::value <= 32 - ? IntegerBitsPlusSign::value - : 32)); + : [dst] "=r"(result) + : [src] "r"(src), [shift] "n"(IntegerBitsPlusSign::value <= 32 + ? IntegerBitsPlusSign::value + : 32)); } else { asm("usat %[dst], %[shift], %[src]" - : [ dst ] "=r"(result) - : - [ src ] "r"(src), [ shift ] "n"(IntegerBitsPlusSign::value < 32 - ? IntegerBitsPlusSign::value - : 31)); + : [dst] "=r"(result) + : [src] "r"(src), [shift] "n"(IntegerBitsPlusSign::value < 32 + ? IntegerBitsPlusSign::value + : 31)); } return static_cast(result); } diff --git a/third_party/accessibility/base/numerics/safe_math_arm_impl.h b/third_party/accessibility/base/numerics/safe_math_arm_impl.h index f8abca7f4f9e9..ff86bd0b73b5f 100644 --- a/third_party/accessibility/base/numerics/safe_math_arm_impl.h +++ b/third_party/accessibility/base/numerics/safe_math_arm_impl.h @@ -61,8 +61,8 @@ struct ClampedAddFastAsmOp { int32_t y_i32 = checked_cast(y); asm("qadd %[result], %[first], %[second]" - : [ result ] "=r"(result) - : [ first ] "r"(x_i32), [ second ] "r"(y_i32)); + : [result] "=r"(result) + : [first] "r"(x_i32), [second] "r"(y_i32)); return saturated_cast(result); } }; @@ -87,8 +87,8 @@ struct ClampedSubFastAsmOp { int32_t y_i32 = checked_cast(y); asm("qsub %[result], %[first], %[second]" - : [ result ] "=r"(result) - : [ first ] "r"(x_i32), [ second ] "r"(y_i32)); + : [result] "=r"(result) + : [first] "r"(x_i32), [second] "r"(y_i32)); return saturated_cast(result); } }; diff --git a/third_party/accessibility/base/test/gtest_util.h b/third_party/accessibility/base/test/gtest_util.h index c96ccaa504986..de3f9b9d93add 100644 --- a/third_party/accessibility/base/test/gtest_util.h +++ b/third_party/accessibility/base/test/gtest_util.h @@ -37,7 +37,7 @@ #define EXPECT_DCHECK_DEATH(statement) \ GTEST_UNSUPPORTED_DEATH_TEST(statement, "Check failed", ) #define ASSERT_DCHECK_DEATH(statement) \ - GTEST_UNSUPPORTED_DEATH_TEST(statement, "Check failed", return ) + GTEST_UNSUPPORTED_DEATH_TEST(statement, "Check failed", return) #endif // defined(GTEST_HAS_DEATH_TEST) && !defined(OS_ANDROID) && !defined(NDEBUG) @@ -61,7 +61,7 @@ #define EXPECT_CHECK_DEATH(statement) \ GTEST_UNSUPPORTED_DEATH_TEST(statement, "", ) #define ASSERT_CHECK_DEATH(statement) \ - GTEST_UNSUPPORTED_DEATH_TEST(statement, "", return ) + GTEST_UNSUPPORTED_DEATH_TEST(statement, "", return) #endif // defined(GTEST_HAS_DEATH_TEST) && !defined(OS_ANDROID) diff --git a/third_party/tonic/dart_binding_macros.h b/third_party/tonic/dart_binding_macros.h index f1a2ad6e9beb9..abb30c1f156c5 100644 --- a/third_party/tonic/dart_binding_macros.h +++ b/third_party/tonic/dart_binding_macros.h @@ -27,10 +27,10 @@ {#CLASS "_" #METHOD, CLASS##_##METHOD, \ tonic::IndicesForSignature::count + 1, true}, -#define DART_REGISTER_NATIVE_STATIC(CLASS, METHOD) \ - { \ -#CLASS "_" #METHOD, CLASS##_##METHOD, \ - tonic::IndicesForSignature < decltype(&CLASS::METHOD)> ::count, true \ +#define DART_REGISTER_NATIVE_STATIC(CLASS, METHOD) \ + { \ + #CLASS "_" #METHOD, CLASS##_##METHOD, \ + tonic::IndicesForSignature::count, true \ } #define DART_BIND_ALL(CLASS, FOR_EACH) \