Revert "converted GrCircleBlurFragmentProcessor to sksl"
This reverts commit 9b80ffc77b8000b493eb1226dc6ec21f1e99edfc.
Reason for revert: breaking ANGLE and Android Vulkan GMs
Original change's description:
> converted GrCircleBlurFragmentProcessor to sksl
>
> Bug: skia:
> Change-Id: I1b70ba2003c9e9de2b5b9acadaf25c9ed59b1198
> Reviewed-on: https://skia-review.googlesource.com/21727
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,ethannicholas@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: skia:
Change-Id: Ia313013b4354b34fa5a02bdb16d007a462c5ca94
Reviewed-on: https://skia-review.googlesource.com/22028
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
diff --git a/src/effects/GrCircleBlurFragmentProcessor.h b/src/effects/GrCircleBlurFragmentProcessor.h
index c01ea9b..3ed4cfc 100644
--- a/src/effects/GrCircleBlurFragmentProcessor.h
+++ b/src/effects/GrCircleBlurFragmentProcessor.h
@@ -1,52 +1,73 @@
/*
- * Copyright 2017 Google Inc.
+ * Copyright 2015 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 "SkString.h"
#include "SkTypes.h"
+
#if SK_SUPPORT_GPU
+
#include "GrFragmentProcessor.h"
-#include "GrCoordTransform.h"
-#include "effects/GrProxyMove.h"
+#include "GrProcessorUnitTest.h"
+
+class GrResourceProvider;
+
+// This FP handles the special case of a blurred circle. It uses a 1D
+// profile that is just rotated about the origin of the circle.
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*, const SkRect& circle, float sigma);
- static sk_sp<GrFragmentProcessor> Make(GrResourceProvider* resourceProvider,
- const SkRect& circle, float sigma);
- 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>();
+ ~GrCircleBlurFragmentProcessor() override {}
+
+ const char* name() const override { return "CircleBlur"; }
+
+ SkString dumpInfo() const override {
+ SkString str;
+ str.appendf("Rect [L: %.2f, T: %.2f, R: %.2f, B: %.2f], solidR: %.2f, textureR: %.2f",
+ fCircle.fLeft, fCircle.fTop, fCircle.fRight, fCircle.fBottom,
+ fSolidRadius, fTextureRadius);
+ return str;
}
+
+private:
+ // This nested GLSL processor implementation is defined in the cpp file.
+ class GLSLProcessor;
+
+ /**
+ * Creates a profile texture for the circle and sigma. The texture will have a height of 1.
+ * The x texture coord should map from 0 to 1 across the radius range of solidRadius to
+ * solidRadius + textureRadius.
+ */
+ GrCircleBlurFragmentProcessor(const SkRect& circle,
+ float textureRadius, float innerRadius,
+ sk_sp<GrTextureProxy> blurProfile);
+
GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
- void onGetGLSLProcessorKey(const GrShaderCaps&,GrProcessorKeyBuilder*) const override;
- bool onIsEqual(const GrFragmentProcessor&) const override;
+
+ void onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const override;
+
+ bool onIsEqual(const GrFragmentProcessor& other) const override {
+ const GrCircleBlurFragmentProcessor& cbfp = other.cast<GrCircleBlurFragmentProcessor>();
+ return fCircle == cbfp.fCircle && fSolidRadius == cbfp.fSolidRadius &&
+ fTextureRadius == cbfp.fTextureRadius;
+ }
+
+ SkRect fCircle;
+ SkScalar fSolidRadius;
+ float fTextureRadius;
+ TextureSampler fBlurProfileSampler;
+
GR_DECLARE_FRAGMENT_PROCESSOR_TEST
- SkRect fCircleRect;
- float fTextureRadius;
- float fSolidRadius;
- TextureSampler fBlurProfileSampler;
+
typedef GrFragmentProcessor INHERITED;
};
+
#endif
#endif