@@ -3057,6 +3057,33 @@ STAGE_PP(luminance_to_alpha, Ctx::None) {
3057
3057
3058
3058
// ~~~~~~ Coverage scales / lerps ~~~~~~ //
3059
3059
3060
+ STAGE_PP (load_src, const uint16_t * ptr) {
3061
+ r = unaligned_load<U16>(ptr + 0 *N);
3062
+ g = unaligned_load<U16>(ptr + 1 *N);
3063
+ b = unaligned_load<U16>(ptr + 2 *N);
3064
+ a = unaligned_load<U16>(ptr + 3 *N);
3065
+ }
3066
+ STAGE_PP (store_src, uint16_t * ptr) {
3067
+ unaligned_store (ptr + 0 *N, r);
3068
+ unaligned_store (ptr + 1 *N, g);
3069
+ unaligned_store (ptr + 2 *N, b);
3070
+ unaligned_store (ptr + 3 *N, a);
3071
+ }
3072
+ STAGE_PP (load_dst, const uint16_t * ptr) {
3073
+ dr = unaligned_load<U16>(ptr + 0 *N);
3074
+ dg = unaligned_load<U16>(ptr + 1 *N);
3075
+ db = unaligned_load<U16>(ptr + 2 *N);
3076
+ da = unaligned_load<U16>(ptr + 3 *N);
3077
+ }
3078
+ STAGE_PP (store_dst, uint16_t * ptr) {
3079
+ unaligned_store (ptr + 0 *N, dr);
3080
+ unaligned_store (ptr + 1 *N, dg);
3081
+ unaligned_store (ptr + 2 *N, db);
3082
+ unaligned_store (ptr + 3 *N, da);
3083
+ }
3084
+
3085
+ // ~~~~~~ Coverage scales / lerps ~~~~~~ //
3086
+
3060
3087
STAGE_PP (scale_1_float, const float * f) {
3061
3088
U16 c = from_float (*f);
3062
3089
r = div255 ( r * c );
@@ -3071,6 +3098,13 @@ STAGE_PP(lerp_1_float, const float* f) {
3071
3098
b = lerp (db, b, c);
3072
3099
a = lerp (da, a, c);
3073
3100
}
3101
+ STAGE_PP (lerp_native, const uint16_t scales[]) {
3102
+ auto c = unaligned_load<U16>(scales);
3103
+ r = lerp (dr, r, c);
3104
+ g = lerp (dg, g, c);
3105
+ b = lerp (db, b, c);
3106
+ a = lerp (da, a, c);
3107
+ }
3074
3108
3075
3109
STAGE_PP (scale_u8, const SkRasterPipeline_MemoryCtx* ctx) {
3076
3110
U16 c = load_8 (ptr_at_xy<const uint8_t >(ctx, dx,dy), tail);
@@ -3355,15 +3389,10 @@ STAGE_GP(bilerp_clamp_8888, const SkRasterPipeline_GatherCtx* ctx) {
3355
3389
// If a pipeline uses these stages, it'll boot it out of lowp into highp.
3356
3390
#define NOT_IMPLEMENTED (st ) static void (*st)(void ) = nullptr;
3357
3391
NOT_IMPLEMENTED (callback)
3358
- NOT_IMPLEMENTED(load_src) // TODO
3359
- NOT_IMPLEMENTED(store_src) // TODO
3360
- NOT_IMPLEMENTED(load_dst) // TODO
3361
- NOT_IMPLEMENTED(store_dst) // TODO
3362
3392
NOT_IMPLEMENTED(unbounded_set_rgb)
3363
3393
NOT_IMPLEMENTED(unbounded_uniform_color)
3364
3394
NOT_IMPLEMENTED(unpremul)
3365
3395
NOT_IMPLEMENTED(dither) // TODO
3366
- NOT_IMPLEMENTED(lerp_native) // TODO
3367
3396
NOT_IMPLEMENTED(from_srgb)
3368
3397
NOT_IMPLEMENTED(to_srgb)
3369
3398
NOT_IMPLEMENTED(load_f16)
0 commit comments