Byte types were removed from SkSL in http://review.skia.org/404219.
Change-Id: Iec726de0be2ce371a20e21638638a495fae282a0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/463498
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Bug: skia:12466
Change-Id: Ie4c1973427e96d84b77f28edb5a4d6f1d53ef8aa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/463316
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Bug: skia:12466
Change-Id: Ic312ce41b5eb0ae0c20e6b76032b984d9a406d89
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/462884
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Bug: skia:12466
Change-Id: I734c3a9595948dfb74f8ec72684183fe743bfefb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/462883
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
* Keep RenderPass-related routines together
* Rename setRenderPipeline to bindRenderPipeline
* Pass resources as const& to platform-specific routines, to avoid
copies.
Bug: skia:12466
Change-Id: I4c3ea006263ace4a050b6c86f70163f5fd5e254a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/463336
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
With this you should be able to set skia_enable_gpu=false in your gn
args and still be able to compile and run graphite.
Bug: skia:12466
Change-Id: Ibffc8774a8c46afad3f717dabc54fa831338a807
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/463317
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Bug: skia:12466
Change-Id: I8a31cd8480199a941dfc1d9d1092f8a1dafdb0da
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/462882
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Bug: skia:12466
Change-Id: I794de6af814ab1b3e9517e139582e06382ecf957
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/462881
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Bug: skia:12466
Change-Id: I273fbb51730d85cda6921747e72ace2b9d7601e1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/462880
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Bug: skia:12466
Change-Id: If90c17634de9caa2ac3a928187226339523d53eb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/462879
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Bug: skia:12466
Change-Id: Ifd70300896504f8567e6395c3d3683f0d37c905b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/463056
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Also adds test of texture copyback to CommandBufferTest, and
endEncoding() to BlitCommandEncoder.
Bug: skia:12466
Change-Id: I57e4646aacc1d950cc16b70d7feeced1a04e6867
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/462078
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Bug: skia:12466
Change-Id: I5c0c919d4523258a11b4545346093953a4f09c7e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/461597
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Jul started. It does not work yet.
Change-Id: Ie2c3d943f281dae86befff64f7342c097a5bc7b9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/455257
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Bug: skia:12466
Change-Id: I7be58aca7eedf18e4157d9473216785eead8c89a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/461700
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This can successfully build a C library:
bazel build --config=clang //third_party:libpng
This can build and run a statically-linked executable:
bazel test --config=clang //:bazel_test
For more verbose compile and linking output, add the
`--features diagnostic`
flag to a Bazel command (see _make_diagnostic_flags() in
toolchain/clang_toolchain_config.bzl. Similarly, a
`--features print_search_dirs` can be used to show where
clang is looking for libraries etc to link against.
These features are made available for easier debugging.
Suggested review order:
- Read https://docs.bazel.build/versions/4.2.1/tutorial/cc-toolchain-config.html
if unfamiliar with setting up C++ toolchains in Bazel
- .bazelrc and WORKSPACE.bazel that configure use and download
of the toolchain (Clang 13, musl 1.2.2)
- toolchain/build_toolchain.bzl which downloads and assembles
the toolchain (w/o installing anything on the host machine)
- toolchain/BUILD.bazel and toolchain/*trampoline.sh to see
the setup of the toolchain rules.
- toolchain/clang_toolchain_config.bzl to see the configuration
of the toolchain. Pay special attention to the various
command line flags that are set.
- See that tools/bazel_test.cc has made a new home in
experimental/bazel_test/bazel_test.cpp, with a companion
BUILD.bazel. Note the addition of some function calls
that test use of the C++ standard library.
The number being used to test the PNG library is the latest
and greatest that verifies we are compiling the one brought
in via DEPS (and not a local one).
- third_party/* to see how png (and its dependent zlib) have
been built. Pay special attention to the musl_compat hack
to fix static linking (any idea what the real cause is?)
- //BUILD.bazel to see definition of the bazel_test executable.
Change-Id: I7b0922d0d45cb9be8df2fd5fa5a1f48492654d5f
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/461178
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Bug: skia:12466
Change-Id: I7eb240985ce0c267bbc7be040e0f812407d31435
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/461699
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Except that applyClipToDraw doesn't actually evaluate any clip shapes,
and the BoundsManager is the slow/naive one, I think all the changes to
Device fully implement the tracking/work needed for color/depth sorting.
Bug: skia:12466
Change-Id: I74f38e56d34d822c2be35f1ebedfb7c00b87f04c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/460616
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Thise should have been aligned properly already due to their
placement, but it doesn't hurt to make it more explicit.
Change-Id: Idb6a03e93d86df7727324987f166d197d5e708a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/461377
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Bug: skia:12466
Change-Id: Id0419836ca96d99836879d509ca2cd1c9244d76f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/461598
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Bug: skia:12466
Change-Id: I44bd3899dea817318f83444f023c1c8adcfc2d1e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/459881
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
While we won't be transforming shapes, we do need an accurate way to
transform bounding boxes to device space. Right now this just uses
SkM44's mapRect function and converts to/from an SkRect. However,
under the hood SkM44 uses a similar negation trick as skgpu::Rect so
I need to explore if using Rect's internal structure directly will let
us compute the bounding box with fewer operations.
Additionally, SkM44's mapRect clips to a fixed w=epsilon plane, and I
think Transform::mapRect should just do the right thing and handle
w clipping/projection as accurately as possible.
Bug: skia:12466
Change-Id: I08c9df6c40cbcdcd8f622baae222bdf361d59070
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/460578
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Switches Shape to store kRect types as skgpu::Rect instead of SkRect,
although it can be constructed or set from an SkRect. It returns a Rect
from rect() and bounds() now.
Also switches out the line to be constructed from float2's, and re-use
the fRect storage to store the first segment vertex in topLeft and
the second vertex in botRight.
Bug: skia:12466
Change-Id: I1032fb6f222b0853305186c0e34091b014ae0cea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/460577
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
This step was missing from the previous CL.
Bug: skia:12466
Change-Id: I3da0082efefbabf6008fc8962d706f75f0743ecc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/461176
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Implements a BSP tree with NEON/SSE optimizations that tracks
non-overlapping regions. This object can be used batch sets of paths
into non-overlapping draws. Performance on AppleM1 with our existing
benchmarks looks very promising:
desk_motionmarkarcs.skp 1227 paths -> 69 draws 450us
desk_motionmarksuits.skp 1417 paths -> 26 draws 201us
desk_chalkboard.skp 1940 paths -> 11 draws 84us
desk_ynevsvg.skp 859 paths -> 10 draws 31us
desk_micrographygirl.skp 318 paths -> 29 draws 11us
Bug: skia:12466
Change-Id: I847a93ed726dea10cb403cb76e578bd81eb920d2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/460298
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Bug: skia:12466
Change-Id: I89d41509b8158aabac5250f035115954e8ae7f4b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/460655
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Bug: skia:12466
Change-Id: Ibbb4894c6a46dd8853909214da85314f9abc3959
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/459880
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This attempts to salvage the reuseable portion of:
https://skia-review.googlesource.com/c/skia/+/440841 (New approach to GrProcessor uniforms)
It also removes the old code's Gr- dependencies.
Bug: skia:12466
Change-Id: I7f7f3a9f9b4f3e282af1caeb02d2b305e6756025
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/460556
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Bug: skia:12466
Change-Id: I69222b60d421d8deebcb977124ee0f5cb06f34dd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/460638
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Adds test of command buffer submission with GPU recording (if enabled).
Also adds programmatic GPU recording support.
Bug: skia:12466
Change-Id: I85aba9f7e5e09f62f2ddc7040d1ff84bb9b4ae09
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/460337
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Bug: skia:12466
Change-Id: I98acab4bbab2fdc1c359161956c3f0aa29ad7adc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/459884
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Transform.h is named Transform_graphite.h to avoid collision with
Transform.h in skottie/src
Bug: skia:12466
Change-Id: I017eee2bffe1a0aad605221e67540f732c2ee6b9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/459719
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Bug: skia:12466
Change-Id: I4c80d5438d95562ef42531b4f66a9eaa6ff75d1f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/459877
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Bug: skia:12466
Change-Id: I6b15d099f3853b392f3763cd1100d89ff4e4fd1d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/459122
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Bug: skia:12466
Change-Id: I3252f36c3f78642c55f127379ceba99b4845822e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/458717
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This makes the SkDevice interface and code simpler, and also opens the
door to a version of drawAtlas that takes a more complex SkShader (on
the SkPaint), rather than just a single SkImage.
Bug: skia:11942
Change-Id: I557bd2f03b85940b29954cb994916d5566bd7747
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/458980
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
With this CL we can run as:
dm --src gm skp tests --config grmtl -v --nocpu --nogpu
and not get all the non-Graphite unit tests.
Bug: skia:12466
Change-Id: Ib3f04f315fe4b5731a54e4c72979a0c1e00baf24
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/457898
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Bug: skia:12466
Change-Id: I49e1ec8308a0cde2b5d43901281d60a6f70be5c4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/457119
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Adds a line primitive back to geom::Shape since I just couldn't tolerate
drawPoints mallocing a path for every line. When Shape provides a path
like iterator, it will look equivalent to an SkPath that is a line, so
there won't be any reason to analyze an incoming path for a line, but
if we know we want a line, there's no reason to wrap it in a path.
DrawList and DrawContext now take Shapes for their path rendering funcs,
but are documented to use path rendering. It won't be like GrSDC that
tries to choose the algorithm under the hood from you.
Device has been heavily updated to funnel all the draw calls into a
new drawShape(), so the primitive functions do not malloc skpaths any
longer, even if they still end up using path renderering.
Additionally, instead of making new paints that have updated styles or
removed components, drawShape() takes an SkStrokeRec and ignores what's
on the paint, and has additional flags that tell it to ignore aspects
of the paint. This is used when it recurses, or for cases like drawPaint
where path effects and mask filters should be ignored (and eventually
other things like drawImage will ignore path effects and force a fill
style).
Bug: skia:12466
Change-Id: I4700c895ce3fefe2e437f3b4d329fd381593e037
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/457398
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Bug: skia:12466
Change-Id: I965417fc1de471af33a31155abf2760d5d1b4f62
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/457317
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Implements a Rect type whose standard operations use float4. The intent
of this class is to make calculations on draw bounds as fast as
possible.
Change-Id: I3bdb219b242bb7097809507c345b613670ff386e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/457136
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Just having an skpu namespace should be enough.
Change-Id: I3026ece828aee7a57f8c5de2252ebc79d97baf7a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/458636
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Classes of issues addressed:
1. static constexpr class variables aren't automatically inline. Already handled in a separate CL
2. Lack of C++17 copy elision means classes of objects constructed at function return need a copy or move constructor even if RVO will mean it isn't called.
3. Nested braced init no longer allowed for base classes of subclasses without constructors.
4. template static constexpr var in template class throws error about redundant initialization. Adding inline and removing defn outside of class fixes it.
5. Some places that should have been including std headers now actually need to include them.
6. No auto template parameters.
7. No lambdas in constexpr funcs.
Bug: chromium:1257145
Change-Id: Icb24c6b4ed039287fb4cf27a21a1bb7dc9821728
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/457298
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This is in prep for compiling with -std=c++14 and -Wno-c++17-extensions
when building with clang. Chrome has encountered problems with
third_party headers that are included both in Skia and other Chrome
sources that produce different code based on whether preprocessor macros
indicate a C++14 or C++17 compilation.
In C++17 they are already inline implicitly. When compiling with C++14
we can get linker errors unless they're explicitly inlined or defined
outside the class. With -Wno-c++17-extensions we can explicitly inline
them in the C++14 build because the warning that would be generated
about using a C++17 language extension is suppressed.
We cannot do this in public headers because we support compiling with
C++14 without suppressing the C++17 language extension warnings.
Bug: chromium:1257145
Change-Id: Iaf5f4c62a398f98dd4ca9b7dfb86f2d5cab21d66
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/457498
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Bug: skia:12466
Change-Id: I401a185d818a964327d323b9ebcd0850ec0b1c9b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/457318
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Makes the Make() method consistent with other methods by passing in
Gpu, and adds hooks for command buffer tracking.
Bug: skia:12466
Change-Id: If93c2126b1296dcbf788b5471916051fe90dafdf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/457319
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
* Rename TFlagsMask<> to Mask<>
* Make Mask<> implicitly convertible to bool
* Rename SKGPU_MAKE_BITFIELD_CLASS_OPS to SKGPU_MAKE_MASK_OPS
* Remove the macro for non-class enums
Change-Id: I86059335d731f34c9c9c20a4cd6d5491543aa3b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/456816
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
With this change it should now be safe to start using Proxys and Textures
everywhere. There is no caching the Proxys/Textures will live as long as
someone holds a ref.
Bug: skia:12466
Change-Id: I3c657b65b44b9dca0a77a255d6a4fc89e3862124
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/456916
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This is basically GrShape except that I removed some of the API that
GrStyledShape used. I also changed the set of types that Shape can
represent to be better match what I imagine our final set will be in
graphite: {empty,point,line,rect,rrect,path,arc}
-> {empty,rect,rrect,path,convex-polygon}
The convex polygon is used to store points and lines as well. I also
imagine that it will subsume the need for migrating GrQuad over.
I'm doing this on its own in preparation for moving the ClipStack over
and consolidating the draw handling in Device/DrawList, all of which
get a lot easier if there is a single type that stores the geometry.
For the first milestone, actual rendering will still likely use
Shape::asPath() for the path renderer, but it's not a lot of extra work
to preserve the logical type at the high level, so may as well do that.
There are a few functions internal to Shape that still need to be
implemented (converting a path to a list of vertices, and doing point
containment), but those can come in a later CL.
Bug: skia:12466
Change-Id: I1040c54e3b8004f3bc1767d72ded60b572b39596
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/456257
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Bug: skia:12466
Change-Id: I1224ad193bb9d866439673161075e29adedc0008
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/456475
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Adds in test pipeline state object creation and shader compilation
routine.
Bug: skia:12466
Change-Id: Ie8d99078a2cebf1da37576e5a50a798fc79c295b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/456472
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Bug: skia:12466
Change-Id: I730c227a78040ea8747d11437032504527b3ee81
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/456463
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Bug: skia:12466
Change-Id: I9165e5f49e4b897f4b315662221b944e362b7b41
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/456456
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
The caller to ResourceProvider should be passing in the TextureInfo
they want. Thus we don't need all the specialized factores on
mtl::Texture.
Also removes UsageFlags from Texture which aren't needed.
Bug: skia:12466
Change-Id: Iad51a7da6efe481382a3f5fbaefc6d2504d1c013
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/456236
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Bug: skia:12466
Change-Id: I97d8743057199abd88948f0804cceb4180ad8b74
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/455997
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Copied from GrMtlResourceProvider, and stripped down to the barest minimum.
Bug: skia:12466
Change-Id: I63cb52ee4bbc4c6ce5a1de16312bd4c69911d32c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/455619
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Bug: skia:12466
Change-Id: If4a06bc0ab8befab8a155276c316ba9378b90a48
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/455658
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Adds factory for SampledTextures and MSAA textures
Bug: skia:12466
Change-Id: Ia8aa7fa874e8256fe4dea8a16ceb459dbb02547d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/455618
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Bug: skia:12466
Change-Id: I9828c59f0406e457e723f78940b1f42ff343fa2e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/455500
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Every command that's in a DrawList will produce 1-3 SortKeys (depending
on its type of draw and the number of steps involved). For example a
large non-convex path fill requires a stencil draw for the curves, a
stencil draw of its inner triangles, and a covering draw for shading.
Since the SortKeys are only temporary and can be discarded once the
list has finished being converted into the DrawPass itself, they are
defined in the cpp file. However, I could see exposing them if only so
that the conceptual model is more apparent, since this is a key part
of the new approach in graphite.
Related to the details of the SortKey, the DrawList and SDC APIs have
been updated to reflect the differences in stencil-and-fill path
rendering that needs to be ordered based on both its color-depth
intersections and stencil buffer intersections, and convex filled
paths that don't require stenciling at all.
As a little cleanup, these parameters have been named something to
reflect their semantics even though they stay uint16_t's.
Bug: skia:12466
Change-Id: I02d6361f2889c0a6b341623131e4abda00a11145
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/455216
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Bug: skia:12466
Change-Id: I38f3469c53414c36b05f3bdbc266b50783cfa676
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/455496
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Bug: skia:12466
Change-Id: I3a22d03e5042a94f2bf6d379b2fff17f0b48edb3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/455217
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
For reasons I don't understand, rewrite-includes suddenly started
detecting these experimental files as needing their includes rewritten.
Change-Id: Ie62e8861169dfb988840e74976248992633874e2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/455160
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Bug: skia:12466
Change-Id: Iee62164899742356abf15ae3bc3dec0e724a365d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/454743
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Bug: skia:12466
Change-Id: I6207af8bb34ccab28265ced733e1930f42e2db8b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/454776
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Bug: skia:12466
Change-Id: I3299940af72cffde3904cf5f6262955807d6d1bc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/453637
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Bug: skia:12466
Change-Id: If708d8a4bd00802e60a860215edcb64db179e573
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/454616
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Adds the interface between C++ and Objective-C code so we can create
the Gpu.
Bug: skia:12466
Change-Id: I0c4b5d21ddaa119c21682105dc84d75769f069f6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/453952
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Bug: skia:12466
Change-Id: I90ebec9ee744de3822bd82d474858015d2490d72
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/453636
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Bug: skia:12466
Change-Id: Ida0113701b7ba2b45b5bddcc76d2729c8658fb14
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/453948
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Bug: skia:12466
Change-Id: Ibe9f09c3801ca22a9b390b0e7a7623a6b73da162
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/453944
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Also adds the Mtl subclass as well
Bug: skia:12466
Change-Id: Ia3a81f33a00374a96765fde3a3442c5e13188ad1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/453719
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Allocates and initializes the caps with GpuFamily and Group info.
Bug: skia:12466
Change-Id: I7abb8b6df2acf2ac70f3fbe56e935f44815776dd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/453796
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
This is mainly to make make MtlBackendContext available.
GrTypes has to go to GraphiteTypes due to a name collision with Types.h in in sktext.
Bug: skia:12466
Change-Id: If073d5540c3dbf3fbfb404808d80deab42c40aa6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/453497
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Bug: skia:12466
Change-Id: I2ba1f1541c273ba90032c93a92ed3770dc5b0080
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/453756
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Updates SDC's state to be a current DL and a list of pending passes,
RenderPassTask then takes over the DrawPasses.
Does not rename SDC to DrawContext as discussed in 9/27 meeting.
Bug: skia:12466
Change-Id: I358d15bc93663729438e5b6f7163eee22dc6769f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/453296
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Bug: skia:12466
Change-Id: I83ebf7dbea0d67b3c121b011f62e7b729f5e5257
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/453577
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
A test of GREATER, as opposed to GEQUAL, allows us to avoid double
blends during stroking.
Change-Id: I1d39b54416934ee354146fe42c58299f00f7a6e9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/453616
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Bug: skia:12466
Change-Id: Ie949a17166b3ab5c529b74a6762c8a6f8ca8052f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/453061
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Renames SDCTask -> RenderPassTask and adds comments describing its
purpose. Has SDC use a DrawList and expose similar drawing functions.
Stubs out all Device methods that will eventually need to be supported,
but groups them into in-scope and out-of-scope sections. Implements the
drawing functions in terms of drawPath() and has drawPath() invoke the
SDC functions (with untested support for path effects, hairline, etc.).
Bug: skia:12466
Change-Id: Id661fc987aeb35f0dfa536c0cb0b6210742cf32c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/452233
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Bug: skia:12466
Change-Id: I51dc73a213e672578767b41c01c487c942465964
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/452722
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Bug: skia:12466
Change-Id: I30b53802d706406faf8045264c09a75ee3bf9126
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/452232
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Bug: skia:12466
Change-Id: I1267d3a387e74dc510ee4d00925049a4e7ac9edd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/452557
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This makes "dm --config grgl --src gm skp" generate a lot of green pngs and adds a stub class for Image_Graphite.
Bug: skia:12466
Change-Id: Ia7cf891ad278434f473cf6c9c4673bf8fa085adf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/451740
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Device will own and manage a BoundsManager, which it will use to decide
the sort and test Z's that it passes to the DrawCommandList in its
draw() implementations.
DrawCommandList might end up being owned by the SDC, with the SDC
exposing a similar drawing API. There will need to be some mechanism to
end a DrawCommandList and start a new one (the list moves into an
SDCTask). This would either happen from an external flush call, or in
the rare case where the representable Z values are exhausted and we
have to insert a depth buffer clear and start a new task that depends
on the prior one.
Bug: skia:12466
Change-Id: I892b631037dc801eb94da2462683c9701afa281b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/451599
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
and fix up the #include guards
Bug: skia:12466
Change-Id: I865ebb00827001b2cf0f7d871e872a7be0f36c22
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/451156
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Change-Id: Ice0826af0b64fa8dd92975f879af8ab0f71740fc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/451039
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This should at least get something compiling.
Change-Id: I617fd4d6e4f0a3fdd6dedbe66f3a4448bb913b2c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/450976
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>