Rename existing 'Blend' enums/names to 'BlendFilter'.
Change-Id: I17c624e9145d7152f65695ca3ce4592a11bb09a2
Bug: skia:12080
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/418637
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
diff --git a/bench/SkSLBench.cpp b/bench/SkSLBench.cpp
index 4e7064f..154853c 100644
--- a/bench/SkSLBench.cpp
+++ b/bench/SkSLBench.cpp
@@ -586,7 +586,7 @@
SkSL::Compiler compiler(&caps);
compiler.moduleForProgramKind(SkSL::ProgramKind::kRuntimeColorFilter);
compiler.moduleForProgramKind(SkSL::ProgramKind::kRuntimeShader);
- compiler.moduleForProgramKind(SkSL::ProgramKind::kRuntimeBlend);
+ compiler.moduleForProgramKind(SkSL::ProgramKind::kRuntimeBlendFilter);
int after = heap_bytes_used();
bench("sksl_compiler_runtimeeffect", after - before);
}
diff --git a/include/effects/SkRuntimeEffect.h b/include/effects/SkRuntimeEffect.h
index ac9fe97..32d0665 100644
--- a/include/effects/SkRuntimeEffect.h
+++ b/include/effects/SkRuntimeEffect.h
@@ -204,7 +204,7 @@
kUsesSampleCoords_Flag = 0x1,
kAllowColorFilter_Flag = 0x2,
kAllowShader_Flag = 0x4,
- kAllowBlend_Flag = 0x8,
+ kAllowBlendFilter_Flag = 0x8,
};
SkRuntimeEffect(SkString sksl,
@@ -227,7 +227,7 @@
bool usesSampleCoords() const { return (fFlags & kUsesSampleCoords_Flag); }
bool allowShader() const { return (fFlags & kAllowShader_Flag); }
bool allowColorFilter() const { return (fFlags & kAllowColorFilter_Flag); }
- bool allowBlend() const { return (fFlags & kAllowBlend_Flag); }
+ bool allowBlendFilter() const { return (fFlags & kAllowBlendFilter_Flag); }
const SkFilterColorProgram* getFilterColorProgram();
diff --git a/include/private/SkSLProgramKind.h b/include/private/SkSLProgramKind.h
index a340f01..e8cc587 100644
--- a/include/private/SkSLProgramKind.h
+++ b/include/private/SkSLProgramKind.h
@@ -22,7 +22,7 @@
kFragmentProcessor,
kRuntimeColorFilter, // Runtime effect only suitable as SkColorFilter
kRuntimeShader, // " " " " " SkShader
- kRuntimeBlend, // " " " " " a blending function
+ kRuntimeBlendFilter, // " " " " " SkBlendFilter
kGeneric,
};
diff --git a/src/core/SkRuntimeEffect.cpp b/src/core/SkRuntimeEffect.cpp
index afc8c8c..6b33208 100644
--- a/src/core/SkRuntimeEffect.cpp
+++ b/src/core/SkRuntimeEffect.cpp
@@ -187,7 +187,7 @@
switch (kind) {
case SkSL::ProgramKind::kRuntimeColorFilter: flags |= kAllowColorFilter_Flag; break;
case SkSL::ProgramKind::kRuntimeShader: flags |= kAllowShader_Flag; break;
- case SkSL::ProgramKind::kRuntimeBlend: flags |= kAllowBlend_Flag; break;
+ case SkSL::ProgramKind::kRuntimeBlendFilter: flags |= kAllowBlendFilter_Flag; break;
default: SkUNREACHABLE;
}
diff --git a/src/sksl/SkSLCompiler.cpp b/src/sksl/SkSLCompiler.cpp
index 15fa2af4..e653aad 100644
--- a/src/sksl/SkSLCompiler.cpp
+++ b/src/sksl/SkSLCompiler.cpp
@@ -298,13 +298,13 @@
return fRuntimeShaderModule;
}
-const ParsedModule& Compiler::loadRuntimeBlendModule() {
- if (!fRuntimeBlendModule.fSymbols) {
- fRuntimeBlendModule = this->parseModule(
- ProgramKind::kRuntimeBlend, MODULE_DATA(rt_blend), this->loadPublicModule());
- add_glsl_type_aliases(fRuntimeBlendModule.fSymbols.get(), fContext->fTypes);
+const ParsedModule& Compiler::loadRuntimeBlendFilterModule() {
+ if (!fRuntimeBlendFilterModule.fSymbols) {
+ fRuntimeBlendFilterModule = this->parseModule(
+ ProgramKind::kRuntimeBlendFilter, MODULE_DATA(rt_blend), this->loadPublicModule());
+ add_glsl_type_aliases(fRuntimeBlendFilterModule.fSymbols.get(), fContext->fTypes);
}
- return fRuntimeBlendModule;
+ return fRuntimeBlendFilterModule;
}
const ParsedModule& Compiler::moduleForProgramKind(ProgramKind kind) {
@@ -315,7 +315,7 @@
case ProgramKind::kFragmentProcessor: return this->loadFPModule(); break;
case ProgramKind::kRuntimeColorFilter: return this->loadRuntimeColorFilterModule(); break;
case ProgramKind::kRuntimeShader: return this->loadRuntimeShaderModule(); break;
- case ProgramKind::kRuntimeBlend: return this->loadRuntimeBlendModule(); break;
+ case ProgramKind::kRuntimeBlendFilter: return this->loadRuntimeBlendFilterModule(); break;
case ProgramKind::kGeneric: return this->loadPublicModule(); break;
}
SkUNREACHABLE;
diff --git a/src/sksl/SkSLCompiler.h b/src/sksl/SkSLCompiler.h
index bc5b14c..543f5ba 100644
--- a/src/sksl/SkSLCompiler.h
+++ b/src/sksl/SkSLCompiler.h
@@ -208,7 +208,7 @@
const ParsedModule& loadPublicModule();
const ParsedModule& loadRuntimeColorFilterModule();
const ParsedModule& loadRuntimeShaderModule();
- const ParsedModule& loadRuntimeBlendModule();
+ const ParsedModule& loadRuntimeBlendFilterModule();
/** Verifies that @if and @switch statements were actually optimized away. */
void verifyStaticTests(const Program& program);
@@ -248,7 +248,7 @@
ParsedModule fPublicModule; // [Root] + Public features
ParsedModule fRuntimeColorFilterModule; // [Public] + Runtime shader decls
ParsedModule fRuntimeShaderModule; // [Public] + Runtime color filter decls
- ParsedModule fRuntimeBlendModule; // [Public] + Runtime blend decls
+ ParsedModule fRuntimeBlendFilterModule; // [Public] + Runtime blend filter decls
// holds ModifiersPools belonging to the core includes for lifetime purposes
ModifiersPool fCoreModifiers;
diff --git a/src/sksl/SkSLMain.cpp b/src/sksl/SkSLMain.cpp
index 720fe49..1dce022 100644
--- a/src/sksl/SkSLMain.cpp
+++ b/src/sksl/SkSLMain.cpp
@@ -292,7 +292,7 @@
} else if (inputPath.ends_with(".fp")) {
kind = SkSL::ProgramKind::kFragmentProcessor;
} else if (inputPath.ends_with(".rtb")) {
- kind = SkSL::ProgramKind::kRuntimeBlend;
+ kind = SkSL::ProgramKind::kRuntimeBlendFilter;
} else if (inputPath.ends_with(".rtcf")) {
kind = SkSL::ProgramKind::kRuntimeColorFilter;
} else if (inputPath.ends_with(".rts")) {
diff --git a/src/sksl/dsl/DSLFunction.cpp b/src/sksl/dsl/DSLFunction.cpp
index 9f8ab44..cd8181d 100644
--- a/src/sksl/dsl/DSLFunction.cpp
+++ b/src/sksl/dsl/DSLFunction.cpp
@@ -46,7 +46,7 @@
SkSL::ProgramKind kind = DSLWriter::Context().fConfig->fKind;
if (isMain && (kind == ProgramKind::kRuntimeColorFilter ||
kind == ProgramKind::kRuntimeShader ||
- kind == ProgramKind::kRuntimeBlend ||
+ kind == ProgramKind::kRuntimeBlendFilter ||
kind == ProgramKind::kFragmentProcessor)) {
const SkSL::Type& type = param->fType.skslType();
// We verify that the signature is fully correct later. For now, if this is an .fp
diff --git a/src/sksl/ir/SkSLFunctionDeclaration.cpp b/src/sksl/ir/SkSLFunctionDeclaration.cpp
index 09d1b29..68b0559 100644
--- a/src/sksl/ir/SkSLFunctionDeclaration.cpp
+++ b/src/sksl/ir/SkSLFunctionDeclaration.cpp
@@ -92,7 +92,7 @@
ProgramKind kind = context.fConfig->fKind;
if (isMain && (kind == ProgramKind::kRuntimeColorFilter ||
kind == ProgramKind::kRuntimeShader ||
- kind == ProgramKind::kRuntimeBlend ||
+ kind == ProgramKind::kRuntimeBlendFilter ||
kind == ProgramKind::kFragmentProcessor)) {
// We verify that the signature is fully correct later. For now, if this is an .fp or
// runtime effect of any flavor, a float2 param is supposed to be the coords, and
@@ -178,7 +178,7 @@
}
break;
}
- case ProgramKind::kRuntimeBlend: {
+ case ProgramKind::kRuntimeBlendFilter: {
// (half4|float4) main(half4|float4, half4|float4)
if (!typeIsValidForColor(returnType)) {
errors.error(offset, "'main' must return: 'vec4', 'float4', or 'half4'");