Major refactor of runtime effects

Adds SkRuntimeEffect, a ref-counted object to hold SkSL,
a Compiler, and compiled Program, along with uniform info.

Removes the old SkSLFP factory and factory cache types.
Caching is done by simply holding on to the effect (or
the shader/color filter factories, which own an effect).

The effect class is simply ref'd by the factories, the
shader and color filter types, and the FP.

NOTE: Changes to public headers only affect private functions.

Change-Id: I0c1401505cb234e83943ad4ef2db6680f4c69fb9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/259336
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index cd560f1..b405501 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -25,6 +25,7 @@
 #include "src/core/SkMipMap.h"
 #include "src/core/SkPaintPriv.h"
 #include "src/core/SkResourceCache.h"
+#include "src/core/SkRuntimeEffect.h"
 #include "src/core/SkTraceEvent.h"
 #include "src/gpu/GrBitmapTextureMaker.h"
 #include "src/gpu/GrCaps.h"
@@ -34,7 +35,6 @@
 #include "src/gpu/GrPaint.h"
 #include "src/gpu/GrProxyProvider.h"
 #include "src/gpu/GrRecordingContextPriv.h"
-#include "src/gpu/GrSkSLFPFactoryCache.h"
 #include "src/gpu/GrTextureProxy.h"
 #include "src/gpu/GrXferProcessor.h"
 #include "src/gpu/effects/GrBicubicEffect.h"
@@ -469,8 +469,8 @@
         grPaint->numColorFragmentProcessors() > 0) {
         int32_t ditherRange = dither_range_type_for_config(ct);
         if (ditherRange >= 0) {
-            static int ditherIndex = GrSkSLFP::NewIndex();
-            auto ditherFP = GrSkSLFP::Make(context, ditherIndex, "Dither", SKSL_DITHER_SRC,
+            static auto ditherEffect = SkRuntimeEffect::Make(SkString(SKSL_DITHER_SRC));
+            auto ditherFP = GrSkSLFP::Make(context, ditherEffect, "Dither",
                                            &ditherRange, sizeof(ditherRange));
             if (ditherFP) {
                 grPaint->addColorFragmentProcessor(std::move(ditherFP));