Replace addRuntimeEffectDictionary with constructor argument.
Change-Id: I695a76d5b0aad2ffcf8c1e074c465ed3f60016e4 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/557058 Commit-Queue: John Stiles <johnstiles@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
This commit is contained in:
parent
34e9334877
commit
a43654ec7e
@ -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;
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user