skia2/include/private
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
..
chromium serialize/draw GrSlug into a SkPicture 2022-03-16 15:24:43 +00:00
BUILD.bazel [includes] Enforce IWYU on sksl code 2022-03-21 12:43:02 +00:00
GrContext_Base.h Add maxSurfaceSampleCountForColorType to GrContextThreadSafeProxy 2022-03-01 15:13:40 +00:00
GrD3DTypesMinimal.h Reland "Add new GrSurfaceInfo class and related backend structs." 2021-09-20 20:44:53 +00:00
GrDawnTypesPriv.h Reland "Add new GrSurfaceInfo class and related backend structs." 2021-09-20 20:44:53 +00:00
GrGLTypesPriv.h Reland "Add new GrSurfaceInfo class and related backend structs." 2021-09-20 20:44:53 +00:00
GrImageContext.h [graphite] Move GrSingleOwner to skgpu::SingleOwner. 2022-01-21 18:22:53 +00:00
GrMockTypesPriv.h Reland "Add new GrSurfaceInfo class and related backend structs." 2021-09-20 20:44:53 +00:00
GrMtlTypesPriv.h Reland "Add new GrSurfaceInfo class and related backend structs." 2021-09-20 20:44:53 +00:00
GrTypesPriv.h Reland "Preserve base device origin on saveLayer and image filters" 2022-02-17 19:49:10 +00:00
GrVkTypesPriv.h Reland "Add new GrSurfaceInfo class and related backend structs." 2021-09-20 20:44:53 +00:00
OWNERS Reland "Add OWNERS to include (and include/private) to enforce API review" 2021-09-27 18:20:19 +00:00
SingleOwner.h [graphite] Add basic stubs for ResourceCache. 2022-02-04 19:25:11 +00:00
SkBitmaskEnum.h
SkChecksum.h Add std::string/string_view support to SkGoodHash. 2022-03-03 18:09:00 +00:00
SkColorData.h Fix implicit signedness change warnings in private includes 2021-05-13 17:10:44 +00:00
SkDeque.h Replace 'typedef xxxxx INHERITED' with 'using INHERITED = xxxx;'. 2020-09-03 03:41:26 +00:00
SkEncodedInfo.h Add color-depth detection 2022-03-07 18:22:52 +00:00
SkFixed.h move SkTPin to include/private 2020-10-16 19:45:11 +00:00
SkFloatBits.h
SkFloatingPoint.h Remove unneeded include from SkFloatingPoint.h. 2021-12-09 22:45:23 +00:00
SkHalf.h
SkIDChangeListener.h Remove bug-prone SkIDChangeListener singleThreaded arg 2021-02-26 17:05:53 +00:00
SkImageInfoPriv.h Reland "Add kR8_unorm_SkColorType" 2022-02-10 18:00:19 +00:00
SkMacros.h Make SkScalerContext enums scoped. 2022-03-08 16:24:47 +00:00
SkMalloc.h [fuzz] Standardize, document, and backport fuzzing defines. 2020-09-14 13:36:10 +00:00
SkMutex.h Assert in ~SkMutex that the mutex is unowned. 2022-02-14 15:23:12 +00:00
SkNoncopyable.h
SkNx_neon.h remove SkNx::rsqrt() 2021-04-14 20:54:08 +00:00
SkNx_sse.h Fix implicit signedness change warnings in private includes 2021-05-13 17:10:44 +00:00
SkNx.h remove SkNx::rsqrt() 2021-04-14 20:54:08 +00:00
SkOnce.h
SkOpts_spi.h Enable ClangTidy check llvm-namespace-comment. 2020-08-06 19:07:52 +00:00
SkPathRef.h Reland "[includes] Remove include link between SkPathRef.h and SkRRect.h" 2022-03-07 15:15:05 +00:00
SkSafe32.h
SkSafe_math.h
SkSemaphore.h
SkShadowFlags.h Add support for directional lights. 2020-12-16 16:58:26 +00:00
SkSLDefines.h Add ExpressionArray::clone. 2022-01-24 14:25:46 +00:00
SkSLIRNode.h Switched SkSL positions from int to Position 2022-03-14 17:06:17 +00:00
SkSLLayout.h Remove no-op versions of skstd::to_string. 2022-02-03 22:33:41 +00:00
SkSLModifiers.h Switched SkSL positions from int to Position 2022-03-14 17:06:17 +00:00
SkSLProgramElement.h Switched SkSL positions from int to Position 2022-03-14 17:06:17 +00:00
SkSLProgramKind.h Reland "Start on custom mesh API" 2021-12-21 16:08:49 +00:00
SkSLSampleUsage.h Use varyings to implement MatrixEffects applied to DeviceCoord FPs. 2021-08-02 19:39:13 +00:00
SkSLStatement.h Switched SkSL positions from int to Position 2022-03-14 17:06:17 +00:00
SkSLString.h [includes] Enforce IWYU on sksl code 2022-03-21 12:43:02 +00:00
SkSLSymbol.h Switched SkSL positions from int to Position 2022-03-14 17:06:17 +00:00
SkSpinlock.h
SkStringView.h Remove skstd::string_view entirely. 2022-02-01 21:16:41 +00:00
SkTArray.h Add #include <algorithm> to SkTArray.h 2022-02-22 21:52:15 +00:00
SkTDArray.h Add explicit int -> size_t casts to SkTDArray.h 2020-12-28 17:23:49 +00:00
SkTemplates.h Remove static from template functions in headers. 2022-02-08 20:17:04 +00:00
SkTFitsIn.h
SkTHash.h Use SkTHashMap for the MetalCodeGenerator. 2022-03-04 19:01:18 +00:00
SkThreadAnnotations.h Update Google3 thread annotations. 2022-02-09 15:47:22 +00:00
SkThreadID.h
SkTLogic.h Remove skstd::size and skstd::data. 2022-02-03 20:47:16 +00:00
SkTo.h
SkTPin.h switch SkTPin impl to pin NaN to lo 2020-10-16 21:08:51 +00:00
SkUniquePaintParamsID.h [graphite] Move ShaderCodeDictionary, SkPaintParamsKey, and UniquePaintParamsID to include/private 2022-01-13 14:22:11 +00:00
SkVx.h Remove unnecessary semi-colons 2022-02-11 22:13:11 +00:00
SkWeakRefCnt.h Replace 'typedef xxxxx INHERITED' with 'using INHERITED = xxxx;'. 2020-09-03 03:41:26 +00:00