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: |
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; |
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: |
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 | SkASSERT(src); |
58 | this->registerChild(std::move(src), SkSL::SampleUsage::Explicit()); |
59 | } |
60 | GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; |
61 | void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override; |
62 | bool onIsEqual(const GrFragmentProcessor&) const override; |
63 | #if GR_TEST_UTILS |
64 | SkString onDumpInfo() const override; |
65 | #endif |
66 | GR_DECLARE_FRAGMENT_PROCESSOR_TEST |
67 | typedef GrFragmentProcessor INHERITED; |
68 | }; |
69 | #endif |
70 | |