skia2/tests/sksl
John Stiles 7591d4b5ef Replace trio of XxxxLiteral types with a single Literal type.
Throughout SkSL we've begun using doubles as a convenient way to store
any SkSL value (int, float, bool) in a single type. This idea has now
been extended to literals. Rather than having three expression kinds for
integers, floats and boolean literals, we can have just one. These can
be accessed in a type-specific way (`floatValue`, `intValue`, and
`boolValue` return the expected type, or assert if it's not the
matching type), or in a type-agnostic way (`value` will return a double
and works on any type of Literal).

This allows us to remove a complex template trick (Literal<T> is gone),
removes two redundant Expression types, and and lets us reduce our code
size in ConstantFolder, FunctionCall, etc.

Most of the conversion process was pretty straightforward:
* `IntLiteral::Make` becomes `Literal::MakeInt`
* `x.is<IntLiteral>()` becomes `x.isIntLiteral()`
* `x.as<IntLiteral>.value()` becomes `x.as<Literal>.intValue()`

Change-Id: Ic328533611e4551669c7fc9d7f9c03e34699f3f6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/447836
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-09-13 17:32:34 +00:00
..
blend Revert "Add RelaxedPrecision decoration to function-call temp vars." 2021-09-08 17:06:07 +00:00
errors Replace trio of XxxxLiteral types with a single Literal type. 2021-09-13 17:32:34 +00:00
folding Remove 0/x arithmetic simplification. 2021-08-24 19:18:41 +00:00
glsl When force-high-precision is enabled, change default precision 2021-07-07 19:56:36 +00:00
inliner Fix inliner bug discovered by fuzzer. 2021-09-07 13:29:37 +00:00
intrinsics Replace trio of XxxxLiteral types with a single Literal type. 2021-09-13 17:32:34 +00:00
metal SkSL: Turn DSL parser off again 2021-09-07 14:21:57 +00:00
runtime Improve unit testing of for-loops. 2021-09-07 14:11:04 +00:00
runtime_errors Fixed illegal interface block reporting 2021-09-07 20:18:00 +00:00
shared Revert "Add RelaxedPrecision decoration to function-call temp vars." 2021-09-08 17:06:07 +00:00
spirv Fix parsing error with SPIR-V negating a uint. 2021-08-25 17:52:50 +00:00
workarounds Reland "Don't key progams/pipelines on origin."" 2021-07-07 14:50:10 +00:00
README.txt Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00

This directory contains skslc-compiled output from matching source files
in the /resources/sksl/ directory.