There is no need for this in the API.
Change-Id: I490156b7572dab389061744c0f7b400af03bb1c8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304605
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
In the case where the blocks were empty we used to return the
fallbackSize as opposed to the actual size of the block.
Bug: skia:10419
Change-Id: Ie36c81f3b98bf8e95a2881356489ac54a842b787
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304437
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Also mipMapped params to GrBackendTexture functions to mipmapped
GrBackendTexture::hasMipMaps -> GrBackendTexture::hasMipmaps
Misc test vars fMipMapped -> fMipmapped
Change-Id: Ic0651d14fc106c21b0ab45529875b95ed8dc2dfd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304598
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
This reverts commit 0f064041bf.
Reason for revert: unit test failures on some windows bots
Original change's description:
> Support moving blocks from one allocator to another
>
> Uses this new capability and the previously implemented reserve()
> feature to implement efficient concatenation of GrTAllocators.
>
> Change-Id: I2aff42eaf75e74e3b595d3069b6a271fa7329465
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303665
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
TBR=robertphillips@google.com,csmartdalton@google.com,michaelludwig@google.com
Change-Id: I931f2462ecf6e04d40a671336d0de7d80efd313d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304604
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
For consistency with other enums and public APIs.
Change-Id: I026da5529f11051693cae5691c7ad92fad5ed446
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304597
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Uses this new capability and the previously implemented reserve()
feature to implement efficient concatenation of GrTAllocators.
Change-Id: I2aff42eaf75e74e3b595d3069b6a271fa7329465
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303665
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
These changes were supposed to land yesterday, but I forgot.
Change-Id: I46aca428482f9812c1b025f9735ebe2c0ac02bf1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304602
Reviewed-by: Kevin Lubick <kjlubick@google.com>
I kept the data structures the same for both DirectMaskSubRun and
MaskSubRun to simplify the CL. Later CLs will specialize the
DirectMaskSubRun. I removed duplication in code where the code will not
be specialized in the future.
Change-Id: I231cf21412b09f1e442afdc515d7cb726d3d25e9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304061
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
As per convention, skottiekit/skottiekit is the folder that
will be published to npm. It has a bin directory that has the
full skottiekit build.
Change-Id: I95cbb80158bc8e6dbe3b0d8ae4ffcadd59a7bf9b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303925
Reviewed-by: Florin Malita <fmalita@chromium.org>
Change-Id: Ia2cfbca8982b57399b6681cbb4501c2933ab4df7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304576
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Assorted bugfixes for the non-analytical mask code path.
1) SkSG modulatePaint() should only override the blend mode when
one is specified (!= kSrcOver).
2) Some modes (notably intersect) require touching pixels outside the
mask draw geometry. These modes must be applied as a layer.
Introduce an explicit layer node in SkSG, and inject for masks which
require it.
Also refactor Subtract to use more natural blend and pathops modes,
instead of always inverting geometry.
TBR=
Change-Id: I412168d1ff61eb8e59907babe8f0e091f6fffacf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303997
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
Bug: skia:10477
Change-Id: Ie3a68dc718ef17d7e185638757903ee480910639
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304063
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
This can optimize cases in a allocate-release loop that moves back
and forth across the end of one block and the start of another. Before
this would malloc a new block and then delete it.
It also enables reserve() in higher-level data collections w/o blocking
bytes left in the current tail block.
Change-Id: Ide16e9038384fcb188164fc9620a8295f6880b9f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303268
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
* Add check to make sure we're not setting the same constant buffer
* Add check to make sure we're not setting the same pipeline state
* Cache descriptor tables to avoid unnecessary descriptor copies
and GPU descriptor table heap entries.
Change-Id: Ia68dacb347736287c24862c74fd3e231288f5c94
Bug: skia:10508
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303663
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Change-Id: I016de62543b5ba16a7193262cea343a77a71ba3b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304201
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Previously, these would produce a "valid" effect object, but it wouldn't
draw anything.
Bug: oss-fuzz:24070
Change-Id: I17d0ed1710196853da0694cac9f4c260312700a9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304064
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
We weren't leaking previously cause when we free the command pool it
frees all the buffers, but this allows us to reclaim the memory earlier.
Bug: skia:10438
Change-Id: I1364f3dc123aa89ebb2280f3b9691cffbd67aa78
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304156
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
The current algorithm runs an exponentially-increasing number of trials
based on the number of children supported by the fragment processor and
has become a large drag on test times. This version runs a fixed number
of trials to determine which optimization bits are able to appear, and
then continues running trials until each potential optimization has been
demonstrated successfully five times.
The algorithm doesn't attempt to check interactions between the various
optimization bits (e.g. a hypothetical bug that might only occur when
two optimizations interact with one another) but hopefully the minimum
of 100 successful trials is enough to shake out most issues.
Change-Id: I4eba7ace84739027a5aea8f8f895b44c4532b816
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304059
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
To extract metadata and validate the shader, we've added several
iterations over all program elements. This CL rearranges things
to iterate once (*). Variable conversion is moved to a separate
loop later, to help with nesting and readability.
Removes hard-to-read asserts. These were validating things enforced
by both the IR generator and unit tests.
*: Technically, there are additional implicit iterations when we call
SkSL::Analysis functions. Folding all of this into a single pass
would be even better, but much more complicated.
Change-Id: I4f5aa649e74094e94c365ad20ef2ac96082285cd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303924
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Mostly this is a lot of plumbing of sk_sp around instead of const*.
This does allow the d3d and vk backends to hold refs to the GrBuffers that
are bound on a command buffer. This means that our buffer alloc pools will
not try to reuse this buffers until the gpu is done with them. Previously
vk and d3d will sniff out if one of these buffers was being used again
while still active on the gpu and rip out the internal backend buffer and
allocate a new one which is not cheap. We see a lot of perf wins from
not doing this.
Change-Id: I9ffe649151ee43066dce620bd3e2763b029a9811
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303583
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Previously, this test layered its paints by calling
`addColorFragmentProcessor` multiple times. We intend to remove support
for multiple color FPs on a GrPaint in the near future, so we use input
fragment processors instead to generate the same result.
Change-Id: I33e82ce0067183189e69b2af0fe0c228d1d60f14
Bug: skia:10217
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303479
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Both D3DTextureRenderTarget and D3DRenderTarget can create MSAA
resources, and each had its own method. This consolidates everything
into one.
Also sets the default clear values for D3DTRT to be transparent black,
as often they're used to generate masks.
Change-Id: I3a573776d9445c6c73c0192e1ad56a70bc9c682b
Bug: skia:9935
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303270
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
GrTypesPriv seems safe to include even without the GPU backend, which
lets us remove the condition from the struct layout. Hoisting and
reformatting the type conversion code just to make the core of the
factory easier to read. (More of this is coming).
Change-Id: I6e36b92789debc7b2630117c285c592ca7cbc37b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304001
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
This is my super lazy fix for the attached, completely unimportant
false-postive bug. I haven't even paused to consider whether
colorCount=1 makes sense here.
An alternative is to use sk_ieee_double_divide() here to say "divide by
zero is fine, man". But I kind of like this: wScale will hoist out of
the loop just fine, and it's nice to have the pos==nullptr checks near
each other.
PS3: yep, we can.
Bug: oss-fuzz:24242
Change-Id: I380ff2610405488cdaf475c34617bc9b4427ade9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304019
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
The helper class allows us to regenerate a "random" fragment processor
with the same seed as many times as desired. This lets us check the
`compatibleWithCoverageAsAlpha` optimization without needing to clone
the input FP; instead, we can actually generate the FP under test three
times in a row, with the same random seed.
In a followup CL (http://review.skia.org/303479/) we will also leverage
this helper class to regenerate the FP under test with the same random
seed, but with a different input.
Change-Id: I1cd83082a949d555f7898970c8a1cc3002818286
Bug: skia:10384
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303657
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Bug: oss-fuzz:24246
Change-Id: Ib99a359b2f0c6ee55180734d6ae933b90e4f6ca8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303920
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
This also makes the effects deserialization available via compile flag.
Change-Id: Ib6692499a619205ac480a8823ce7de12c0a5a723
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303596
Reviewed-by: Nathaniel Nifong <nifong@google.com>
When we free a vk buffer cause of memory budget, we need to make sure the
buffer is unmapped before calling free on it. However, the old code was
calling unmap even on cpu backed vk buffers. The cpu data gets uploaded
during the unmap call via a transfer buffer. This puts us in a death spiril
of creating and trying to free resources due to budget issues.
This hopefully fixes the attached chromium bugs. I am not sure why the
allocator was eventually crashing but before the crash we ended up in this
craziness of creating and destroying buffers. Maybe we ended un OOMing and
messing with the allocator? Anyways getting rid of the spiril hopefully
gets rid of the crash.
Bug: chromium:1107173, chromium:1106889
Change-Id: I225738df092b4cf5f8b3c97123e06d82358c9b8b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303917
Auto-Submit: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
This test code is templated, but not really generic (it's only meant to
work with two specific classes) so it doesn't need to live in a header.
Change-Id: I38d4f2cc9637207eca678fc81ff35ebbd7e69fce
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303656
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>