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/GrContextThreadSafeProxy.cpp b/src/gpu/GrContextThreadSafeProxy.cpp
index 6fe042d..fb27ba1 100644
--- a/src/gpu/GrContextThreadSafeProxy.cpp
+++ b/src/gpu/GrContextThreadSafeProxy.cpp
@@ -12,7 +12,6 @@
#include "include/gpu/GrContext.h"
#include "src/gpu/GrBaseContextPriv.h"
#include "src/gpu/GrCaps.h"
-#include "src/gpu/GrSkSLFPFactoryCache.h"
#include "src/gpu/effects/GrSkSLFP.h"
#include "src/image/SkSurface_Gpu.h"
@@ -28,9 +27,8 @@
GrContextThreadSafeProxy::~GrContextThreadSafeProxy() = default;
-bool GrContextThreadSafeProxy::init(sk_sp<const GrCaps> caps,
- sk_sp<GrSkSLFPFactoryCache> FPFactoryCache) {
- return INHERITED::init(std::move(caps), std::move(FPFactoryCache));
+bool GrContextThreadSafeProxy::init(sk_sp<const GrCaps> caps) {
+ return INHERITED::init(std::move(caps));
}
SkSurfaceCharacterization GrContextThreadSafeProxy::createCharacterization(
@@ -104,20 +102,15 @@
}
////////////////////////////////////////////////////////////////////////////////
-sk_sp<GrSkSLFPFactoryCache> GrContextThreadSafeProxyPriv::fpFactoryCache() {
- return fProxy->fpFactoryCache();
-}
-
sk_sp<GrContextThreadSafeProxy> GrContextThreadSafeProxyPriv::Make(
GrBackendApi backend,
const GrContextOptions& options,
uint32_t contextID,
- sk_sp<const GrCaps> caps,
- sk_sp<GrSkSLFPFactoryCache> cache) {
+ sk_sp<const GrCaps> caps) {
sk_sp<GrContextThreadSafeProxy> proxy(new GrContextThreadSafeProxy(backend, options,
contextID));
- if (!proxy->init(std::move(caps), std::move(cache))) {
+ if (!proxy->init(std::move(caps))) {
return nullptr;
}
return proxy;