These aren't currently used (we recompute them from the PaintParamsKey)
and are only getting in the way as we change how we accumulate uniforms.
We can always re-add them if the recomputation becomes a hot spot.
Bug: skia:12701
Change-Id: Id91ea0d27543666c75c154fc585d954c5f89aded
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/526270
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Bounds are stored as floats, preserving exact coords instead of trying
to round in or out for pixel bounds. This is the major functional
implication that now differentiates behavior from v1::ClipStack.
Most of the changes are just updating to the appropriate API. One thing
to note is that Rect::intersect() outputs an empty/negative rectangle
if the inputs do not intersect, which is what we want in ClipStack but
had to be explicitly checked for with SkRect/SkIRect's behavior.
Bug: skia:12698
Change-Id: I94e8c67eba5091406f8722f7f8b76938db9eac3c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/526458
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
PS1 is the exact contents of src/gpu/v1/ClipStack.* copied to
experimental/graphite/src.
PS2+ shows all the changes to remove v1-only features and update some of
the types over to what graphite uses. The major changes are:
1. FragmentProcessors, clip atlases, stencil mask writing, and SW mask
writing are gone.
2. SW mask caching and tracking are gone.
3. Graphite is effectively in the "forceAA" mode that the original clip
stack supported. So branches that focused on non-AA, or comparing AA
or handling cases where elements' AA mismatched could all be removed.
4. Updated to use Graphite's Shape and Transform classes. Did not go as
far as moving the bounds from SkIRect to Rect, but since everything
is AA, it will be much simpler to switch to comparing float bounds
directly and not worry about rounding in or out. That's a more
substantial change so will come later.
5. The original ClipStack had a "Draw" type that was used to compute
clip interactions between SaveRecords and Elements. It was always
just device-space bounds because of limitations of the GrClip API.
In Graphite, we can use the exact same set of info for Draws and
Elements, making interaction tests share code and be more accurate.
Since that's a more involved change, I just removed the simpler Draw
type from this version for now.
6. Tried to add TODOs for what logic and extra state will need to be
added to actually apply graphite's clip stack as depth-only draws.
Bug: skia:12698
Change-Id: I418703e8f759cd5e1ddd1e302a864bf2204cf040
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/525516
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
This doesn't reuse memory w/in the gatherer but sets us up to do so.
Bug: skia:12701
Change-Id: If5ed962e73609b113581ed2bd681e872fe3214c0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/526029
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Following the philosophy that DrawContext should be as simple as
possible, the work that sets up the upload should be done higher up.
If we need to share the code, that can be handled by a helper class or
function.
Bug: skia:12845
Change-Id: Ib0308ce816e545ccffb5ddbe3d9bcc302349397f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/526025
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
ASAN detected this leak.
Change-Id: I7f54cbe35ac36d288d2fa676cf0192a793686ba1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/526077
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
This doesn't actually change the memory allocation but sets up to do so.
90% of the CL is just renaming SkPipelineData to SkPipelineDataGatherer.
The main interesting changes are those to:
ExtractPaintData
in DrawPass.cpp
and SkPipelineData.h/.cpp
Bug: skia:12701
Change-Id: I3e18f9b3f16166649de1bf1f4399d5521d817eb3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524763
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Bug: skia:12845
Change-Id: I8e9d7dcfaf4f356b65638f0f8490edd8b0dd2644
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/525177
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
In nanobench we want to try and simulate a GPUs swapbuffering and not
get too far ahead on the CPU. Thus we use finished callbacks to know if
we get more than 3 frames ahead of the GPU. This CL adds support for
Graphite to do this.
Bug: skia:12974
Change-Id: I8be505c5769399dcc0f5954f9f999f4448633647
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/525186
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
This simplifies the IR and emits cleaner Metal code; Metal does not
directly support matrix-construction from a list of scalars.
Change-Id: I0f2415e4c84d4f999aaaeaec3623f0eae41c24dc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/525179
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Steps to run:
make -C bazel generate
bazelisk build //example:hello_world_gl --config=linux-rbe \
--features skia_enforce_iwyu
# manual fixes of the .h and .cpp files
make -C bazel generate
This will be followed up by a CQ job that checks the generated
Bazel files.
Bug: skia:12541
Change-Id: I7651f885e182a60177839cd78a2d4047e73a676a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/525181
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
* Removes unnecessary static function (it's been copied elsewhere).
* Uses Caps info for colorTypeToFormat.
Bug: skia:12845
Change-Id: I557da58ec4456db1d8b1bb9a3d419e3330200a47
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/525178
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Bug: skia:12845
Change-Id: If3ac2b6ba2c8e28328ee5805a29fc83353220364
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524756
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Most of these are pretty mechanical generated changes.
IWYU noticed one issue with DSLCore.h, which was fixed here.
Change-Id: I5629565ad3c2817daa71907c62f932d93f9d78ab
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524617
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Bug: skia:12701
Change-Id: Ib7e52f26b31cfed8fb4da1929755035a69951ca5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524220
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This also reworks a little bit about what we send to insertRecording
and what we store on Context.
Bug: skia:12974
Change-Id: I747a1cdd1559d4d5fbe928e689a23a734142557b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524012
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Bug: skia:12787
Change-Id: I5d061d535878df55ce57add7d0831e86caadc321
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524009
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Bug: skia:12701
Change-Id: Ide780f9dac1b92855e634726d261630ef5d017fc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/523426
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Bug: skia:13086
Change-Id: I5276f44ee4101a05357408a206050a54ced19adc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/523428
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Bug: skia:13086
Change-Id: I0fc3243fb3f3974a32726237358522171ae33c41
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/523419
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
This adds caching and uniquifying of SkTextureDataBlocks to parallel
our treatment of SkUniformDataBlocks.
Bug: skia:12701
Change-Id: Ib4474f48b9048daf4b848ccbb339cb42246f184b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/523418
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
The static functionality for writing vertex buffers, constants, and
utility functions that were in the StrokeTessellator and PathTessellator
classes have been moved into Tessellation.h and a new
FixedCountBufferUtils.h.
The tessellator hierarchy has been moved into src/gpu/ops and all the
v1 guards are removed since they were already solely v1 after the static
functions were lifted out. The hierarchy and subclasses are preserved
but have been combined into just StrokeTessellator.h and
PathTessellator.h instead of separate files for the subclasses.
All the rest of the little changes are updating references and includes.
Bug: skia:13012
Change-Id: I90f2f53538349cf9ad1823a0c42fbdc772190a49
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/523189
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Creates a new shared routine ReadPixelsHelper used by this and
Device::readPixels(). Also added MakeBitmapProxyView to the
shared file and cleaned up some headers.
Bug: skia:12845
Change-Id: I05533d2f47688daf4f14c8171eb7cd7178b4c0ea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/521958
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
We are going to cache (and uniquify) the UniformBlocks and TextureBlocks
separate from each other.
Bug: skia:12701
Change-Id: I03837c4a38a9bdeb4224a697eab119fca24e8f8c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522916
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
We may re-split this later but, for now, this is simpler.
Bug: skia:12701
Change-Id: Ibb9c6fca8e6ca328c8c203c3b1399b6be7a45425
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522917
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This regenerates the files and fixes the harfbuzz rule so CanvasKit
compiles.
Change-Id: I2db2bddaabf793f360e8a4fa1a6a2b96222dfdf8
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522816
Reviewed-by: Ben Wagner <bungeman@google.com>
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>
Progress on exposing the RenderSteps used in the one renderer for
re-use with new renderers.
Cq-Include-Trybots: luci.skia.skia.primary:Test-Mac12-Clang-MacBookPro16.2-GPU-IntelIrisPlus-x86_64-Debug-All-Graphite,Test-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Release-All-Graphite,Test-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Debug-All-ASAN_Graphite,Test-Mac10.15.7-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Debug-All-Graphite,Perf-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Release-All-Graphite,Perf-Mac10.15.7-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Release-All-Graphite,Build-Mac-Clang-x86_64-Release-Graphite,Build-Mac-Clang-x86_64-Debug-Graphite,Build-Mac-Clang-arm64-Release-iOS_Graphite,Build-Mac-Clang-arm64-Release-Graphite,Build-Mac-Clang-arm64-Debug-iOS_Graphite,Build-Mac-Clang-arm64-Debug-Graphite_NoGpu,Build-Mac-Clang-arm64-Debug-Graphite,Build-Mac-Clang-arm64-Debug-ASAN_Graphite
Bug: skia:12703
Change-Id: I134c79c37f2cdee40558161c9e73dc3221188e67
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/521959
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
We are going to cache the uniform data and the texture data separately.
Begin by making the uniform data something that could be cached on its own.
Bug: skia:12701
Change-Id: If3ea3a9b6050faf0810549d4076ae44732656a9e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522178
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
We're going to cache and uniquify texture bindings separate from
uniform bindings. Split up the 'fUniformKey' w/in the SortKey in
preparation.
Note that caching the uniforms separate from the texture bindings
should reduce some of the size pressure on the ShadingUniformField.
Bug: skia:12701
Change-Id: I8c7af5e5d5c796f5cc46cab168ee4800c92aba81
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522257
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This is in preparation for additional tessellation-based RenderSteps.
Cq-Include-Trybots: luci.skia.skia.primary:Test-Mac12-Clang-MacBookPro16.2-GPU-IntelIrisPlus-x86_64-Debug-All-Graphite,Test-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Release-All-Graphite,Test-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Debug-All-ASAN_Graphite,Test-Mac10.15.7-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Debug-All-Graphite,Perf-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Release-All-Graphite,Perf-Mac10.15.7-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Release-All-Graphite,Build-Mac-Clang-x86_64-Release-Graphite,Build-Mac-Clang-x86_64-Debug-Graphite,Build-Mac-Clang-arm64-Release-iOS_Graphite,Build-Mac-Clang-arm64-Release-Graphite,Build-Mac-Clang-arm64-Debug-iOS_Graphite,Build-Mac-Clang-arm64-Debug-Graphite_NoGpu,Build-Mac-Clang-arm64-Debug-Graphite,Build-Mac-Clang-arm64-Debug-ASAN_Graphite
Bug: skia:12703
Change-Id: I497ea14802201be10535ee26147838b28ab6b34d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/521957
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Bug: skia:12845
Change-Id: I46e37ae0c1a8b0587aee3eb9e8cad728d8f61783
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/520738
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Change-Id: Ie7bc325af6280e7714798d0d418e045f798cc2fd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/521842
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
This allows us to create one-off UploadTasks to submit to the Recorder,
e.g. for makeTextureImage().
Also renames UploadCommand to UploadInstance to avoid confusion with
addCommand() method.
Bug: skia:12845
Change-Id: I6cad6f6df6406d1d790ecf6297996fb7ab376f54
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/521362
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Bug: skia:12845
Change-Id: Iebaacfbb341554886fee1415aaf44fb0e44df723
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/521524
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
The MTLDepthStencilState objects are only refed in MtlResourceProvider.
When we shut down, we tear down all the Recorders. That tears down their
resource providers, which in the Metal case deletes these DepthStencil
objects. But we can have a command buffer still in flight, so we need to
add a ref to keep those objects alive.
Bug: skia:13068
Change-Id: Ic2fb8fdd83c5323505fa4ccda509e28a8c7e3bfc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/521521
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
It is not necessary to convert the per-vertex color generated by a
tesselated shadow since the vertex colors are only used to generate an
alpha-gradient (with rgb=000) to modulate the actual "ambient" and
"spot" colors, which are already converted to the destination space on
the CPU.
This change removes this unnecessary extra step in both the CPU-raster
and GPU backends. This is done by introducing a "skipColorXform" flag to
SkDevice::drawVertices.
Tested the change by comparing GM_shadow_utils output in Rec. 2020 color
mode with the original output and observing no differences. Verfied
using viewer that the generated SkSL shaders used in the OpenGL and
Vulkan backends no longer inject color space transformation code for
shadows that use drawVertices as they did before.
Bug: skia:11848
Change-Id: Idfaf928eb3b6dada2940cba77861890cd38fe25b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/521616
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Arman Uguray <armansito@google.com>
Cq-Include-Trybots: luci.skia.skia.primary:Build-Mac-Clang-arm64-Debug-ASAN_Graphite,Build-Mac-Clang-arm64-Debug-Graphite,Build-Mac-Clang-arm64-Debug-Graphite_NoGpu,Build-Mac-Clang-arm64-Debug-iOS_Graphite,Build-Mac-Clang-arm64-Release-Graphite,Build-Mac-Clang-arm64-Release-iOS_Graphite,Build-Mac-Clang-x86_64-Debug-Graphite,Build-Mac-Clang-x86_64-Release-Graphite,Perf-Mac10.15.7-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Release-All-Graphite,Perf-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Release-All-Graphite,Test-Mac10.15.7-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Debug-All-Graphite,Test-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Debug-All-ASAN_Graphite,Test-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Release-All-Graphite,Test-Mac12-Clang-MacBookPro16.2-GPU-IntelIrisPlus-x86_64-Debug-All-Graphite
Bug: skia:12703
Change-Id: Ie80d495f38614f9b5d0b09741ca0d24560ebe870
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/520976
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
PS1 regenerates the Bazel files.
It is recommended to review this CL with a diff from PS1.
Example output when a file does not pass the test:
tools/sk_app/CommandSet.h should add these lines:
#include "include/core/SkTypes.h"
#include "include/private/SkTArray.h"
#include "tools/skui/InputState.h"
#include "tools/skui/Key.h"
#include "tools/skui/ModifierKey.h"
namespace sk_app { class Window; }
tools/sk_app/CommandSet.h should remove these lines:
- #include "tools/sk_app/Window.h"
The full include-list for tools/sk_app/CommandSet.h:
#include "include/core/SkString.h"
#include "include/core/SkTypes.h"
#include "include/private/SkTArray.h"
#include "tools/skui/InputState.h"
#include "tools/skui/Key.h"
#include "tools/skui/ModifierKey.h"
#include <functional>
#include <vector>
class SkCanvas;
namespace sk_app { class Window; }
---
This makes use of Bazel's toolchain features
https://bazel.build/docs/cc-toolchain-config-reference#features
to allow us to configure compiler flags when compiling
individual files. This analysis is off by default, and can
be turned on with --features skia_enforce_iwyu. When enabled,
it will only be run for files that have opted in.
Example:
bazelisk build //example:hello_world_gl --config=clang \
--sandbox_base=/dev/shm --features skia_enforce_iwyu
There are two ways to opt files in:
- Add enforce_iwyu = True to a generated_cc_atom rule
- Add enforce_iwyu_on_package() to a BUILD.bazel file
(which enforces IWYU for all rules in that file)
Note that Bazel does not propagate features to dependencies
or dependents, so trying to enable the feature on cc_library
or cc_executable targets will only impact any files listed in
srcs or hdrs, not deps. This may be counter-intuitive when
compared to things like defines.
IWYU supports a mapping file, which we supply to help properly
handle things system headers (//toolchain/IWYU_mapping.imp)
Suggested Review Order:
- toolchain/build_toolchain.bzl to see how we get the IWYU
binaries into the toolchain
- toolchain/BUILD.bazel and toolchain/IWYU_mapping.imp
to see how the mapping file is made available for
all compile steps
- toolchain/clang_toolchain_config.bzl, where we define the
skia_enforce_iwyu feature to turn on any verification at
all and skia_opt_file_into_iwyu to enable the check for
specific files using a define.
- toolchain/clang_trampoline.sh, which is the toolchain is
configured to call instead of clang directly (see line 83
of clang_toolchain_config.bzl). This bash script used to
just forward all arguments directly onto clang. Now it
inspects them and either calls clang directly (if
it does not find the define in the arguments or we are
linking [bazel sometimes links with clang instead of ld])
or calls clang and then include-what-you-use. In all cases,
the trampoline sends the arguments to clang and IWYU
unchanged).
- //tools/sk_app/... to see enforcement enabled (and fixed)
for select files, as an example of that method.
- //experimental/bazel_test/... to see enforcement enabled
for all rules in a BUILD.bazel file.
- all other files.
Change-Id: I60a2ea9d5dc9955b6a8f166bd449de9e2b81a233
Bug: skia:13052
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/519776
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
This is a short term solution. The linked bug has more details about
where we want to land. As is, this doesn't use much of the resource key
system but ideally should be updated to do so if we can handle resource
tracking w/in the CommandBuffer efficiently.
Alternatively we may pursue a direction where that is moot because it's
cached globally or held directly by the RenderStep.
As-is, this is a simple approach and should produce equivalent behavior
from a GPU command perspective in the single Recorder situation we are
in currently.
Cq-Include-Trybots: luci.skia.skia.primary:Test-Mac12-Clang-MacBookPro16.2-GPU-IntelIrisPlus-x86_64-Debug-All-Graphite,Test-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Release-All-Graphite,Test-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Debug-All-ASAN_Graphite,Test-Mac10.15.7-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Debug-All-Graphite,Build-Mac-Clang-x86_64-Release-Graphite,Build-Mac-Clang-x86_64-Debug-Graphite,Build-Mac-Clang-arm64-Release-iOS_Graphite,Build-Mac-Clang-arm64-Release-Graphite,Build-Mac-Clang-arm64-Debug-iOS_Graphite,Build-Mac-Clang-arm64-Debug-Graphite_NoGpu,Build-Mac-Clang-arm64-Debug-Graphite,Build-Mac-Clang-arm64-Debug-ASAN_Graphite
Bug: skia:13059
Change-Id: I6a110fafe2b69a8bfbc3d859b02d916c973baf26
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/520737
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Cq-Include-Trybots: luci.skia.skia.primary:Test-Mac12-Clang-MacBookPro16.2-GPU-IntelIrisPlus-x86_64-Debug-All-Graphite,Test-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Release-All-Graphite,Test-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Debug-All-ASAN_Graphite,Test-Mac10.15.7-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Debug-All-Graphite,Build-Mac-Clang-x86_64-Release-Graphite,Build-Mac-Clang-x86_64-Debug-Graphite,Build-Mac-Clang-arm64-Release-iOS_Graphite,Build-Mac-Clang-arm64-Release-Graphite,Build-Mac-Clang-arm64-Debug-iOS_Graphite,Build-Mac-Clang-arm64-Debug-Graphite,Build-Mac-Clang-arm64-Debug-ASAN_Graphite,Build-Mac-Clang-arm64-Debug-Graphite_NoGpu
Bug: skia:12703
Change-Id: Iea08a885565811c442e8177b3fa0c668db95fd0f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/521008
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
DrawList's recording functions that paralleled the defined Renderers are
removed in favor of a single recordDraw() call that takes a Renderer.
Device has to do too much logic around determining draw ordering that
is coupled with the selected Renderer's requirements (e.g. stencil)
that it is easier to have a Renderer selector that Device uses, and
then it can inspect the requirements of that Renderer and modify the
ordering tracking as needed.
Right now, this renderer selection process is just in Device, but I
can imagine it living in its own object that the Gpu exposes so that
all wrappers around DrawContext make consistent decisions. This will
also come in handy if Renderers are created per Gpu instead of static.
Bug: skia:12703
Change-Id: I73b5254b7c4183f4c4e54cf5e2993ab8143bd4bd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/521006
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
The KeyContext is used in the addToKey methods but must appear in the
AddToKey methods bc the latter can call the former.
Bug: skia:12701
Change-Id: I3143afec8337b1e3e12f1c3cc198714009ca6930
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/520539
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>