• 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 GrMagnifierEffect.fp; do not modify.
10  **************************************************************************************************/
11 #ifndef GrMagnifierEffect_DEFINED
12 #define GrMagnifierEffect_DEFINED
13 
14 #include "include/core/SkM44.h"
15 #include "include/core/SkTypes.h"
16 
17 #include "src/gpu/GrFragmentProcessor.h"
18 
19 class GrMagnifierEffect : public GrFragmentProcessor {
20 public:
Make(std::unique_ptr<GrFragmentProcessor> src,SkIRect bounds,SkRect srcRect,float xInvZoom,float yInvZoom,float xInvInset,float yInvInset)21     static std::unique_ptr<GrFragmentProcessor> Make(std::unique_ptr<GrFragmentProcessor> src,
22                                                      SkIRect bounds,
23                                                      SkRect srcRect,
24                                                      float xInvZoom,
25                                                      float yInvZoom,
26                                                      float xInvInset,
27                                                      float yInvInset) {
28         return std::unique_ptr<GrFragmentProcessor>(new GrMagnifierEffect(
29                 std::move(src), bounds, srcRect, xInvZoom, yInvZoom, xInvInset, yInvInset));
30     }
31     GrMagnifierEffect(const GrMagnifierEffect& src);
32     std::unique_ptr<GrFragmentProcessor> clone() const override;
name()33     const char* name() const override { return "MagnifierEffect"; }
34     SkIRect bounds;
35     SkRect srcRect;
36     float xInvZoom;
37     float yInvZoom;
38     float xInvInset;
39     float yInvInset;
40 
41 private:
GrMagnifierEffect(std::unique_ptr<GrFragmentProcessor> src,SkIRect bounds,SkRect srcRect,float xInvZoom,float yInvZoom,float xInvInset,float yInvInset)42     GrMagnifierEffect(std::unique_ptr<GrFragmentProcessor> src,
43                       SkIRect bounds,
44                       SkRect srcRect,
45                       float xInvZoom,
46                       float yInvZoom,
47                       float xInvInset,
48                       float yInvInset)
49             : INHERITED(kGrMagnifierEffect_ClassID, kNone_OptimizationFlags)
50             , bounds(bounds)
51             , srcRect(srcRect)
52             , xInvZoom(xInvZoom)
53             , yInvZoom(yInvZoom)
54             , xInvInset(xInvInset)
55             , yInvInset(yInvInset) {
56         this->setUsesSampleCoordsDirectly();
57         this->registerChild(std::move(src), SkSL::SampleUsage::Explicit());
58     }
59     std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
60     void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
61     bool onIsEqual(const GrFragmentProcessor&) const override;
62 #if GR_TEST_UTILS
63     SkString onDumpInfo() const override;
64 #endif
65     GR_DECLARE_FRAGMENT_PROCESSOR_TEST
66     using INHERITED = GrFragmentProcessor;
67 };
68 #endif
69