aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/effects/GrPremulInputFragmentProcessor.fp
blob: 65fd255d1bb8e70a56b7578a4e9feb0bcb8a4cb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
 * Copyright 2018 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

@optimizationFlags {
    kPreservesOpaqueInput_OptimizationFlag | kConstantOutputForConstantInput_OptimizationFlag
}

void main() {
    sk_OutColor = sk_InColor;
    sk_OutColor.rgb *= sk_InColor.a;
}

@class {
    GrColor4f constantOutputForConstantInput(GrColor4f input) const override {
        return input.premul();
    }
}