diff options
author | Ethan Nicholas <ethannicholas@google.com> | 2017-12-13 14:36:14 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-12-13 20:01:40 +0000 |
commit | 2d5f9b3d58e07ac8a8df17f4c0321cb65f255e69 (patch) | |
tree | 8422c1a8b0d73cd3cc15e9c1a4ac2fda2e66fa20 /src/gpu/effects/GrMagnifierEffect.h | |
parent | df9a7e11c2656a555579de40e9dd39927ffa9bce (diff) |
converted GrMagnifierEffect to SkSL
Bug: skia:
Change-Id: I6dc14ac66d5b911117e71fa23fef49a897082781
Reviewed-on: https://skia-review.googlesource.com/71342
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/effects/GrMagnifierEffect.h')
-rw-r--r-- | src/gpu/effects/GrMagnifierEffect.h | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/src/gpu/effects/GrMagnifierEffect.h b/src/gpu/effects/GrMagnifierEffect.h new file mode 100644 index 0000000000..13904f983f --- /dev/null +++ b/src/gpu/effects/GrMagnifierEffect.h @@ -0,0 +1,65 @@ +/* + * 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 GrMagnifierEffect.fp; do not modify. + */ +#ifndef GrMagnifierEffect_DEFINED +#define GrMagnifierEffect_DEFINED +#include "SkTypes.h" +#if SK_SUPPORT_GPU +#include "GrFragmentProcessor.h" +#include "GrCoordTransform.h" +class GrMagnifierEffect : public GrFragmentProcessor { +public: + SkIRect bounds() const { return fBounds; } + SkRect srcRect() const { return fSrcRect; } + float xInvZoom() const { return fXInvZoom; } + float yInvZoom() const { return fYInvZoom; } + float xInvInset() const { return fXInvInset; } + float yInvInset() const { return fYInvInset; } + static std::unique_ptr<GrFragmentProcessor> Make(sk_sp<GrTextureProxy> src, SkIRect bounds, + SkRect srcRect, float xInvZoom, float yInvZoom, + float xInvInset, float yInvInset) { + return std::unique_ptr<GrFragmentProcessor>(new GrMagnifierEffect( + src, bounds, srcRect, xInvZoom, yInvZoom, xInvInset, yInvInset)); + } + GrMagnifierEffect(const GrMagnifierEffect& src); + std::unique_ptr<GrFragmentProcessor> clone() const override; + const char* name() const override { return "MagnifierEffect"; } + +private: + GrMagnifierEffect(sk_sp<GrTextureProxy> src, SkIRect bounds, SkRect srcRect, float xInvZoom, + float yInvZoom, float xInvInset, float yInvInset) + : INHERITED(kGrMagnifierEffect_ClassID, kNone_OptimizationFlags) + , fSrc(std::move(src)) + , fBounds(bounds) + , fSrcRect(srcRect) + , fXInvZoom(xInvZoom) + , fYInvZoom(yInvZoom) + , fXInvInset(xInvInset) + , fYInvInset(yInvInset) + , fSrcCoordTransform(SkMatrix::I(), fSrc.proxy()) { + this->addTextureSampler(&fSrc); + this->addCoordTransform(&fSrcCoordTransform); + } + GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; + void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override; + bool onIsEqual(const GrFragmentProcessor&) const override; + GR_DECLARE_FRAGMENT_PROCESSOR_TEST + TextureSampler fSrc; + SkIRect fBounds; + SkRect fSrcRect; + float fXInvZoom; + float fYInvZoom; + float fXInvInset; + float fYInvInset; + GrCoordTransform fSrcCoordTransform; + typedef GrFragmentProcessor INHERITED; +}; +#endif +#endif |