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 #include "SkTypes.h" 14 #include "GrFragmentProcessor.h" 15 #include "GrCoordTransform.h" 16 class GrMagnifierEffect : public GrFragmentProcessor { 17 public: bounds()18 const SkIRect& bounds() const { return fBounds; } srcRect()19 const SkRect& srcRect() const { return fSrcRect; } xInvZoom()20 float xInvZoom() const { return fXInvZoom; } yInvZoom()21 float yInvZoom() const { return fYInvZoom; } xInvInset()22 float xInvInset() const { return fXInvInset; } yInvInset()23 float yInvInset() const { return fYInvInset; } Make(sk_sp<GrTextureProxy> src,SkIRect bounds,SkRect srcRect,float xInvZoom,float yInvZoom,float xInvInset,float yInvInset)24 static std::unique_ptr<GrFragmentProcessor> Make(sk_sp<GrTextureProxy> src, SkIRect bounds, 25 SkRect srcRect, float xInvZoom, float yInvZoom, 26 float xInvInset, float yInvInset) { 27 return std::unique_ptr<GrFragmentProcessor>(new GrMagnifierEffect( 28 src, bounds, srcRect, xInvZoom, yInvZoom, xInvInset, yInvInset)); 29 } 30 GrMagnifierEffect(const GrMagnifierEffect& src); 31 std::unique_ptr<GrFragmentProcessor> clone() const override; name()32 const char* name() const override { return "MagnifierEffect"; } 33 34 private: GrMagnifierEffect(sk_sp<GrTextureProxy> src,SkIRect bounds,SkRect srcRect,float xInvZoom,float yInvZoom,float xInvInset,float yInvInset)35 GrMagnifierEffect(sk_sp<GrTextureProxy> src, SkIRect bounds, SkRect srcRect, float xInvZoom, 36 float yInvZoom, float xInvInset, float yInvInset) 37 : INHERITED(kGrMagnifierEffect_ClassID, kNone_OptimizationFlags) 38 , fSrc(std::move(src)) 39 , fBounds(bounds) 40 , fSrcRect(srcRect) 41 , fXInvZoom(xInvZoom) 42 , fYInvZoom(yInvZoom) 43 , fXInvInset(xInvInset) 44 , fYInvInset(yInvInset) 45 , fSrcCoordTransform(SkMatrix::I(), fSrc.proxy()) { 46 this->setTextureSamplerCnt(1); 47 this->addCoordTransform(&fSrcCoordTransform); 48 } 49 GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; 50 void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override; 51 bool onIsEqual(const GrFragmentProcessor&) const override; 52 const TextureSampler& onTextureSampler(int) 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