| /* |
| * Copyright 2017 Google Inc. |
| * |
| * Use of this source code is governed by a BSD-style license that can be |
| * found in the LICENSE file. |
| */ |
| |
| /* |
| * This file was autogenerated from GrLumaColorFilterEffect.fp; do not modify. |
| */ |
| #ifndef GrLumaColorFilterEffect_DEFINED |
| #define GrLumaColorFilterEffect_DEFINED |
| #include "SkTypes.h" |
| #if SK_SUPPORT_GPU |
| #include "GrFragmentProcessor.h" |
| #include "GrCoordTransform.h" |
| class GrLumaColorFilterEffect : public GrFragmentProcessor { |
| public: |
| #include "SkColorData.h" |
| |
| GrColor4f constantOutputForConstantInput(GrColor4f input) const override { |
| float luma = SK_ITU_BT709_LUM_COEFF_R * input.fRGBA[0] + |
| SK_ITU_BT709_LUM_COEFF_G * input.fRGBA[1] + |
| SK_ITU_BT709_LUM_COEFF_B * input.fRGBA[2]; |
| return GrColor4f(0, 0, 0, luma); |
| } |
| static std::unique_ptr<GrFragmentProcessor> Make() { |
| return std::unique_ptr<GrFragmentProcessor>(new GrLumaColorFilterEffect()); |
| } |
| GrLumaColorFilterEffect(const GrLumaColorFilterEffect& src); |
| std::unique_ptr<GrFragmentProcessor> clone() const override; |
| const char* name() const override { return "LumaColorFilterEffect"; } |
| |
| private: |
| GrLumaColorFilterEffect() |
| : INHERITED(kGrLumaColorFilterEffect_ClassID, kNone_OptimizationFlags) {} |
| GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; |
| void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override; |
| bool onIsEqual(const GrFragmentProcessor&) const override; |
| GR_DECLARE_FRAGMENT_PROCESSOR_TEST |
| typedef GrFragmentProcessor INHERITED; |
| }; |
| #endif |
| #endif |