Convert GrMagnifierEffect to a runtime FP
Change-Id: Ic44d272fff7a5bf8610b2f9b8e6c3270c54a20c6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/412957
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/src/utils/SkShadowUtils.cpp b/src/utils/SkShadowUtils.cpp
index 88ee681..9e7aa70 100644
--- a/src/utils/SkShadowUtils.cpp
+++ b/src/utils/SkShadowUtils.cpp
@@ -26,6 +26,7 @@
#include "src/core/SkPathPriv.h"
#include "src/core/SkRasterPipeline.h"
#include "src/core/SkResourceCache.h"
+#include "src/core/SkRuntimeEffectPriv.h"
#include "src/core/SkTLazy.h"
#include "src/core/SkVM.h"
#include "src/core/SkVerticesPriv.h"
@@ -87,13 +88,13 @@
GrFPResult SkGaussianColorFilter::asFragmentProcessor(std::unique_ptr<GrFragmentProcessor> inputFP,
GrRecordingContext*,
const GrColorInfo&) const {
- static auto effect = SkRuntimeEffect::MakeForColorFilter(SkString(R"(
+ static auto effect = SkMakeRuntimeEffect(SkRuntimeEffect::MakeForColorFilter, R"(
half4 main(half4 inColor) {
half factor = 1 - inColor.a;
factor = exp(-factor * factor * 4) - 0.018;
return half4(factor);
}
- )")).effect;
+ )");
auto fp = GrSkSLFP::Make(effect, "gaussian_fp");
return GrFPSuccess(GrFragmentProcessor::Compose(std::move(fp), std::move(inputFP)));
}