diff --git a/src/core/SkShaderCodeDictionary.h b/src/core/SkShaderCodeDictionary.h index f182a0dd45..b4f0cc1ee1 100644 --- a/src/core/SkShaderCodeDictionary.h +++ b/src/core/SkShaderCodeDictionary.h @@ -96,15 +96,20 @@ struct SkShaderSnippet { // for program creation and its invocation. class SkShaderInfo { public: + SkShaderInfo(SkRuntimeEffectDictionary* rteDict = nullptr) + : fRuntimeEffectDictionary(rteDict) {} + ~SkShaderInfo() = default; + SkShaderInfo(SkShaderInfo&&) = default; + SkShaderInfo& operator=(SkShaderInfo&&) = default; + SkShaderInfo(const SkShaderInfo&) = delete; + SkShaderInfo& operator=(const SkShaderInfo&) = delete; + void add(const SkPaintParamsKey::BlockReader& reader) { fBlockReaders.push_back(reader); } void addFlags(SnippetRequirementFlags flags) { fSnippetRequirementFlags |= flags; } - void addRuntimeEffectDictionary(SkRuntimeEffectDictionary* dict) { - fRuntimeEffectDictionary = dict; - } bool needsLocalCoords() const { return fSnippetRequirementFlags & SnippetRequirementFlags::kLocalCoords; } diff --git a/src/gpu/graphite/mtl/MtlGraphicsPipeline.mm b/src/gpu/graphite/mtl/MtlGraphicsPipeline.mm index a958fda6f3..2287637d15 100644 --- a/src/gpu/graphite/mtl/MtlGraphicsPipeline.mm +++ b/src/gpu/graphite/mtl/MtlGraphicsPipeline.mm @@ -164,11 +164,10 @@ std::string get_sksl_fs(SkShaderCodeDictionary* dict, return {}; } - SkShaderInfo shaderInfo; + SkShaderInfo shaderInfo(rteDict); dict->getShaderInfo(desc.paintParamsID(), &shaderInfo); *blendInfo = shaderInfo.blendInfo(); - shaderInfo.addRuntimeEffectDictionary(rteDict); return shaderInfo.toSkSL(); }