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