Flutter Engine
The Flutter Engine
SkRasterPipelineOpList.h
Go to the documentation of this file.
1/*
2 * Copyright 2023 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef SkRasterPipelineOpList_DEFINED
9#define SkRasterPipelineOpList_DEFINED
10
11// `SK_RASTER_PIPELINE_OPS_LOWP` defines ops that have parallel lowp and highp implementations.
12#define SK_RASTER_PIPELINE_OPS_LOWP(M) \
13 M(move_src_dst) M(move_dst_src) M(swap_src_dst) \
14 M(clamp_01) M(clamp_gamut) \
15 M(premul) M(premul_dst) \
16 M(force_opaque) M(force_opaque_dst) \
17 M(set_rgb) M(swap_rb) M(swap_rb_dst) \
18 M(black_color) M(white_color) \
19 M(uniform_color) M(uniform_color_dst) \
20 M(seed_shader) \
21 M(load_a8) M(load_a8_dst) M(store_a8) M(gather_a8) \
22 M(load_565) M(load_565_dst) M(store_565) M(gather_565) \
23 M(load_4444) M(load_4444_dst) M(store_4444) M(gather_4444) \
24 M(load_8888) M(load_8888_dst) M(store_8888) M(gather_8888) \
25 M(load_rg88) M(load_rg88_dst) M(store_rg88) M(gather_rg88) \
26 M(store_r8) \
27 M(alpha_to_gray) M(alpha_to_gray_dst) \
28 M(alpha_to_red) M(alpha_to_red_dst) \
29 M(bt709_luminance_or_luma_to_alpha) M(bt709_luminance_or_luma_to_rgb) \
30 M(bilerp_clamp_8888) \
31 M(load_src) M(store_src) M(store_src_a) M(load_dst) M(store_dst) \
32 M(scale_u8) M(scale_565) M(scale_1_float) M(scale_native) \
33 M( lerp_u8) M( lerp_565) M( lerp_1_float) M(lerp_native) \
34 M(dstatop) M(dstin) M(dstout) M(dstover) \
35 M(srcatop) M(srcin) M(srcout) M(srcover) \
36 M(clear) M(modulate) M(multiply) M(plus_) M(screen) M(xor_) \
37 M(darken) M(difference) \
38 M(exclusion) M(hardlight) M(lighten) M(overlay) \
39 M(srcover_rgba_8888) \
40 M(matrix_translate) M(matrix_scale_translate) \
41 M(matrix_2x3) \
42 M(matrix_perspective) \
43 M(decal_x) M(decal_y) M(decal_x_and_y) \
44 M(check_decal_mask) \
45 M(clamp_x_1) M(mirror_x_1) M(repeat_x_1) \
46 M(clamp_x_and_y) \
47 M(evenly_spaced_gradient) \
48 M(gradient) \
49 M(evenly_spaced_2_stop_gradient) \
50 M(xy_to_unit_angle) \
51 M(xy_to_radius) \
52 M(emboss) \
53 M(swizzle)
54
55// `SK_RASTER_PIPELINE_OPS_SKSL` defines ops used by SkSL.
56#define SK_RASTER_PIPELINE_OPS_SKSL(M) \
57 M(init_lane_masks) M(store_device_xy01) M(exchange_src) \
58 M(load_condition_mask) M(store_condition_mask) \
59 M(merge_condition_mask) M(merge_inv_condition_mask) \
60 M(load_loop_mask) M(store_loop_mask) M(mask_off_loop_mask) \
61 M(reenable_loop_mask) M(merge_loop_mask) M(case_op) M(continue_op) \
62 M(load_return_mask) M(store_return_mask) M(mask_off_return_mask) \
63 M(branch_if_all_lanes_active) M(branch_if_any_lanes_active) M(branch_if_no_lanes_active) \
64 M(branch_if_no_active_lanes_eq) M(jump) \
65 M(bitwise_and_imm_4_ints) \
66 M(bitwise_and_imm_3_ints) M(bitwise_and_imm_2_ints) M(bitwise_and_imm_int) \
67 M(bitwise_and_n_ints) M(bitwise_and_int) M(bitwise_and_2_ints) \
68 M(bitwise_and_3_ints) M(bitwise_and_4_ints) \
69 M(bitwise_or_n_ints) \
70 M(bitwise_or_int) M(bitwise_or_2_ints) M(bitwise_or_3_ints) M(bitwise_or_4_ints) \
71 M(bitwise_xor_imm_int) \
72 M(bitwise_xor_n_ints) M(bitwise_xor_int) M(bitwise_xor_2_ints) \
73 M(bitwise_xor_3_ints) M(bitwise_xor_4_ints) \
74 M(cast_to_float_from_int) M(cast_to_float_from_2_ints) \
75 M(cast_to_float_from_3_ints) M(cast_to_float_from_4_ints) \
76 M(cast_to_float_from_uint) M(cast_to_float_from_2_uints) \
77 M(cast_to_float_from_3_uints) M(cast_to_float_from_4_uints) \
78 M(cast_to_int_from_float) M(cast_to_int_from_2_floats) \
79 M(cast_to_int_from_3_floats) M(cast_to_int_from_4_floats) \
80 M(cast_to_uint_from_float) M(cast_to_uint_from_2_floats) \
81 M(cast_to_uint_from_3_floats) M(cast_to_uint_from_4_floats) \
82 M(abs_int) M(abs_2_ints) M(abs_3_ints) M(abs_4_ints) \
83 M(floor_float) M(floor_2_floats) M(floor_3_floats) M(floor_4_floats) \
84 M(ceil_float) M(ceil_2_floats) M(ceil_3_floats) M(ceil_4_floats) \
85 M(invsqrt_float) M(invsqrt_2_floats) M(invsqrt_3_floats) M(invsqrt_4_floats) \
86 M(inverse_mat2) M(inverse_mat3) M(inverse_mat4) \
87 M(sin_float) M(cos_float) M(tan_float) \
88 M(asin_float) M(acos_float) M(atan_float) M(atan2_n_floats) \
89 M(sqrt_float) M(pow_n_floats) M(exp_float) M(exp2_float) \
90 M(log_float) M(log2_float) M(refract_4_floats) \
91 M(copy_uniform) M(copy_2_uniforms) M(copy_3_uniforms) M(copy_4_uniforms) \
92 M(copy_constant) M(splat_2_constants) M(splat_3_constants) M(splat_4_constants) \
93 M(copy_slot_masked) M(copy_2_slots_masked) M(copy_3_slots_masked) M(copy_4_slots_masked) \
94 M(copy_from_indirect_unmasked) M(copy_from_indirect_uniform_unmasked) \
95 M(copy_to_indirect_masked) M(swizzle_copy_to_indirect_masked) \
96 M(copy_slot_unmasked) M(copy_2_slots_unmasked) \
97 M(copy_3_slots_unmasked) M(copy_4_slots_unmasked) \
98 M(copy_immutable_unmasked) M(copy_2_immutables_unmasked) \
99 M(copy_3_immutables_unmasked) M(copy_4_immutables_unmasked) \
100 M(swizzle_copy_slot_masked) M(swizzle_copy_2_slots_masked) \
101 M(swizzle_copy_3_slots_masked) M(swizzle_copy_4_slots_masked) \
102 M(swizzle_1) M(swizzle_2) M(swizzle_3) M(swizzle_4) M(shuffle) \
103 M(matrix_multiply_2) M(matrix_multiply_3) M(matrix_multiply_4) \
104 M(smoothstep_n_floats) M(dot_2_floats) M(dot_3_floats) M(dot_4_floats) \
105 M(add_imm_float) \
106 M(add_n_floats) M(add_float) M(add_2_floats) M(add_3_floats) M(add_4_floats) \
107 M(add_imm_int) \
108 M(add_n_ints) M(add_int) M(add_2_ints) M(add_3_ints) M(add_4_ints) \
109 M(sub_n_floats) M(sub_float) M(sub_2_floats) M(sub_3_floats) M(sub_4_floats) \
110 M(sub_n_ints) M(sub_int) M(sub_2_ints) M(sub_3_ints) M(sub_4_ints) \
111 M(mul_imm_float) \
112 M(mul_n_floats) M(mul_float) M(mul_2_floats) M(mul_3_floats) M(mul_4_floats) \
113 M(mul_imm_int) \
114 M(mul_n_ints) M(mul_int) M(mul_2_ints) M(mul_3_ints) M(mul_4_ints) \
115 M(div_n_floats) M(div_float) M(div_2_floats) M(div_3_floats) M(div_4_floats) \
116 M(div_n_ints) M(div_int) M(div_2_ints) M(div_3_ints) M(div_4_ints) \
117 M(div_n_uints) M(div_uint) M(div_2_uints) M(div_3_uints) M(div_4_uints) \
118 M(max_imm_float) \
119 M(max_n_floats) M(max_float) M(max_2_floats) M(max_3_floats) M(max_4_floats) \
120 M(max_n_ints) M(max_int) M(max_2_ints) M(max_3_ints) M(max_4_ints) \
121 M(max_n_uints) M(max_uint) M(max_2_uints) M(max_3_uints) M(max_4_uints) \
122 M(min_imm_float) \
123 M(min_n_floats) M(min_float) M(min_2_floats) M(min_3_floats) M(min_4_floats) \
124 M(min_n_ints) M(min_int) M(min_2_ints) M(min_3_ints) M(min_4_ints) \
125 M(min_n_uints) M(min_uint) M(min_2_uints) M(min_3_uints) M(min_4_uints) \
126 M(mod_n_floats) M(mod_float) M(mod_2_floats) M(mod_3_floats) M(mod_4_floats) \
127 M(mix_n_floats) M(mix_float) M(mix_2_floats) M(mix_3_floats) M(mix_4_floats) \
128 M(mix_n_ints) M(mix_int) M(mix_2_ints) M(mix_3_ints) M(mix_4_ints) \
129 M(cmplt_imm_float) \
130 M(cmplt_n_floats) M(cmplt_float) M(cmplt_2_floats) M(cmplt_3_floats) M(cmplt_4_floats) \
131 M(cmplt_imm_int) \
132 M(cmplt_n_ints) M(cmplt_int) M(cmplt_2_ints) M(cmplt_3_ints) M(cmplt_4_ints) \
133 M(cmplt_imm_uint) \
134 M(cmplt_n_uints) M(cmplt_uint) M(cmplt_2_uints) M(cmplt_3_uints) M(cmplt_4_uints) \
135 M(cmple_imm_float) \
136 M(cmple_n_floats) M(cmple_float) M(cmple_2_floats) M(cmple_3_floats) M(cmple_4_floats) \
137 M(cmple_imm_int) \
138 M(cmple_n_ints) M(cmple_int) M(cmple_2_ints) M(cmple_3_ints) M(cmple_4_ints) \
139 M(cmple_imm_uint) \
140 M(cmple_n_uints) M(cmple_uint) M(cmple_2_uints) M(cmple_3_uints) M(cmple_4_uints) \
141 M(cmpeq_imm_float) \
142 M(cmpeq_n_floats) M(cmpeq_float) M(cmpeq_2_floats) M(cmpeq_3_floats) M(cmpeq_4_floats) \
143 M(cmpeq_imm_int) \
144 M(cmpeq_n_ints) M(cmpeq_int) M(cmpeq_2_ints) M(cmpeq_3_ints) M(cmpeq_4_ints) \
145 M(cmpne_imm_float) \
146 M(cmpne_n_floats) M(cmpne_float) M(cmpne_2_floats) M(cmpne_3_floats) M(cmpne_4_floats) \
147 M(cmpne_imm_int) \
148 M(cmpne_n_ints) M(cmpne_int) M(cmpne_2_ints) M(cmpne_3_ints) M(cmpne_4_ints) \
149 M(trace_line) M(trace_var) M(trace_enter) M(trace_exit) M(trace_scope)
150
151// `SK_RASTER_PIPELINE_OPS_HIGHP_ONLY` defines ops that are only available in highp; this subset
152// includes all of SkSL.
153#define SK_RASTER_PIPELINE_OPS_HIGHP_ONLY(M) \
154 M(callback) \
155 M(stack_checkpoint) M(stack_rewind) \
156 M(unbounded_set_rgb) M(unbounded_uniform_color) \
157 M(unpremul) M(unpremul_polar) M(dither) \
158 M(load_16161616) M(load_16161616_dst) M(store_16161616) M(gather_16161616) \
159 M(load_a16) M(load_a16_dst) M(store_a16) M(gather_a16) \
160 M(load_rg1616) M(load_rg1616_dst) M(store_rg1616) M(gather_rg1616) \
161 M(load_f16) M(load_f16_dst) M(store_f16) M(gather_f16) \
162 M(load_af16) M(load_af16_dst) M(store_af16) M(gather_af16) \
163 M(load_rgf16) M(load_rgf16_dst) M(store_rgf16) M(gather_rgf16) \
164 M(load_f32) M(load_f32_dst) M(store_f32) M(gather_f32) \
165 M(load_1010102) M(load_1010102_dst) M(store_1010102) M(gather_1010102) \
166 M(load_1010102_xr) M(load_1010102_xr_dst) M(store_1010102_xr) \
167 M(gather_1010102_xr) \
168 M(load_10x6) M(load_10x6_dst) M(store_10x6) M(gather_10x6) \
169 M(gather_10101010_xr) M(load_10101010_xr) M(load_10101010_xr_dst) \
170 M(store_10101010_xr) \
171 M(store_src_rg) M(load_src_rg) \
172 M(byte_tables) \
173 M(colorburn) M(colordodge) M(softlight) \
174 M(hue) M(saturation) M(color) M(luminosity) \
175 M(matrix_3x3) M(matrix_3x4) M(matrix_4x5) M(matrix_4x3) \
176 M(parametric) M(gamma_) M(PQish) M(HLGish) M(HLGinvish) \
177 M(rgb_to_hsl) M(hsl_to_rgb) \
178 M(css_lab_to_xyz) M(css_oklab_to_linear_srgb) \
179 M(css_oklab_gamut_map_to_linear_srgb) \
180 M(css_hcl_to_lab) \
181 M(css_hsl_to_srgb) M(css_hwb_to_srgb) \
182 M(gauss_a_to_rgba) \
183 M(mirror_x) M(repeat_x) \
184 M(mirror_y) M(repeat_y) \
185 M(negate_x) \
186 M(bicubic_clamp_8888) \
187 M(bilinear_setup) \
188 M(bilinear_nx) M(bilinear_px) M(bilinear_ny) M(bilinear_py) \
189 M(bicubic_setup) \
190 M(bicubic_n3x) M(bicubic_n1x) M(bicubic_p1x) M(bicubic_p3x) \
191 M(bicubic_n3y) M(bicubic_n1y) M(bicubic_p1y) M(bicubic_p3y) \
192 M(accumulate) \
193 M(perlin_noise) \
194 M(mipmap_linear_init) M(mipmap_linear_update) M(mipmap_linear_finish) \
195 M(xy_to_2pt_conical_strip) \
196 M(xy_to_2pt_conical_focal_on_circle) \
197 M(xy_to_2pt_conical_well_behaved) \
198 M(xy_to_2pt_conical_smaller) \
199 M(xy_to_2pt_conical_greater) \
200 M(alter_2pt_conical_compensate_focal) \
201 M(alter_2pt_conical_unswap) \
202 M(mask_2pt_conical_nan) \
203 M(mask_2pt_conical_degenerates) M(apply_vector_mask) \
204 M(set_base_pointer) \
205 SK_RASTER_PIPELINE_OPS_SKSL(M)
206
207// The combined set of all RasterPipeline ops:
208#define SK_RASTER_PIPELINE_OPS_ALL(M) \
209 SK_RASTER_PIPELINE_OPS_LOWP(M) \
210 SK_RASTER_PIPELINE_OPS_HIGHP_ONLY(M)
211
212// An enumeration of every RasterPipeline op:
214#define M(op) op,
216#undef M
217};
218
219// A count of raster pipeline ops:
220#define M(st) +1
223#undef M
224
225#endif // SkRasterPipelineOpList_DEFINED
#define SK_RASTER_PIPELINE_OPS_ALL(M)
static constexpr int kNumRasterPipelineLowpOps
static constexpr int kNumRasterPipelineHighpOps
#define SK_RASTER_PIPELINE_OPS_LOWP(M)
#define M(op)