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 /************************************************************************************************** 9 *** This file was autogenerated from GrPremulInputFragmentProcessor.fp; do not modify. 10 **************************************************************************************************/ 11 #ifndef GrPremulInputFragmentProcessor_DEFINED 12 #define GrPremulInputFragmentProcessor_DEFINED 13 #include "include/core/SkTypes.h" 14 15 #include "src/gpu/GrCoordTransform.h" 16 #include "src/gpu/GrFragmentProcessor.h" 17 class GrPremulInputFragmentProcessor : public GrFragmentProcessor { 18 public: constantOutputForConstantInput(const SkPMColor4f & input)19 SkPMColor4f constantOutputForConstantInput(const SkPMColor4f& input) const override { 20 return SkColor4f{input.fR, input.fG, input.fB, input.fA}.premul(); 21 } Make()22 static std::unique_ptr<GrFragmentProcessor> Make() { 23 return std::unique_ptr<GrFragmentProcessor>(new GrPremulInputFragmentProcessor()); 24 } 25 GrPremulInputFragmentProcessor(const GrPremulInputFragmentProcessor& src); 26 std::unique_ptr<GrFragmentProcessor> clone() const override; name()27 const char* name() const override { return "PremulInputFragmentProcessor"; } 28 29 private: GrPremulInputFragmentProcessor()30 GrPremulInputFragmentProcessor() 31 : INHERITED(kGrPremulInputFragmentProcessor_ClassID, 32 (OptimizationFlags)kPreservesOpaqueInput_OptimizationFlag | 33 kConstantOutputForConstantInput_OptimizationFlag) {} 34 GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; 35 void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override; 36 bool onIsEqual(const GrFragmentProcessor&) const override; 37 GR_DECLARE_FRAGMENT_PROCESSOR_TEST 38 typedef GrFragmentProcessor INHERITED; 39 }; 40 #endif 41