Commit Graph

10 Commits

Author SHA1 Message Date
John Stiles
981b140e2f Eliminate DSLPossibleStatement.
Unlike DSLPossibleExpression, this was only used in a few rare places,
so it was much easier to remove.

Change-Id: I483dc061691f89d3e808d5bbc23c500bc57b680a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/542662
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2022-05-31 15:35:12 +00:00
John Stiles
91e4c7847e Remove C++14 workaround code.
We no longer support compiling in C++14, so we don't need these
workarounds anymore.

Change-Id: Idec5a90e98c242928182f4b32dd47459be8ca47f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/541075
Reviewed-by: Arman Uguray <armansito@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Arman Uguray <armansito@google.com>
2022-05-18 13:53:00 +00:00
Ethan Nicholas
885c1d3048 Removed Position::Capture
It was decided that being able to report positions from C++ code is not
worth the cost of having all of these captures everywhere.

Change-Id: I94981d9f780bd95df8b56198210c9cdd5f16239c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/528366
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2022-04-08 17:26:24 +00:00
Kevin Lubick
08ece0c9a0 [includes] Enforce IWYU on sksl code
PS1 regenerates the Bazel files. Use it as the base change when
    comparing patchsets.

IWYU seems to do a good job of working with MyFile.cpp and
MyFile.h, but if there is just a MyHeader.h, it doesn't always
seem to throw errors if the includes aren't correct. This was
observed with include/sksl/DSL.h This might be due to the fact
that headers are not compiled on their own, so they are never
sent directly to the IWYU binary.

This change sets enforce_iwyu_on_package() on the all sksl
packages and then fixes the includes until all those checks
are happy. There were a few files that needed fixes outside
of the sksl folder. Examples include:
 - src/gpu/effects/GrConvexPolyEffect.cpp
 - tests/SkSLDSLTest.cpp

To really enforce this, we need to add a CI/CQ job that runs
bazel build //example:hello_world_gl --config=clang \
  --sandbox_base=/dev/shm --features skia_enforce_iwyu

If that failed, a dev could make the changes described in
the logs and/or run the command locally to see those
prescribed fixes.

I had to add several entries to toolchain/IWYU_mapping.imp
in order to fix some private includes and other atypical
choices. I tried adding a rule there to allow inclusion of
SkTypes.h to make sure defines like SK_SUPPORT_GPU, but
could not get it to work for all cases, so I deferred to
using the IWYU pragma: keep (e.g. SkSLPipelineStageCodeGenerator.h)

Change-Id: I4c3e536d8e69ff7ff2d26fe61a525a6c2e80db06
Bug: skia:13052
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522256
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2022-03-21 12:43:02 +00:00
Ethan Nicholas
9cd8456afe Renamed SkSL::PositionInfo to SkSL::Position
Change-Id: I1fa160941b18392616708f4e08a4ebbf7398480e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/518521
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2022-03-09 17:37:38 +00:00
Ethan Nicholas
360db877be Fix line numbers of several DSLParser errors
Change-Id: I82e0d29fbcb5be93fe20a1fb442e2a429e6cab8e
Bug: skia:12411
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/445644
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-09-03 22:12:22 +00:00
Ethan Nicholas
08ac524b43 Added operator= on DSLCase
Needed by DSLParser, and should have been defined anyway.

Change-Id: Ieaabe493a8caef80dda30f2ab35068f358901885
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/417677
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-06-10 22:29:24 +00:00
Ethan Nicholas
722cb67b09 Improved DSL APIs in preparation for DSLParser
This includes several new array variants of existing APIs, DSLBlock now
supporting SymbolTables, and a couple of other minor changes needed by
the upcoming DSLParser.

Change-Id: I71feb268feb27cf7ff453cc59046091779bffe06
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/404779
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-05-06 15:46:47 +00:00
Ethan Nicholas
8a6537d87e Added DSL support for static if & switch statements
Change-Id: If11443997ae29266bf46da77c1e4f9583fa3f5a5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/402577
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-04-30 17:31:49 +00:00
Ethan Nicholas
daed2592bb Made SkSL DSL into public API
In addition to the unsurprising changes to eliminate references to
src/, we also had to tighten up some C++17-isms as they are not
permitted in public headers.

Change-Id: Ie5005a33d7a135e69fb66beca5e7a5f960dbd453
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/378496
Reviewed-by: Brian Osman <brianosman@google.com>
2021-03-04 21:03:58 +00:00