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// This only supports a 2-color single interval so it is a simple linear interpolation between the 9// two end points based on t. But it serves as a good test for connecting all of the plumbing into a 10// functional gradient shader. 11 12layout(ctype=SkPMColor4f, tracked) in uniform half4 start; 13layout(ctype=SkPMColor4f, tracked) in uniform half4 end; 14 15void main() { 16 half t = sk_InColor.x; 17 18 // Clamping and/or wrapping was already handled by the parent shader so the output color is a 19 // simple lerp. 20 sk_OutColor = (1 - t) * start + t * end; 21} 22