@@ -24,8 +24,12 @@ vec4 IPSample(sampler2D texture_sampler, vec2 coords, float y_coord_scale) {
2424// / If `y_coord_scale` < 0.0, the Y coordinate is flipped. This is useful
2525// / for Impeller graphics backends that use a flipped framebuffer coordinate
2626// / space.
27- // / The range of `coods` will be mapped from [0, 1] to [half_texel, 1 - half_texel]
28- vec4 IPSampleLinear(sampler2D texture_sampler, vec2 coords, float y_coord_scale, vec2 half_texel) {
27+ // / The range of `coods` will be mapped from [0, 1] to [half_texel, 1 -
28+ // / half_texel]
29+ vec4 IPSampleLinear(sampler2D texture_sampler,
30+ vec2 coords,
31+ float y_coord_scale,
32+ vec2 half_texel) {
2933 coords.x = mix (half_texel.x, 1 - half_texel.x, coords.x);
3034 coords.y = mix (half_texel.y, 1 - half_texel.y, coords.y);
3135 return IPSample(texture_sampler, coords, y_coord_scale);
@@ -79,7 +83,8 @@ vec4 IPSampleWithTileMode(sampler2D tex,
7983 return vec4 (0 );
8084 }
8185
82- return IPSample(tex, IPVec2Tile(coords, x_tile_mode, y_tile_mode), y_coord_scale);
86+ return IPSample(tex, IPVec2Tile(coords, x_tile_mode, y_tile_mode),
87+ y_coord_scale);
8388}
8489
8590// / Sample a texture, emulating a specific tile mode.
@@ -97,7 +102,8 @@ vec4 IPSampleWithTileMode(sampler2D tex,
97102// /
98103// / This is useful for Impeller graphics backend that don't have native support
99104// / for Decal.
100- // / The range of `coods` will be mapped from [0, 1] to [half_texel, 1 - half_texel]
105+ // / The range of `coods` will be mapped from [0, 1] to [half_texel, 1 -
106+ // / half_texel]
101107vec4 IPSampleLinearWithTileMode(sampler2D tex,
102108 vec2 coords,
103109 float y_coord_scale,
@@ -109,20 +115,23 @@ vec4 IPSampleLinearWithTileMode(sampler2D tex,
109115 return vec4 (0 );
110116 }
111117
112- return IPSampleLinear(tex, IPVec2Tile(coords, x_tile_mode, y_tile_mode), y_coord_scale, half_texel);
118+ return IPSampleLinear(tex, IPVec2Tile(coords, x_tile_mode, y_tile_mode),
119+ y_coord_scale, half_texel);
113120}
114121
115122// / Sample a texture, emulating a specific tile mode.
116123// /
117124// / This is useful for Impeller graphics backend that don't have native support
118125// / for Decal.
119- // / The range of `coods` will be mapped from [0, 1] to [half_texel, 1 - half_texel]
126+ // / The range of `coods` will be mapped from [0, 1] to [half_texel, 1 -
127+ // / half_texel]
120128vec4 IPSampleLinearWithTileMode(sampler2D tex,
121129 vec2 coords,
122130 float y_coord_scale,
123131 vec2 half_texel,
124132 float tile_mode) {
125- return IPSampleLinearWithTileMode(tex, coords, y_coord_scale, half_texel, tile_mode, tile_mode);
133+ return IPSampleLinearWithTileMode(tex, coords, y_coord_scale, half_texel,
134+ tile_mode, tile_mode);
126135}
127136
128137#endif
0 commit comments