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 8in float k1; 9in float k2; 10in float k3; 11in float k4; 12layout(key) in bool enforcePMColor; 13in fragmentProcessor child; 14 15uniform float4 k; 16 17void 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