• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 GrConfigConversionEffect.fp; do not modify.
10  **************************************************************************************************/
11 #ifndef GrConfigConversionEffect_DEFINED
12 #define GrConfigConversionEffect_DEFINED
13 
14 #include "include/core/SkM44.h"
15 #include "include/core/SkTypes.h"
16 
17 #include "include/gpu/GrDirectContext.h"
18 #include "src/gpu/GrDirectContextPriv.h"
19 #include "src/gpu/GrImageInfo.h"
20 #include "src/gpu/GrSurfaceDrawContext.h"
21 #include "src/gpu/SkGr.h"
22 
23 #include "src/gpu/GrFragmentProcessor.h"
24 
25 class GrConfigConversionEffect : public GrFragmentProcessor {
26 public:
27     static bool TestForPreservingPMConversions(GrDirectContext* dContext);
28 
Make(std::unique_ptr<GrFragmentProcessor> fp,PMConversion pmConversion)29     static std::unique_ptr<GrFragmentProcessor> Make(std::unique_ptr<GrFragmentProcessor> fp,
30                                                      PMConversion pmConversion) {
31         if (!fp) {
32             return nullptr;
33         }
34         return std::unique_ptr<GrFragmentProcessor>(
35                 new GrConfigConversionEffect(std::move(fp), pmConversion));
36     }
37     GrConfigConversionEffect(const GrConfigConversionEffect& src);
38     std::unique_ptr<GrFragmentProcessor> clone() const override;
name()39     const char* name() const override { return "ConfigConversionEffect"; }
40     PMConversion pmConversion;
41 
42 private:
GrConfigConversionEffect(std::unique_ptr<GrFragmentProcessor> inputFP,PMConversion pmConversion)43     GrConfigConversionEffect(std::unique_ptr<GrFragmentProcessor> inputFP,
44                              PMConversion pmConversion)
45             : INHERITED(kGrConfigConversionEffect_ClassID, kNone_OptimizationFlags)
46             , pmConversion(pmConversion) {
47         this->registerChild(std::move(inputFP), SkSL::SampleUsage::PassThrough());
48     }
49     std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
50     void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
51     bool onIsEqual(const GrFragmentProcessor&) const override;
52 #if GR_TEST_UTILS
53     SkString onDumpInfo() const override;
54 #endif
55     GR_DECLARE_FRAGMENT_PROCESSOR_TEST
56     using INHERITED = GrFragmentProcessor;
57 };
58 #endif
59