1 /* 2 * Copyright 2018 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 in float k1; 9 in float k2; 10 in float k3; 11 in float k4; 12 layout(key) in bool enforcePMColor; 13 in fragmentProcessor child; 14 15 uniform float4 k; 16 17 void main() { 18 half4 dst = process(child); 19 sk_OutColor = clamp(k.x * sk_InColor * dst + k.y * sk_InColor + k.z * dst + k.w, 0, 1); 20 if (enforcePMColor) { 21 sk_OutColor.rgb = min(sk_OutColor.rgb, sk_OutColor.a); 22 } 23 } 24 25 @setData(pdman) { 26 pdman.set4f(k, k1, k2, k3, k4); 27 } 28