Ethan Nicholas | 2d5f9b3 | 2017-12-13 14:36:14 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017 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 | #include "SkTypes.h" |
| 14 | #if SK_SUPPORT_GPU |
| 15 | #include "GrFragmentProcessor.h" |
| 16 | #include "GrCoordTransform.h" |
| 17 | class GrMagnifierEffect : public GrFragmentProcessor { |
| 18 | public: |
| 19 | SkIRect bounds() const { return fBounds; } |
| 20 | SkRect srcRect() const { return fSrcRect; } |
| 21 | float xInvZoom() const { return fXInvZoom; } |
| 22 | float yInvZoom() const { return fYInvZoom; } |
| 23 | float xInvInset() const { return fXInvInset; } |
| 24 | float yInvInset() const { return fYInvInset; } |
| 25 | static std::unique_ptr<GrFragmentProcessor> Make(sk_sp<GrTextureProxy> src, SkIRect bounds, |
| 26 | SkRect srcRect, float xInvZoom, float yInvZoom, |
| 27 | float xInvInset, float yInvInset) { |
| 28 | return std::unique_ptr<GrFragmentProcessor>(new GrMagnifierEffect( |
| 29 | 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 | |
| 35 | private: |
| 36 | GrMagnifierEffect(sk_sp<GrTextureProxy> src, SkIRect bounds, SkRect srcRect, float xInvZoom, |
| 37 | float yInvZoom, float xInvInset, float yInvInset) |
| 38 | : INHERITED(kGrMagnifierEffect_ClassID, kNone_OptimizationFlags) |
| 39 | , fSrc(std::move(src)) |
| 40 | , fBounds(bounds) |
| 41 | , fSrcRect(srcRect) |
| 42 | , fXInvZoom(xInvZoom) |
| 43 | , fYInvZoom(yInvZoom) |
| 44 | , fXInvInset(xInvInset) |
| 45 | , fYInvInset(yInvInset) |
| 46 | , fSrcCoordTransform(SkMatrix::I(), fSrc.proxy()) { |
| 47 | this->addTextureSampler(&fSrc); |
| 48 | this->addCoordTransform(&fSrcCoordTransform); |
| 49 | } |
| 50 | GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; |
| 51 | void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override; |
| 52 | bool onIsEqual(const GrFragmentProcessor&) const override; |
| 53 | GR_DECLARE_FRAGMENT_PROCESSOR_TEST |
| 54 | TextureSampler fSrc; |
| 55 | SkIRect fBounds; |
| 56 | SkRect fSrcRect; |
| 57 | float fXInvZoom; |
| 58 | float fYInvZoom; |
| 59 | float fXInvInset; |
| 60 | float fYInvInset; |
| 61 | GrCoordTransform fSrcCoordTransform; |
| 62 | typedef GrFragmentProcessor INHERITED; |
| 63 | }; |
| 64 | #endif |
| 65 | #endif |