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>
This commit is contained in:
parent
6ae690f8b2
commit
af8047dbb8
@ -586,7 +586,7 @@ void RunSkSLMemoryBenchmarks(NanoJSONResultsWriter* log) {
|
||||
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);
|
||||
}
|
||||
|
@ -204,7 +204,7 @@ private:
|
||||
kUsesSampleCoords_Flag = 0x1,
|
||||
kAllowColorFilter_Flag = 0x2,
|
||||
kAllowShader_Flag = 0x4,
|
||||
kAllowBlend_Flag = 0x8,
|
||||
kAllowBlendFilter_Flag = 0x8,
|
||||
};
|
||||
|
||||
SkRuntimeEffect(SkString sksl,
|
||||
@ -227,7 +227,7 @@ private:
|
||||
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();
|
||||
|
||||
|
@ -22,7 +22,7 @@ enum class ProgramKind : int8_t {
|
||||
kFragmentProcessor,
|
||||
kRuntimeColorFilter, // Runtime effect only suitable as SkColorFilter
|
||||
kRuntimeShader, // " " " " " SkShader
|
||||
kRuntimeBlend, // " " " " " a blending function
|
||||
kRuntimeBlendFilter, // " " " " " SkBlendFilter
|
||||
kGeneric,
|
||||
};
|
||||
|
||||
|
@ -187,7 +187,7 @@ SkRuntimeEffect::Result SkRuntimeEffect::Make(SkString sksl,
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -298,13 +298,13 @@ const ParsedModule& Compiler::loadRuntimeShaderModule() {
|
||||
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 @@ const ParsedModule& Compiler::moduleForProgramKind(ProgramKind kind) {
|
||||
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;
|
||||
|
@ -208,7 +208,7 @@ private:
|
||||
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 @@ private:
|
||||
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;
|
||||
|
@ -292,7 +292,7 @@ ResultCode processCommand(std::vector<SkSL::String>& args) {
|
||||
} 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")) {
|
||||
|
@ -46,7 +46,7 @@ void DSLFunction::init(const DSLType& returnType, const char* name,
|
||||
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
|
||||
|
@ -92,7 +92,7 @@ static bool check_parameters(const Context& context,
|
||||
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 @@ static bool check_main_signature(const Context& context, int offset, const Type&
|
||||
}
|
||||
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'");
|
||||
|
Loading…
Reference in New Issue
Block a user