Using many small staging buffers is quite costly for performance, for
example when there are many small texture uploads (such as MotionMark's
"canvas bouncing clipped rects" test).
Instead, the new manager uses buffers of 32K minimum, and returns
suballocations of those.
For now, allocation is simply iterates through the list of staging
buffers and returns the first one with enough remaining space.
This is O(N) in the number of staging buffers, which should be
ok since there are fewer of them. (If it becomes a hot path, we
can optimize it later.)
This also subsumes the UBO-specific staging buffer, since that one
did much the same thing but did not reuse staging buffers.
Change-Id: I4fddee8bb0fc602c49fe552acc327a640bf6917b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279921
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
Supports buffer creation and destruction.
Bug: skia:9935
Change-Id: I6d8c6d67209a8857989a9384818272e7108177ad
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281577
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Change-Id: I16c392abe36d7aac7be2dee47116d873a8787afd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281378
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Bug: skia:9935
Change-Id: I4c2d70f69e30f78caca0f49629880565f178f495
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280609
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Changes the GrD3DTextureResourceInfo member in GrD3DBackendSurfaceInfo
to be a unique_ptr<> so we can use forward refs.
This will allow us to use a shared_ptr variant to manage the
ID3D12Resource on GrD3DResourceResourceInfo, without polluting
client files with Windows definitions. Clients can use GrD3DTypes.h
to get the full declarations, GrD3DTypesMinimal.h for only the forward
references.
Bug: skia:9935
Change-Id: I075a3fc608bf6767dae202efd8cbf06cdd4a9457
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280602
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Change-Id: If918db1153f6b5bf7057e00f3d36113fc88d889d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279919
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
It was only used for the sRGB color filter, and GrColorSpaceXformEffect
works just as well.
Change-Id: I6727d2bf7cc60a876742b0dbd980d8ef40ae16fe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/278788
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Bug: skia:9935
Change-Id: I91b6218946ba04e893adaec3c0077653a62efe2e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279136
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Also renames GrD3DSurfaceResource to GrD3DTextureResource. This makes
things consistent with our naming convention in Vulkan, and with the
terminology used in Direct3D.
Bug: skia:9935
Change-Id: I6e6d2066ac70eb8a0d63c1b5731f31851a3017d5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279338
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Ambiguity has come up re: what "tessellation" means in Ganesh. I
believe that, in the context of a graphics library, "tessellation"
should refer to the hardware pipeline feature of submitting patches
and tessellating them on the GPU. This CL therefore renames classes
that triangulate things on the CPU to call it "triangulation".
Change-Id: Ic8515ea6a33000f1b638a852d5122bc9bd6b38f2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279236
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Change-Id: I62880a83d9b59d42c6491125e2a62338d2ce757f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279200
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Bug: skia:9935
Change-Id: Idd37e677462fec7ed0beca0fe578fb1a2f497eb8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/278784
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Previously, the GrAllocator header defined three types: GrAllocator,
GrTAllocator, and GrSTAllocator. GrAllocator was generic, and would
manage the blocks of memory (fixed size to hold N * sizeof(item)). It
stored an SkTArray of pointers to each block. GrTAllocator wrapped
the GrAllocator to add template support for a specific T. GrSTAllocator
extended GrTAllocator to include a template arg for inline storage.
In this CL, GrAllocator is no longer defined, and its memory functionality
is replaced with the use of GrBlockAllocator. For the most part, the
implementation of GrTAllocator on top of GrBlockAllocator remains the
same, although there is explicit array to the block pointers so indexing
is slightly different. GrSTAllocator is also removed entirely, so that
GrTAllocator's template includes initial storage size.
The iteration over the allocated items
is updated to wrap GrBlockAllocator's block iterator, and then iterate
by index within each block. Documentation on GrAllocator already recommended
using the iterator instead of random access, and these changes further
reinforce it. It turns out that many of the use cases of GrAllocator
were written to use random access, so many of the files outside of
GrAllocator.h have just been updated to use the new for-range iteration
instead of a random access for loop.
Change-Id: I28b0bc277c323fd7035d4a8442ae67f058b2b64c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272058
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
This doesn't do much except creates the new class.
Change-Id: I157abaddd173bf1b6ab5eba2539e90c4d530a273
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/278469
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Add GrD3DTextureInfo and GrD3DBackendSurfaceInfo, and uses those
to initialize GrBackendTexture and GrBackendRendertarget.
Bug: skia:9935
Change-Id: I4571c1b3aa8115250ff748deb8cf4a95f80f1237
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/278036
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This had a not-very-useful matrix utility in it. We've had setSkMatrix
for a while, and the one other user always wanted a 4x4, which can be
done with SkM44 just as easily.
Change-Id: I3f00a0a1ccaf58bc9c775da4eef819af5a5fa7e8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277605
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This moves the byte block linked list structure outside of GrMemoryPool
into a new type, GrBlockAllocator. This new type is solely responsible
for managing the byte blocks, tracking where the next allocation
occurs, and creating/destroying the byte blocks. It also tries to
encapsulate all of/most alignment related math, while making it
convenient for clients to add per-allocation padding/metadata.
It has added functionality compared to the original block linked list
that was embedded in GrMemoryPool:
- Supports resetting the entire allocator
- Supports resizing the last allocation
- Is able to rewind an entire stack of allocations, instead of just the
last allocation.
- Supports multiple block growth policies instead of just a fixed size.
- Supports templated alignment, and variable alignment within a single
GrBlockAllocator
- Query the amount of available memory
- Performs as much math as possible in 32-bit ints with static asserts
that ensure overflow won't happen.
Some of this flexibility was added so that the GrBlockAllocator can be
used to implement an arena allocator similar to SkArenaAlloc, or to
replace the use of SkTArray in GrQuadBuffer. It is also likely possible
that GrAllocator can be written on top of GrBlockAllocator. I will try
to perform these consolidations in later CLs.
Change-Id: Ia6c8709642369b66b88eb1bc46264fb2aa9b62ab
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262216
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Seems very one-off (esp. given SkSL). No one seems to use it.
Change-Id: Iaded54c5b4183fa4aa9c318b5dbe1d410cca539a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276617
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Metal and D3D don't require the GrGpu to delete resources, and for
Vulkan, we'll store the GrVkGpu in each individual resource. This will
allow us to use sk_sp<SomeManagedResource> in the future.
Bug: skia:9935
Change-Id: Id51022b935ad360367976a6bdf60cdda9e3f7dee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276456
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Bug: skia:9935
Change-Id: Ie13b9077c5db805020973e5cbab1aa8468c88742
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276214
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Bug: skia:9935
Change-Id: I28f799cb53eb12fc1bd63f4fbcf1e1a09d7ccf3e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/274937
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Beginning steps for adding textures and buffers.
Bug: skia:9935
Change-Id: Ib7a361a88c99ede4f89a456794b955e3c2750afa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275457
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This reverts commit e5a06ce678.
Reason for revert: Need to make change in google3 first
Original change's description:
> Move GrGpuResource GrSurface and GrTexture into src.
>
> Must land https://chromium-review.googlesource.com/c/chromium/src/+/2087980
> before this can land.
>
> Bug: skia:7966
> Change-Id: I60bbb1765bfbb2c96b2bc0c9826b6b9d57eb2a03
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275077
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
Change-Id: Id39e0a351e49a87209de88a6ad9fadb0219db72c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7966
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275216
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Trying to stage the texture format CLs in a little at a time.
Bug: skia:9935
Change-Id: I0fc6fe09fdb55d6c24b53af7edbcc8e8fc857ed7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273803
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Change-Id: Ie50b15323df0a71c8d4276e3bc603061e469824d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273465
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This is a reland of af5f9f008d
This was reverted due to Metal GMs failing. That is a bug in Metal where
pipeline creation fails with "internal error". Reporting to Apple, filing
Skia bug, and moving on.
Original change's description:
> Remove GrDeviceSpaceTextureDecalFragmentProcessor.
>
> It was used to sample clip masks using device coords.
>
> Replace with a more generic GrDeviceSpaceEffect that simply calls a
> child FP with sk_FragCoord.
>
> Also fix issue in GrQuadPerEdgeAA GP. It wouldn't setup coord transforms
> at all if they are all applied in the FS (explicit coords). Moreover,
> the GrGLSLGeometryProcessor::emitTransforms() helper required a valid VS
> var for local coords even when all FPs use explicit coords and wouldn't
> use a local coords var.
>
> Make CPP SkSL code gen for clone copy the explicit coord status of
> children.
>
> Change-Id: Ib8bb36028354405c8012f6e91e9eb46db75d16a6
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271658
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
Change-Id: Ia4530e6799019cd92863fe983a2d3c71df6f0620
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273511
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This is a reland of 29dc430f43
Original change's description:
> Create D3D device and queue
>
> Bug: skia:9935
> Change-Id: Ib6548f413ca3a8befb553d2d47354b400c9162b9
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272520
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
Bug: skia:9935
Change-Id: I1c8797e09cdeb3694ea7f47b2236ab7d91d9519f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272996
Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This reverts commit 29dc430f43.
Reason for revert: This is breaking the Google3 autoroller due to header file d3d12.h not being available on google3.
Original change's description:
> Create D3D device and queue
>
> Bug: skia:9935
> Change-Id: Ib6548f413ca3a8befb553d2d47354b400c9162b9
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272520
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com
Change-Id: I3857444cae52cc2338258c46b974ae5496bbaedc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9935
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272726
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Commit-Queue: Leandro Lovisolo <lovisolo@google.com>
Bug: skia:9935
Change-Id: Ib6548f413ca3a8befb553d2d47354b400c9162b9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272520
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
This reverts commit af5f9f008d.
Reason for revert: bad GM results on Metal
Original change's description:
> Remove GrDeviceSpaceTextureDecalFragmentProcessor.
>
> It was used to sample clip masks using device coords.
>
> Replace with a more generic GrDeviceSpaceEffect that simply calls a
> child FP with sk_FragCoord.
>
> Also fix issue in GrQuadPerEdgeAA GP. It wouldn't setup coord transforms
> at all if they are all applied in the FS (explicit coords). Moreover,
> the GrGLSLGeometryProcessor::emitTransforms() helper required a valid VS
> var for local coords even when all FPs use explicit coords and wouldn't
> use a local coords var.
>
> Make CPP SkSL code gen for clone copy the explicit coord status of
> children.
>
> Change-Id: Ib8bb36028354405c8012f6e91e9eb46db75d16a6
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271658
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
TBR=bsalomon@google.com,brianosman@google.com
Change-Id: Ie02951dcc037d282dc3829cad216a0a0c9474038
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272518
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
It was used to sample clip masks using device coords.
Replace with a more generic GrDeviceSpaceEffect that simply calls a
child FP with sk_FragCoord.
Also fix issue in GrQuadPerEdgeAA GP. It wouldn't setup coord transforms
at all if they are all applied in the FS (explicit coords). Moreover,
the GrGLSLGeometryProcessor::emitTransforms() helper required a valid VS
var for local coords even when all FPs use explicit coords and wouldn't
use a local coords var.
Make CPP SkSL code gen for clone copy the explicit coord status of
children.
Change-Id: Ib8bb36028354405c8012f6e91e9eb46db75d16a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271658
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
With this, can specify d3d config for dm and it will create a GrContext
with GrD3DGpu (stubbed in).
Bug: skia:9935
Change-Id: I0b8635bc541c61833b08b60a9f6e1341d1373090
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271743
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Bug: skia:
Change-Id: Id24ed653adb80fe9b2ad597a34e459eb91ca53ec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271057
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
If a path is small and simple enough, we now try to atlas it. There
is only one atlas and it caps at 2048x2048. Once it runs out of room,
everything just draws direct. The atlas is rendered using the existing
GrTessellatePathOp. It provides alpha8 coverage even for msaa render
targets.
Change-Id: I715da9ce7347b6f1ef8e28b3e13ab47f6eade1c7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/268724
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This is a hybrid approach where we stencil only the curves using GPU
tessellation shaders, and then tessellate the path's inner polygon on
CPU and draw it directly to the final render target, stencilled
against the curves. Tessellating just the inner polygon is more than
fast enough to do in real time, and still allows us fill in the
majority of pixels in a single render pass. It gives us most the
benefit of CPU tessellation, but at a fraction of the cost.
Furthermore, the tessellated inner polygon can potentially be cached
and reused independent of the view matrix.
Change-Id: Id45adc643b51ab80a0c655dd2045a5314bdc7507
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/266456
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Moves the interface up to Ganesh level and starts using it from other
locations.
Change-Id: I939d2b357d3ae8551976d0d71b877b72da403712
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/266063
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This is a reland of 77e1f84a84
Original change's description:
> Specialize SkRectanzier to SkRectanizerSkyline
>
> It looks like the pow2 rectanizer has never been used. Remove
> the unneeded abstraction for rectanizer everywhere.
>
> Change-Id: Iba33f1c6faf37201d03928ce8409751c212480a0
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265983
> Commit-Queue: Herb Derby <herb@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>
Change-Id: I09729ba2b0e4b8b1a229fef4b95e65195b33fdc7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/266180
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This reverts commit 77e1f84a84.
Reason for revert: breaking google3 roll?
Original change's description:
> Specialize SkRectanzier to SkRectanizerSkyline
>
> It looks like the pow2 rectanizer has never been used. Remove
> the unneeded abstraction for rectanizer everywhere.
>
> Change-Id: Iba33f1c6faf37201d03928ce8409751c212480a0
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265983
> Commit-Queue: Herb Derby <herb@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>
TBR=mtklein@google.com,herb@google.com
Change-Id: I2573534f3ea95c98d089f9c19b027564e77015db
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/266116
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
It looks like the pow2 rectanizer has never been used. Remove
the unneeded abstraction for rectanizer everywhere.
Change-Id: Iba33f1c6faf37201d03928ce8409751c212480a0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265983
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Wedges fanning out from the center work fine for relatively simple
paths, but for paths made up of thousands of verbs, a fan is an
inefficient triangulation to give the rasterizer. This CL adds a
tessellation mode that draws the inner polygon and standalone cubics
separately, and triangulates the inner polygon by recursive
subdivision.
This reduces the stencil time from 7.4ms -> 3.0ms on desk_ynevsvg.skp.
Change-Id: Ie56e760d98e6c69e9a97752fe851726f36a7f574
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265522
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Added this as an option to GrSaturateProcessor (also renamed it to
be more generic and end with FragmentProcessor).
Added a tweak to the unit test to check the new behavior.
(Raster was already doing the clamp).
Change-Id: Ic49fa5cd72b6c63430fb773baf8121546bf2b80d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265580
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Change-Id: I66a9e1dff1b3d877012b38804cfb9d13f2b65f2b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/264579
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Implements a simple first pass for a path renderer that uses the
classic Red Book "stencil then cover" method, and linearizes curves
with GPU tessellation shaders.
The new path renderer is disabled by default, and can only be enabled
in the viewer UI or by passing the "--pr gtess" flag.
Change-Id: Ic9354952e93c8b108577961760b4f0daa82d35aa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261715
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This reverts commit d7436a37ff.
Restores old file order in gpu.gni until Mac/Metal issue can be
debugged.
Change-Id: I6e2ee3bdc3b39270aeaaf28b9613e4ac49d38e1e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262801
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This reverts commit 90673ec665.
Reason for revert: Causes metal bot failures
Original change's description:
> Rename GrSimpleTextureEffect->GrTextureEffect
>
> It will become less simple.
>
> Change-Id: I409d0faba386597ae05738273d5ff773501eb358
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262383
> Auto-Submit: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
TBR=bsalomon@google.com,brianosman@google.com
Change-Id: Id25c9cde3c2048149409745f163e42c588de70c1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262514
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
It will become less simple.
Change-Id: I409d0faba386597ae05738273d5ff773501eb358
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262383
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
There is no change to the code (yet).
Change-Id: I1997d7ac070691a3384441028503f6dc8565bbf8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261182
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This change mostly just removes GrTextureContext and switches users to
directly creating GrSurfaceContexts. Outside of updating types, the factory
functions for creating Gr*Contexts have not been updated in this but will
be done in a followup.
Change-Id: I55257568d4c096c5fb48c5e38bfa2c01b824e7b5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/260289
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Change-Id: Id3222effc21aea673b4d5d82a98e3e60f34512b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/260278
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Move all the GrTextBlob methods to GrTextBlob.cpp. Under the old API
methods were called once per a glyphs so the methods were colocated
with the painter code. The APIs have changed to bulk, so the colocation
is no longer needed. In addition, the SubRun struct is going to move
from the GrTextBlob to the .cpp, so all these methods need to be together
soon.
Change-Id: I41124be0d5bcca29780be1a7f5c105268dadbe87
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/258566
Commit-Queue: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Herb Derby <herb@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Also deleted GrVkBufferView which isn't used anywhere.
Bug: skia:9603
Change-Id: Ia5a2cefe06a1e27a7d126990ea20a9d663d89c0c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255308
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Change-Id: I90f40467be145537cc08461fd3805606432f0cfd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254240
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: John Rosasco <rosasco@google.com>
Auto-Submit: John Rosasco <rosasco@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This reverts commit 078cf3e3b2.
Reason for revert: Appears to be blocking the Chrome roll due to Fuchsia build failures
Original change's description:
> Fully delineate GL usage w/ skia_use_gl
>
> Change-Id: I17424d2235c7a54c4cda036f01a0b99dadc4b632
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/252085
> Commit-Queue: Mike Klein <mtklein@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
TBR=mtklein@google.com,bsalomon@google.com,halcanary@google.com,rosasco@google.com
Change-Id: I17ba79bfe6e7f81c126eddbd50ca5384cfa4179c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/253098
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Change-Id: I17424d2235c7a54c4cda036f01a0b99dadc4b632
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/252085
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Although not necessary I would like to centralize/encapsulate the error checking so there is just one place to go to update/extend this code. It does have the nice property that, since we validate in the ctor and this object is immutable, we only have to do it once (and can delete some code spread throughout the code base).
Bug: skia:9455
Change-Id: Iaa26c7a896a9bd053358a6f8424d7f5944b0117e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/247339
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This is the first step in moving the marshaling of program information earlier in renderTask processing (i.e., to onPrePrepare).
Change-Id: I91e3baed9a128e845bd32f9dbbacd9b21d852a3d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244118
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This is a reland of 6fc04f88a8
Original change's description:
> Reland "SkSurface asynchronous read APIs allow client to extend pixel lifetime"
>
> This is a reland of ce240cc6fd
>
> Original change's description:
> > SkSurface asynchronous read APIs allow client to extend pixel lifetime
> >
> > Previously the pixel data passed to the client was only valid during
> > the client's callback. This meant if the client wanted to defer
> > processing of the data a copy was necessary.
> >
> > Now we pass an object to the callback and the pixel lifetime is tied
> > to the lifetime of that object.
> >
> > The object may be holding a GPU transfer buffer mapped. We don't assume
> > that the object will be released on the direct GrContext thread. So
> > when the object is destroyed it posts a message to a new type,
> > GrClientMappedBufferManager, hanging off the direct context. The direct
> > context will periodically check for messages and unmap and then unref
> > buffers so that they can be reused. Currently this is done in
> > GrContext::performDeferredCleanup() and GrDrawingManager::flush().
> >
> > The old API is kept around for backwards compatibility but it is
> > reimplemented as a bridge on top of the new mechanism.
> >
> > Also a utility function to SkImageInfo is added to directly make a new
> > info with a specified dimensions rather than passing the width and
> > height separately to makeWH().
> >
> > Bug: chromium:973403
> > Bug: skia:8962
> >
> > Change-Id: Id5cf04235376170142a48e90d3ecd13fd021a2a6
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245457
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
>
> Bug: chromium:973403, skia:8962
> Change-Id: I5cecd36276c8b6dc942cf549c7095db2df88530c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245678
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
Bug: chromium:973403, skia:8962
Change-Id: Ie584c1c3ef8021c976f71b708e53871c693cc450
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/246057
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This reverts commit 6fc04f88a8.
Reason for revert: Chrome roll failure suspect because of:
* https://chromium-review.googlesource.com/c/chromium/src/+/1837131 (22 commits)
* https://chromium-review.googlesource.com/c/chromium/src/+/1837214 (24 commits)
Original change's description:
> Reland "SkSurface asynchronous read APIs allow client to extend pixel lifetime"
>
> This is a reland of ce240cc6fd
>
> Original change's description:
> > SkSurface asynchronous read APIs allow client to extend pixel lifetime
> >
> > Previously the pixel data passed to the client was only valid during
> > the client's callback. This meant if the client wanted to defer
> > processing of the data a copy was necessary.
> >
> > Now we pass an object to the callback and the pixel lifetime is tied
> > to the lifetime of that object.
> >
> > The object may be holding a GPU transfer buffer mapped. We don't assume
> > that the object will be released on the direct GrContext thread. So
> > when the object is destroyed it posts a message to a new type,
> > GrClientMappedBufferManager, hanging off the direct context. The direct
> > context will periodically check for messages and unmap and then unref
> > buffers so that they can be reused. Currently this is done in
> > GrContext::performDeferredCleanup() and GrDrawingManager::flush().
> >
> > The old API is kept around for backwards compatibility but it is
> > reimplemented as a bridge on top of the new mechanism.
> >
> > Also a utility function to SkImageInfo is added to directly make a new
> > info with a specified dimensions rather than passing the width and
> > height separately to makeWH().
> >
> > Bug: chromium:973403
> > Bug: skia:8962
> >
> > Change-Id: Id5cf04235376170142a48e90d3ecd13fd021a2a6
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245457
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
>
> Bug: chromium:973403, skia:8962
> Change-Id: I5cecd36276c8b6dc942cf549c7095db2df88530c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245678
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,brianosman@google.com
Change-Id: I9e01d1b82fb399b94292441d91da51176bb161d9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:973403, skia:8962
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245956
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
This is a reland of ce240cc6fd
Original change's description:
> SkSurface asynchronous read APIs allow client to extend pixel lifetime
>
> Previously the pixel data passed to the client was only valid during
> the client's callback. This meant if the client wanted to defer
> processing of the data a copy was necessary.
>
> Now we pass an object to the callback and the pixel lifetime is tied
> to the lifetime of that object.
>
> The object may be holding a GPU transfer buffer mapped. We don't assume
> that the object will be released on the direct GrContext thread. So
> when the object is destroyed it posts a message to a new type,
> GrClientMappedBufferManager, hanging off the direct context. The direct
> context will periodically check for messages and unmap and then unref
> buffers so that they can be reused. Currently this is done in
> GrContext::performDeferredCleanup() and GrDrawingManager::flush().
>
> The old API is kept around for backwards compatibility but it is
> reimplemented as a bridge on top of the new mechanism.
>
> Also a utility function to SkImageInfo is added to directly make a new
> info with a specified dimensions rather than passing the width and
> height separately to makeWH().
>
> Bug: chromium:973403
> Bug: skia:8962
>
> Change-Id: Id5cf04235376170142a48e90d3ecd13fd021a2a6
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245457
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
Bug: chromium:973403, skia:8962
Change-Id: I5cecd36276c8b6dc942cf549c7095db2df88530c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245678
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This reverts commit ce240cc6fd.
Reason for revert: crashing in chrome unit test, abandoned context related?
Original change's description:
> SkSurface asynchronous read APIs allow client to extend pixel lifetime
>
> Previously the pixel data passed to the client was only valid during
> the client's callback. This meant if the client wanted to defer
> processing of the data a copy was necessary.
>
> Now we pass an object to the callback and the pixel lifetime is tied
> to the lifetime of that object.
>
> The object may be holding a GPU transfer buffer mapped. We don't assume
> that the object will be released on the direct GrContext thread. So
> when the object is destroyed it posts a message to a new type,
> GrClientMappedBufferManager, hanging off the direct context. The direct
> context will periodically check for messages and unmap and then unref
> buffers so that they can be reused. Currently this is done in
> GrContext::performDeferredCleanup() and GrDrawingManager::flush().
>
> The old API is kept around for backwards compatibility but it is
> reimplemented as a bridge on top of the new mechanism.
>
> Also a utility function to SkImageInfo is added to directly make a new
> info with a specified dimensions rather than passing the width and
> height separately to makeWH().
>
> Bug: chromium:973403
> Bug: skia:8962
>
> Change-Id: Id5cf04235376170142a48e90d3ecd13fd021a2a6
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245457
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,brianosman@google.com
Change-Id: Ic14cf07a7629b167c9f34a651aa87a0326e74207
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:973403, skia:8962
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245721
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Previously the pixel data passed to the client was only valid during
the client's callback. This meant if the client wanted to defer
processing of the data a copy was necessary.
Now we pass an object to the callback and the pixel lifetime is tied
to the lifetime of that object.
The object may be holding a GPU transfer buffer mapped. We don't assume
that the object will be released on the direct GrContext thread. So
when the object is destroyed it posts a message to a new type,
GrClientMappedBufferManager, hanging off the direct context. The direct
context will periodically check for messages and unmap and then unref
buffers so that they can be reused. Currently this is done in
GrContext::performDeferredCleanup() and GrDrawingManager::flush().
The old API is kept around for backwards compatibility but it is
reimplemented as a bridge on top of the new mechanism.
Also a utility function to SkImageInfo is added to directly make a new
info with a specified dimensions rather than passing the width and
height separately to makeWH().
Bug: chromium:973403
Bug: skia:8962
Change-Id: Id5cf04235376170142a48e90d3ecd13fd021a2a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245457
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Add version SkImageInfo::Make() that takes SkISize instead of separate
width and height.
Change-Id: I42aa79d23b19e22f5405631728c245b04bce0559
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245172
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Give it its own header file.
Make it store SkISize rather than separate int w/h.
Change-Id: I732f2774c561decac743a950959a70cbc162b67b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245163
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Change-Id: I87b0fc76ef48c1a21498e576853a6c3b4a6a98f9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242563
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Previously this clamping was inserted by the program builder.
Adds GrSaturateProcessor to handle saturating in the fragment shader.
Clamp the GrPaint color rather than using a fp when possible.
Has to be plumbed through GrTextureOp because that skips SkPaint
conversion.
Removes a usage of GrPixelConfig.
Bug: skia:6718
Change-Id: Ifa6544496d34677f17e797433e6ef3a97be5c2b2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242558
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Use managed staging buffers for texture uploads, uniforms and buffers.
Change-Id: I063707c160236725d27a1d1bfb197d3096a07b34
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238120
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Greg Daniel <egdaniel@google.com>
This will allow us to reuse the "setRelativeTo" logic in more places
than GL.
Bug: skia:
Change-Id: Ic67b211d2a1b27535187ddae8e4771f595dc0397
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239414
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
GrResourceAllocator.
Removes LazyInstantiationType. All callbacks can be invoked one time (if successful).
Lazy callbacks indicate whether their lifetime should be extended, which is used by
promise image proxy callbacks.
Promise image proxies are no longer deinstantiated at the end of flush and
GrDeinstantiateProxyTracker is removed. They will be instantiated the first time
they are encountered in GrResourceAllocator::addInterval (without actually adding
an interval) and then remain instantiated.
Also removes some "helper" versions of proxy factory functions that took fewer
params. They weren't much used outside of test code and as the total number of params
has grown their relative utility has diminished. We could consider a params struct
or radically simpler helpers that take only a few params if desired.
Change-Id: Ic6b09e7b807b66cb9fcbb7a67ae0f9faf345485f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238216
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
GrFence is implemented by a single MTLSharedEvent where we increase the
value with each new invocation. GrSemaphore uses a MTLEvent (the
assumption here is that we are signaling and waiting on the same device)
with an associated value that defaults to 1. For generating a large
number of GrSemaphores at once it should be possible to use the same
MTLEvent but with different assigned values.
Bug: skia:8243
Change-Id: Ic7de2d9d295fbe51e67bc7c3c4354257cb0774d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233416
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Change-Id: Ifbe4bcd40bcf316868d23c2edf73b2371c6cb312
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237119
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
GrDawnGpu vends ring buffer slices out of a persistent (larger) buffer.
GrDawnProgramDataManager::setData() now returns a BindGroup containing
the (possibly new) UBO bindings, as well as the texture and sampler
bindings.
Change-Id: Id6694d6f44a815cfbffe4293779bf9bf558a2365
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235866
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
In a follow up CL I will be merging GrRenderTargetOpList and GrOpList
since we no longer have need for that separation.
Change-Id: I267ead3beeceaece504968ca69165c425d38f761
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236337
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This also means copies are no longer part of OpList or GpuCommandBuffer.
Change-Id: I234de2c93ca13e069d7e4423a3c8b292be2eb500
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235831
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
AFAICT these three remaining uses of GrPendingIOResource were just real-ref placeholders (i.e., they just added 1 pending read and then held on to the GrPendingIOResource until object destruction).
Change-Id: Iba6bb199477d846d079999f09794422e240c675a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235458
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
These Ops don't need to go through the GrGpuCommandBuffer.
Change-Id: Ifa9c7d801c97c225989d2542709c89f36ddfdc5e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235799
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Change-Id: I0e6bc516eb43e7f7062f9d19e7ef8093324b551d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233997
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Change-Id: I9c636c939dffbb0b395f3e9ed3d9a55784a6d390
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233981
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
This is a reland of fe19203eb7
Original change's description:
> Initiate regeneration of mipmaps from proxy DAG land
>
> This allows us to resolve all the textures before executing a command
> buffer, rather than interrupting execution as is currently done in the
> GL backend.
>
> Change-Id: I998546b312d24cf47fc2c837e7c94fbf95571af0
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230636
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
Change-Id: Ic904d0b1bcb451bcb74cfae2204fb7297eaff108
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234016
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This reverts commit fe19203eb7.
Reason for revert: Turned a lot of bots red
Original change's description:
> Initiate regeneration of mipmaps from proxy DAG land
>
> This allows us to resolve all the textures before executing a command
> buffer, rather than interrupting execution as is currently done in the
> GL backend.
>
> Change-Id: I998546b312d24cf47fc2c837e7c94fbf95571af0
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230636
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
TBR=bsalomon@google.com,robertphillips@google.com,csmartdalton@google.com
Change-Id: Iaa8391b8fbd5a4f851ca41834c1dfeee4be6fedd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233836
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This allows us to resolve all the textures before executing a command
buffer, rather than interrupting execution as is currently done in the
GL backend.
Change-Id: I998546b312d24cf47fc2c837e7c94fbf95571af0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230636
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Remove beginDraw()/endDraw() in favour of applyState().
This allows for varying primitive topology between meshes in a single
draw: call applyState() prior to drawing each mesh in case the
primitive type changed.
Initial support for onClear() and onClearStencil() in GrNXTGpuRTCommandBuffer.
Modify beginRenderPass() to take the LoadOps for color and stencil, so we
can encode render passes for stencil operations.
Add support for reverse-subtract blend equation.
Also apply options overrides in caps initialization.
Change-Id: I8547961c414187dbc763a67d6c7ec4383d6ce6f6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/232136
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
Nothing is cached in this initial version; all the magic happens in
GrDawnGpuRTCommandBuffer::beginDraw(). It builds the program,
sets the uniform data, converts the vertex attributes, initializes
rasterization state and blend state, creates a pipeline and bind group
and sets them.
send[Indexed]InstancedMeshToGpu() encodes the Dawn draw commands.
GrDawnGpuProgramBuilder::beginRenderPass() then finishes
the command encoder and submits the resulting command buffer.
Change-Id: Ie9c160cd18a2c4ef1bde66f86a52227e3bf1b570
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230457
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
Adds a GrTextureResolveManager class and plumbs it through calls to
generate the drawing manager's dependency DAG. This new class is
currently unimplemented, but it wraps GrDrawingManager and will
eventually give limited access to functionality for making new tasks
that regenerate mipmaps and/or resolve MSAA. We will use this object
to move mipmap generation up to the DAG/proxy level.
Bug: skia:
Change-Id: Ie1deef21e7ae579a0262f2eeb93d451f0740d823
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/232633
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>