skia2/resources/sksl/shared/StaticIf.sksl

12 lines
215 B
Plaintext
Raw Normal View History

uniform half4 colorRed, colorGreen;
half4 main(float2 coords) {
half4 result = colorRed;
# Enter a description of the change. Reland "Migrate if-statement simplifyStatement logic to IfStatement::Make." This reverts commit 7e685f0377b161637f5e091e3f7320197f000a70. Reason for revert: fixed SkSLBench perf test Original change's description: > Revert "Migrate if-statement simplifyStatement logic to IfStatement::Make." > > This reverts commit e4da7b672f4012cbbad92c32a2810df8ab28af9e. > > Reason for revert: breaks SkSLBench perf test > > Original change's description: > > Migrate if-statement simplifyStatement logic to IfStatement::Make. > > > > This performs essentially the same simplifications as before, just at > > a different phase of compilation. > > > > Change-Id: Ia88df6857d4089962505cd1281798fda74fd0b02 > > Bug: skia:11343, skia:11319 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/376177 > > Commit-Queue: John Stiles <johnstiles@google.com> > > Auto-Submit: John Stiles <johnstiles@google.com> > > Reviewed-by: Ethan Nicholas <ethannicholas@google.com> > > TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com > > Change-Id: I0051188ffe69426904066eb60a932435efdc2af8 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:11343 > Bug: skia:11319 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379062 > Reviewed-by: John Stiles <johnstiles@google.com> > Commit-Queue: John Stiles <johnstiles@google.com> Bug: skia:11343 Bug: skia:11319 Change-Id: I74cc3295004133e9fdcf16e388106eb83603f526 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379063 Reviewed-by: John Stiles <johnstiles@google.com> Commit-Queue: John Stiles <johnstiles@google.com>
2021-03-03 21:13:45 +00:00
const float x = 5;
const float y = 10;
@if (x < y) {
result = colorGreen;
}
return result;
}