Remove GrBlurredEdgeFragmentProcessor, use GrRuntimeFPBuilder
Change-Id: Ia5d849a2ab3fc233c4feacb5198a0684978ca3a9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/410794
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/src/utils/SkShadowUtils.cpp b/src/utils/SkShadowUtils.cpp
index e46e7a6..709c9e5 100644
--- a/src/utils/SkShadowUtils.cpp
+++ b/src/utils/SkShadowUtils.cpp
@@ -32,7 +32,7 @@
#include "src/utils/SkShadowTessellator.h"
#include <new>
#if SK_SUPPORT_GPU
-#include "src/gpu/effects/generated/GrBlurredEdgeFragmentProcessor.h"
+#include "src/gpu/effects/GrSkSLFP.h"
#include "src/gpu/geometry/GrStyledShape.h"
#endif
@@ -87,7 +87,15 @@
GrFPResult SkGaussianColorFilter::asFragmentProcessor(std::unique_ptr<GrFragmentProcessor> inputFP,
GrRecordingContext*,
const GrColorInfo&) const {
- return GrFPSuccess(GrBlurredEdgeFragmentProcessor::Make(std::move(inputFP)));
+ static constexpr char kCode[] = R"(
+ half4 main(half4 inColor) {
+ half factor = 1 - inColor.a;
+ factor = exp(-factor * factor * 4) - 0.018;
+ return half4(factor);
+ }
+ )";
+ auto builder = GrRuntimeFPBuilder::Make<kCode, SkRuntimeEffect::MakeForColorFilter>();
+ return GrFPSuccess(GrFragmentProcessor::Compose(builder.makeFP(), std::move(inputFP)));
}
#endif