GrTextureGradientColorizer.fp 412 B

123456789101112131415161718
  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. // Should have height = 1px, horizontal axis represents t = 0 to 1
  8. in uniform sampler2D gradient;
  9. @samplerParams(gradient) {
  10. GrSamplerState::ClampBilerp()
  11. }
  12. void main() {
  13. half2 coord = half2(sk_InColor.x, 0.5);
  14. sk_OutColor = texture(gradient, coord);
  15. }