skia2/src/effects/GrCircleBlurFragmentProcessor.h
Ethan Nicholas f57c0d6761 automatically generate clone() methods for SkSL fragment processors
Bug: skia:
Change-Id: Ib7b90f20d2b1558aad14f38f95c7c884e654c96d
Reviewed-on: https://skia-review.googlesource.com/28620
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-07-31 15:44:32 +00:00

54 lines
2.1 KiB
C++

/*
* 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 GrCircleBlurFragmentProcessor.fp; do not modify.
*/
#ifndef GrCircleBlurFragmentProcessor_DEFINED
#define GrCircleBlurFragmentProcessor_DEFINED
#include "SkTypes.h"
#if SK_SUPPORT_GPU
#include "GrFragmentProcessor.h"
#include "GrCoordTransform.h"
#include "GrColorSpaceXform.h"
class GrCircleBlurFragmentProcessor : public GrFragmentProcessor {
public:
SkRect circleRect() const { return fCircleRect; }
float textureRadius() const { return fTextureRadius; }
float solidRadius() const { return fSolidRadius; }
static sk_sp<GrFragmentProcessor> Make(GrResourceProvider* resourceProvider,
const SkRect& circle, float sigma);
GrCircleBlurFragmentProcessor(const GrCircleBlurFragmentProcessor& src);
sk_sp<GrFragmentProcessor> clone() const override;
const char* name() const override { return "CircleBlurFragmentProcessor"; }
private:
GrCircleBlurFragmentProcessor(SkRect circleRect, float textureRadius, float solidRadius,
sk_sp<GrTextureProxy> blurProfileSampler,
GrResourceProvider* resourceProvider)
: INHERITED((OptimizationFlags)kCompatibleWithCoverageAsAlpha_OptimizationFlag)
, fCircleRect(circleRect)
, fTextureRadius(textureRadius)
, fSolidRadius(solidRadius)
, fBlurProfileSampler(std::move(blurProfileSampler)) {
this->addTextureSampler(&fBlurProfileSampler);
this->initClassID<GrCircleBlurFragmentProcessor>();
}
GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
GR_DECLARE_FRAGMENT_PROCESSOR_TEST
SkRect fCircleRect;
float fTextureRadius;
float fSolidRadius;
TextureSampler fBlurProfileSampler;
typedef GrFragmentProcessor INHERITED;
};
#endif
#endif