blob: bfcfdb8905168bc4bfcf98b1bdf55bc41ae1ab95 [file] [log] [blame]
Ethan Nicholasbe0a0422017-11-17 13:44:05 -05001/*
Ethan Nicholas130fb3f2018-02-01 12:14:34 -05002 * Copyright 2018 Google Inc.
Ethan Nicholasbe0a0422017-11-17 13:44:05 -05003 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
Ethan Nicholas130fb3f2018-02-01 12:14:34 -05008/**************************************************************************************************
9 *** This file was autogenerated from GrPremulInputFragmentProcessor.fp; do not modify.
10 **************************************************************************************************/
Ethan Nicholasbe0a0422017-11-17 13:44:05 -050011#ifndef GrPremulInputFragmentProcessor_DEFINED
12#define GrPremulInputFragmentProcessor_DEFINED
13#include "SkTypes.h"
Ethan Nicholasbe0a0422017-11-17 13:44:05 -050014#include "GrFragmentProcessor.h"
15#include "GrCoordTransform.h"
16class GrPremulInputFragmentProcessor : public GrFragmentProcessor {
17public:
Brian Osman1d5b5982018-10-01 13:41:39 -040018 SkPMColor4f constantOutputForConstantInput(const SkPMColor4f& input) const override {
19 return SkColor4f{input.fR, input.fG, input.fB, input.fA}.premul();
Ethan Nicholasbe0a0422017-11-17 13:44:05 -050020 }
21 static std::unique_ptr<GrFragmentProcessor> Make() {
22 return std::unique_ptr<GrFragmentProcessor>(new GrPremulInputFragmentProcessor());
23 }
24 GrPremulInputFragmentProcessor(const GrPremulInputFragmentProcessor& src);
25 std::unique_ptr<GrFragmentProcessor> clone() const override;
26 const char* name() const override { return "PremulInputFragmentProcessor"; }
27
28private:
29 GrPremulInputFragmentProcessor()
30 : INHERITED(kGrPremulInputFragmentProcessor_ClassID,
31 (OptimizationFlags)kPreservesOpaqueInput_OptimizationFlag |
32 kConstantOutputForConstantInput_OptimizationFlag) {}
33 GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
34 void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
35 bool onIsEqual(const GrFragmentProcessor&) const override;
36 GR_DECLARE_FRAGMENT_PROCESSOR_TEST
37 typedef GrFragmentProcessor INHERITED;
38};
39#endif